Professional Documents
Culture Documents
Arpit Chandra DBMS Practical File
Arpit Chandra DBMS Practical File
A
Term-Work
On
Arpit Chandra
2071540
…
Faculty-in-Charge
Dr. Sudhanshu Maurya
Associate Professor
SCHOOL OF COMPUTING
GRAPHIC ERA HILL UNIVERSITY, BHIMTAL CAMPUS
2021-22
STUDENT’S DECLARATION
I, Arpit Chandra, hereby declare the work, which is being presented in the term-work, entitled
“Database Management 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
The matter embodied in this term-work has not been submitted by me for the award of any other
degree.
CERTIFICATE
The term-work entitled “Database Management Lab.” being submitted by Arpit Chandra
S/o G. C. Arya enrolment no PV-B2071540 Roll no 2071540 to Graphic Era Hill University
Bhimtal Campus for the award of bonafide work carried out by him. He has worked under
my guidance and supervision and fulfilled the requirement for the submission of report.
(…………………) (……………………)
Output:
Ques 2: Create the table DEPT and insert the following values:
Output:
Ques 3: Create the table Client_Mast and insert the given data:
Output:
Ques 4: Create table Product_Mast and insert the following values:
Output:
Ques 5: Create table Salesman_Mast and insert the given values:
Output:
Lab Assignment 02:
Ques 1: Find out all the names of the names of the clients in the client_mast:
Output:
Ques 4: List all the clients who are staying in Florida from client_mast:
Output:
Ques 5: List the name of employees who have less salary than Rs 3000 from
employee table:
Output:
Ques 6: List the emp name, job and dept no, of everyone whose name fall in
the alphabetic range ‘C’ to ‘L’ from employee table:
Output:
Ques 7: List all the employees with the start of the letter ‘K’ in employee:
Output:
Ques 8: List the name of dept from the dept table which is located in Noida
and Rocky Creek:
Output:
Ques 9: List the emp name from dept ‘D002’ and ‘D003’ from employee:
Output:
Ques 10: List all employees whose name starts with ‘A’ and end with ‘D’
from employee table:
Output:
Ques 11: List all the managers and salesman with salary over 2500 from
employee:
Output:
Ques 12: Display all the employee name in the ascending order:
Output:
Ques 13: Display all the employees in alphabetical order from employee:
Output:
Ques 14: List all employee who were hired during 1999 from employee:
Output:
Ques 15: List all the employees whose commission is more than Rs. 300 from
employee:
Output:
Lab assignment 03:
Ques 1: Change the city of client_no ‘B001’ from ‘Gainesville’ to ‘paul street’
from client_mast:
Output:
Qus 9: Change the dname to sales from dept table where deptno is D004:
Output:
Ques 13: Change the SP and CP of PR065 to 6250 and 5000 in product_mast:
Output:
Ques 14: Change the units where the product number PR065 to ‘pack of 10’ in
the product_mast table:
Output:
Ques 3: Delete all the product from product_mast where the quantity
available is 100:
Output:
Ques 7: Write a query to mark the above two queries such that the
second query is undone:
Output: unable to do.
Ques 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.
Output:
Ques 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.
Output:
Ques 14: Rename the table name from Client_mast to T_client_mast.
Output:
Ques 15: Write a query in which the column name should be displayed as
Employee Name from the Employee table.
Output:
Lab assignment – 5
Ques 1: Add a column “Telephone_no” of data type ‘number’ and size =
‘10’ to the employee table.
Output:
Ques 2: Add a column “Country” of data type ‘Char’ and size = ‘15’ to the
client_mast table.
Output:
Ques 6: Define the “Deptno” as not null constraint from dept table.
Output:
Ques 7: Display empno, ename and annula salary of each employee from
employee table with a column name “Annual salary” on the basis of
basic_sal.
Output:
Ques 9: Add check constraint for dept field to the dept table check
deptno from the ‘D001’, ‘D002’ and ‘D003’.
Output:
Ques 10: Create a view as empview from employee table where basic_sal
equal to 3000 and job = ‘Clerk’.
Output:
Ques 11: Drop the above created empview.
Output:
Ques 13: Create view as empview from employee table with basic_sal,
empno and ename.
Output:
Ques 14: Create a view as clientview from client_mast with all columns of
table.
Output:
Ques 2: Select the name of the lowest paid employee from employee
table.
Output:
Ques 3: Select the highest paid employee from the employee table.
Output:
Ques 5: Display only those jobs where max sal >= 3000 in the employee
table.
Output:
Ques 6: List the names and hiredate of the employees in deptno = D002,
display date formatted as ‘12/03/03’.
Output:
Kim (Manager)
Bruce (Analyst)
Output:
Ques 10: Find out the difference between highest and lowest salaries.
Output:
Ques 11: How many months has the manager worked for the company
(Round value).
Output:
Ques 12: Display the top three earners with name and salary in the
company.
Output:
Ques 13: Display the sin and sinH value of 45.
Output:
Ques 15: Display all job types in smaller case from employee table.
Output:
Lab Assignment – 7
Ques 1: Select those clients whose bal_due is greater than value 2000 from
client_mast.
Output:
Ques 3: Calculate the average price of all the products from product_mast table.
Output:
Ques 4: Calculate the maximum and minimum product prices and rename the
output as max_price and min_price respectively from product_mast table.
Output:
Ques 5: Count the number of products having price greater than or equal to
1200.
Output:
Ques 6: Display the employee number and day on which employee hired from
employee table.
Output:
Ques 7: Display the total number of working days of each employee from
employee table.
Output:
Don’t know how to do it (googled it too)
Ques 8: Display the date, 20 days after today’s date.
Output:
Ques 10: Using LPAD function pad the job types with 15 characters by ‘*’
symbol.
Output:
Ques 11: Display the length of each employee name from employee table.
Output:
Ques 12: Display the value of 3 raised to 4 using power function.
Output:
Ques 14: Display the number of bytes used by ename from employee table.
Output:
Ques 15: Display the ename those are having sound like Kim from employee
table.
Output:
Lab Assignment – 8
Ques 1: Select the average salaries of each department where dept_no is either
D001 or D002.
Output:
Ques 3: Find avg, min, max salaries of employee from each dept_no.
Output:
Ques 4: Display the dept_no where more than two clerks are working.
Output:
Ques 5: Who was the first employee hired in each department_no.
Output:
Don’t know how to do.
Ques 6: Display the average month salary bill for each job type within a
dept_no.
Output:
Ques 8: Display only those jobs where max sal >= 3000.
Output:
Ques 9: Find out the employees who earn the highest salary in each dept_no.
Output:
Can’t do it
Ques 10: Display the employees who are doing the same job as ‘KIM’.
Output:
Ques 13: List names of employees who do not work in the marketing
department.
Output:
Lab Assignment – 9
Ques 1: Create the tables described below:
a- Table Name: Client_mast
b- Product_mast
c- Salesman_mast
d- sales_order
e- sales_order_detail
Ques 3: List the name of employees who do not work in the D001 department
from employee table.
Output:
Ques 4: Find the profit value of each product sold from product_mast table.
Output:
Ques 5: Find the products and their quantities that will have profit price greater
than 10 from product_mast table.
Output: