0% found this document useful (0 votes)
93 views

DBMS File

Here are the steps to undo a delete query in Oracle: 1. Use the flashback query to view the data before it was deleted: SELECT * FROM table_name AS OF TIMESTAMP systimestamp - interval '1' minute; 2. If the correct rows were deleted, insert them back into the table from the flashback query results: INSERT INTO table_name SELECT * FROM table_name AS OF TIMESTAMP systimestamp - interval '1' minute WHERE condition_for_deleted_rows; 3. If an incorrect delete was performed, no action needs to be taken - the flashback query shows the original data. So in summary, Oracle

Uploaded by

Abhi Nav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

DBMS File

Here are the steps to undo a delete query in Oracle: 1. Use the flashback query to view the data before it was deleted: SELECT * FROM table_name AS OF TIMESTAMP systimestamp - interval '1' minute; 2. If the correct rows were deleted, insert them back into the table from the flashback query results: INSERT INTO table_name SELECT * FROM table_name AS OF TIMESTAMP systimestamp - interval '1' minute WHERE condition_for_deleted_rows; 3. If an incorrect delete was performed, no action needs to be taken - the flashback query shows the original data. So in summary, Oracle

Uploaded by

Abhi Nav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 32

DEPARTMENT OF Computer Science and Applications


GRAPHIC ERA HILL UNIVERSITY BHIMTAL CAMPUS
SATTAL ROAD, P.O. BHOWALI
DISTRICT- NAINITAL-263136
2021-2022

A
DBMS LAB Report
On
“ DATA BASE MANAGEMENT SYSTEM ”
Submitted in partial fulfilment of the requirement for the
IV semester
B.C.A.
By
Abhinav Baranwal
20041047
Under the Guidance of
Mr. Sudhanshu Maurya
(Department of Computer Science and Applications)
ACKNOWLEDGEMENT

The success and outcome of this report required a lot of guidance and assistance
from many people, and I am extremely fortunate to receive it all along the
completion of work. Whatever I have done is only due to such guidance and
assistance and I would not forget to thank them.
I also take this opportunity to express a deep sense of gratitude to, Mr.
Sudhanshu Maurya, Graphic Era Hill University, and other staff of school of
computing of our college for their cordial support, valuable information, and
guidance, which helped me in completing this task through various stages.

Lastly, I thank almighty, my parents, faculty, and my friends for their constant
encouragement without which this assignment would not be possible.

Thank You
Department of Computer Science and Applications

GRAPHIC ERA HILL UNIVERSITY, BHIMTAL CAMPUS


2021-22

STUDENT’S DECLARATION

I, Abhinav Baranwal, hereby declare the work, which is being presented in the

term-work, entitled “D.B.M.S. Lab” in partial fulfilment of the requirement for

the award of the degree B.C.A in the session 2021-2022, is an authentic record of

my own work carried out under the supervision of Mr. Sudhanshu Maurya.

The matter embodied in this term-work has not been submitted by me for the

award of any other degree.

Date: ………… ……………….

(Full signature of student)


Department of Computer Science and Applications
GRAPHIC ERA HILL UNIVERSITY, BHIMTAL CAMPUS
2021-22

CERTIFICATE

The term-work entitled “D.B.M.S. Lab” being submitted by

Abhinav Baranwal
Enrolment no PV-B2071502, Roll no. 2071502 to Graphic Era Hill University, Bhimtal

Campus for performing a good work carried out by him. He has worked under my guidance

and supervision and fulfilled the requirement for the submission of report.

(…………………) (……………………)

Mr. Sudhanshu Maurya Dr. Sandeep Budhani

Faculty-in-Charge (HOD, SOC)


DBMS LAB
ASSIGNMENT – 01

Q1. Create the tables


Described Below: a:
TABLE NAME:
CLIENT_MASTER

Column_Name Datatype Size


Client_no Varchar2 6(primary key)
Name Varchar2 20
Address1 Varchar2 30
Address2 Varchar2 30
City Varchar2 15
Pincode Number 8
State Varchar2 15
BALDUE Number 10,2

Query & Output:


b - TABLE NAME: PRODUCT_MASTER

Column_Name Datatype Size


Product_no Varchar2 6(primary key)
Description Varchar2 20
Profitprecent Number 4,2
Unitmeasure Varchar2 30
Qtyonhand Number 8
Reorderlvl Number 8
Sellprice Number 10,2
Costprice Number 10,2

Query & Output:

c - TABLE NAME: SALESMAN_MASTER


Column_Name Datatype Size
Salesman_no Varchar2 6(primary key)
Name Varchar2 20
Address1 Varchar2 30
Address2 Varchar2 30
City Varchar2 15
Pincode Number 8
State Varchar2 15
Salamt Number 10,2
Tgttoget Number 6,2
Ytdsales Varchar2 60
Query & Output:

Q2. Insert the following data into their respective


table
a - Data for Client_Master
Client_n Name City Pincode State BalDue
o
C00001 Ivan Bayross Mumbai 400054 Maharashtra 15000
C00002 Mamta Madras 780001 Tamil Nadu 0
C00003 ChhayaBankar Mumbai 400057 Maharashtra 5000

C00004 Ashwini Joshi Bangalore 560001 Karnataka 0

C00005 Hansel Mumbai 400060 Maharashtra 2000

Query & Output:


b - Data for Product_Master

Product_n Descripti Profitp Unitmeasur Qtyonhan Reorder Sellpric Cost


o on rece nt e d e pric
e
P000001 T-shirts 5 piece 200 50 350 250
P0345 Shirts 6 piece 150 50 500 350
P06734 Cotto 5 piece 100 20 600 450
n
Jeans
P07865 Jeans 5 piece 100 20 750 500
P07866 Trousers 2 piece 150 50 850 550
P07867 Pull Overs 2.5 piece 80 30 700 450
P07868 Denim 4 piece 100 40 350 250
Shirts
P07868 Lycra Tops 5 piece 70 30 300 175
P07869 Skirts 5 piece 75 30 450 300

Query & Output:


c - Data for Salesman_Master
Sales Name Address1 Address2 City Pincod e State Sales Target
_no amt

S00001 Aman A/14 Worli Mumbai 400002 Maharashtra S00001 100

S00002 Omkar 56 Nariman Mumbai 400005 Maharashtra S00002 200

S00003 Raj p-7 Bandra Mumbai 400007 Maharashtra S00003 100

S00004 Ashish A/5 Juhu Mumbai 400008 Maharashtra S00004 150

Query & Output:

DBMS LAB
ASSIGNMENT – 02

1. Find out the name of all the clients from client_mast


table.

2. Retrieve all the record from client_mast table.

3. Retrieve the list of names ,address ,city of all client from


client_mast.

4. List all the client who are staying in florida from


client_mast.
5. List of name of employee who have a salary less than
Rs3000 from employee table.

6. List the employee name job and department no. of


everyone whose name fall in the alphabetical range ‘c’ to
‘l’ from employee table.

7. List all employee whose name start with the letter k from
employee table.

8. List the department name which is located in Noida and


rocky creek from dept table.
9. List all employee name working in deprtment D002,D003
from employee table.

10. List all employee whose name start with ‘a’ and end
with ‘d’ from employee table.

11. List all manager and saleman with salary over 2500
from employee table.

12. Display all the employee names in ascending order of


their date of joining from employee table.

13. Display all employees in alphabetical order from


employee table.
14. List all employee who where hired during 1999 from
employee table.

DBMS LAB
ASSIGNMENT – 03

1. CHANGE THE CITY OF CLIENT_NO ‘B001’ FROM ‘GAINESVILLE’ TO ‘PAUL


STREET’ FROM CLIENT_MAST TABLE.
2. Change the bal_due of client_no boo5 to Rs. 2000 from client_mast
table.

3. Change the name of ‘infospace’ of client_no b004 in table client_mast.

4.Change the client_no. ‘b004’ to ‘b009’in client_mast.

5.Change the city of salesman from ‘jacksonville’ to ‘huston’ from


salesman_mast table.

6. Change the basic salary Rs 3000 where basic salary less than 2500 from
employee table.
7. Change the basic salary Rs 3000 where job in clerk from employee table.

8. Change the basic salary of employee number e004 to rs.3500 from


employee table.

9.Change the department name to ‘sales’ from the dept table where
deptno=’d004’.

