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

Database Management Systems Week4

The document contains instructions to solve two sets of questions involving creating and querying multiple database tables by a deadline of April 17th. The first set involves tables for employees, works, and companies, and queries such as identifying primary and foreign keys, adding a column, and finding records meeting certain criteria. The second set involves tables for suppliers, parts, projects, and shipments, and queries such as identifying primary keys, finding suppliers in a certain city and status, and obtaining details, totals, and counts meeting given conditions.

Uploaded by

Kashyap Gunjan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Database Management Systems Week4

The document contains instructions to solve two sets of questions involving creating and querying multiple database tables by a deadline of April 17th. The first set involves tables for employees, works, and companies, and queries such as identifying primary and foreign keys, adding a column, and finding records meeting certain criteria. The second set involves tables for suppliers, parts, projects, and shipments, and queries such as identifying primary keys, finding suppliers in a certain city and status, and obtaining details, totals, and counts meeting given conditions.

Uploaded by

Kashyap Gunjan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Solve the following questions and submit to me latest by 17th April.

1. Create the following tables, enter at least 5 records in each table and answer the queries
given below.
EMPLOYEE ( Person_Name, Street, City )
WORKS ( Person_Name, Company_Name, Salary )
COMPANY ( Company_Name, City )
MANAGES ( Person_Name, Manager_Name )
a) Identify primary and foreign keys.
b) Alter table employee, add a column “email” of type varchar(20).
c) Find the name of all managers who work for both Samba Bank and NCB Bank.
d) Find the names, street address and cities of residence and salary of all employees
who work for “Samba Bank” and earn more than $10,000.
e) Find the names of all employees who live in the same city as the company for
which they work.
f) Find the highest salary, lowest salary and average salary paid by each company.
g) Find the sum of salary and number of employees in each company.h) Find the
name of the company that pays highest salary.

2. Create the following tables, enter at least 5 records in each table and answer the queries
given below.
Suppliers (SNo, Sname, Status, SCity)
Parts (PNo, Pname, Colour, Weight, City)
Project (JNo, Jname, Jcity)
Shipment (Sno, Pno, Jno, Qunatity)
a) Identify primary and foreign keys.
b) Get supplier numbers for suppliers in Paris with status>20.
c) Get suppliers details for suppliers who supply part P2. Display the supplier list in
increasing order of supplier numbers.
d) Get suppliers names for suppliers who do not supply part P2.
e) For each shipment get full shipment details, including total shipment weights.
f) Get all the shipments where the quantity is in the range 300 to 750 inclusive.
g) Get part nos. for parts that either weigh more than 16 pounds or are supplied by
suppliers S2, or both.
h) Get the names of cities that store more than five red parts.
i) Get full details of parts supplied by a supplier in London.
j) Get part numbers for part supplied by a supplier in London to a project in London.
k) Get the total number of project supplied by a supplier (say, S1).
l) Get the total quantity of a part (say, P1) supplied by a supplier (say, S1).

You might also like