0% found this document useful (0 votes)
9 views2 pages

DBMS Lab Q

The document outlines a series of SQL tasks related to various schemas, including procedures for updating, deleting, and inserting employee names, as well as queries for retrieving customer names, salaries, and product information. It also includes requirements for creating tables with constraints and using aggregate functions and set operations. Each task is associated with specific schemas such as Employ, Customer, Product, and Account, emphasizing data manipulation and retrieval techniques.

Uploaded by

lavanya.d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

DBMS Lab Q

The document outlines a series of SQL tasks related to various schemas, including procedures for updating, deleting, and inserting employee names, as well as queries for retrieving customer names, salaries, and product information. It also includes requirements for creating tables with constraints and using aggregate functions and set operations. Each task is associated with specific schemas such as Employ, Customer, Product, and Account, emphasizing data manipulation and retrieval techniques.

Uploaded by

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

1.

Consider the following schema


Employ (employee_id, empname, empsalary)
a) Write a procedure to update the name of the employee whose
employee_id is 7.
b) Use all the aggregate functions and group by clause on the given
schema.

2.
a) Find the customer name whose city is ‘Delhi’ for the following
schema Customer (custid, custname, custcity, custphno, custsalary).
b) Write a query to find third highest salary
c) Use all the aggregate functions on the given schema.
d) Write a query to find the customername in order
3.
a) create table which allows all the constraints for the following schema
Product (pid, pname, pprice) , Order (oid, pid, quantity, odate) and pid of
order has references to product
b) Find the products which are ordered on 15|September|2021.
c) Find the product whose name end with ‘r’.
d) Find the employees whose name contains atleast 3 characters.
4.
a) Consider the following schema and find the departmentno and name
of an employ who is drawing highest salary. Employ (empid, salary,
ename, deptno), Department (deptno, dname, managerid, location)
b) Use all the aggregate functions on the given schema.
c) Use Set Operations on the given schema
5.
a) Consider the following schema

Account (acno, bname, balance)


Customer (cname, cstreet, ccity)
Depositor (cname, acno)
Loan (lno, bname, amt)
Borrower (cname, lno) and
Acno of depositor and lno of borrower is referencing account and loan relations
respectively.
i) Display all customers who have both loan and account.
ii) Display the average account balance at each branch.
6. Consider the following schema
Employ (employee_id, empname, empsalary)
a) Create a procedure to insert the empname using select into clause.
b) Display the table information in order of their salaries.
c) Display the employees whose name ends with ‘a’.

7. Consider the following schema


Employ (employee_id, empname, empsalary)
a) Create a procedure to delete the name of the employee whose
employee_id is 7.
b) Find the empname whose name end with ‘h’.
c) Find the sum and avg salary using aggregate functions and group
by clause on the given schema.

8. Create table which allows all the constraints for the following schema
Product (pid, pname, pprice) , Order (oid, pid, quantity, odate) and pid of order
has references to product
a) Use Set Operations on the given schema
b) Write a query to update the pname.
c) Use all aggregation functions on given both schema.
d) Find the pname whose name starts with ‘h’

You might also like