10. Change the description of product number ‘pr065’ to AC in the


product_mast table.

11. Change the profit percentage of product number ‘pr065’ to 25% in the
product_mast table.
12. Change the available quantity of product_no ‘pr065’ to 120 in
product_mast table.

13.Change the cost price and selling price of product number ‘PR065’ to 5000
and 6250 in product_mast table.

14.Change a sequence name counter which is incremented by 1 and starts


with 1.

15. Change a sequence name counter which is incremented by 5 and starts


with 25.

DBMS LAB
ASSIGNMENT – 04
1. Delete all salesman from the salesman mast whose salaries are
equal to Rs. 2000.

2. Write a query to undo the above delete query.

3. Delete all products from product mast where the Qty Available is
equal to 100.

4. Write a query such that the above query cannot be undone.

5. Delete from client mast where the state venue is 'Illinois".


6. Delete all employees from employee where basic sal is less than
2000.

7. Write a query to mark the above two queries such the the second
delete operation is undone.

8. Delete employee from employee table where basic sal equal to


3000 and job = 'Clerk'

9. Delete employee from employee table where job= 'Clerk' or


'Manager'
10. Delete all records from Dept table.

11. Delete all managers and salesman with salary over 1500 from
employee table.

12. Delete all the employee name, job and department, no of


everyone whose name fall in the alphabetical range 'C' to 'L' from
employee table.
13. Write a Query so the following statement can be achieved 'Kim is
working as Manager since 15-12-2002' where Employee number is
E0001.

14.Rename the table name from Client mast to T_client_mast.

15 Write a query in which the column name should be


displayed as Employee Name from the Employee table.
DBMS LAB
ASSIGNMENT – 05

1. Add a column "Telephone No" of data type 'number' and size='10'


to the employee table.

2. Add a column "Country" of data type 'Char' and size 15' to the
client mast table

3. Increase the size of "description" field from 14 to 16 in


product_mast table.

4. Modify the "product no" key as a primary key from product_mast


table.
5. Drop the primary key of Client mast table.

6. Define the "Deptno" as not null constraint from Dept table.

7. Display Empno, Ename and Annual Salary of each employee from


employee table with a column name "Annual Salary" on the basis of
basic sal.
8. Add two columns "HOD" and "Strength" of datatype varchar2 and
size = 15 to the Dept table

9. Create a view as empview from employee table where basic_sal


equal to 3000 and Job = 'Clerk'

10. Drop the above created empview.

11. Create an index for client no on client mast table.


12. Create a view as empview from employee table with basic_sal,
empno and ename

13.Create a view as clientview from client_mast with all columns


of table.

14. Drop the above created empview view.

DBMS LAB
ASSIGNMENT – 06

1. Select the average salaries of each department where deptno is either


D001 or D002 from employee table

2. Select the name of the lowest paid employee from employee table

3. Select the highest paid employee from employee table.

4. Display the total number of rows in the employee table.


5. Display only those jobs where max sal >3000 in the employee table.

6. List the names and hiredate of the employees in deptno = D002, display
date formated as "12/03/03

7. List the name of employees whose hiredate is in the month of December


using Subur function

8. Count the number of people in department number D003.


9. Produce the following output using employee table:

EMPLOYEE

Kim (Manager)

Bruce Analyst)

10. Find out the difference between highest and lowest salaries.

11. Display the Sin and Sinh value of 45.


12.Display all job types in smaller case from employee table.
DBMS LAB
ASSIGNMENT – 07

1. Select those clients whose bal due is greater than value 2000 from
client mast table.

2. Count the total number of orders from product mast table.


3. Calculate the average price of all the products from product mast table.

4. Calculate the maximum and minimum product prices and rename the
output as max_price and min price respectively from product mast table.

5. Count the number of products having price greater than or equal to


1200.

6. Display the employee number and day on which employee hired from
employee table.
7. Display the Total number of working days of each employee from
employee table.

8. Display the date, 20 days after today's date.

9. Count all distinct job types from employee table.

10. Using LPAD function pad the job types with 15 characters by symbol.
11. Display the length of each employee name from employee table.

12. Display the value of 3 raised to 4 using power function.

13. Display the square root of 81.

14. Display the ename those are having sound like Kim from employee table

You might also like