Unit 1 DBMS
Unit 1 DBMS
Unit 1 DBMS
UNIT 1, 2 - ASSIGNMENT
Batch 1 : 1,4,5 (Roll num 1,9,10,14,6)
Batch 2: 2, 7 ,8 (Roll num 2,4,8,7,13)
Batch 3: 3, 9 ,6 (Roll num 3,5,11,12)
1. Create Tables as follows by choosing appropriate data type and set the necessary primary
and foreign key constraints: Product (Prodid, Prodesc, Price, Stock) Purchase (Purid,
Proid, qty), Add a column customer name in Purchase table.
4. Write a SQL query to fetch employee names having salary greater than or equal
to 5000 and less than or equal 10000.
5. Examine the structure of the EMPLOYEES table. You issue the following
command:
INSERT INTO EMPLOYEES (employee_id , first_name , job_id) VALUES
(5100, 'BRUCE', 'CLERK');
Assuming that there is a duplicate value check constraint on the
EMPLOYEE_ID column, what will be the outcome of the above statement?
How would you approach this problem using multivariate analysis?
6. Write an SQL query to Select all employees from department numbers 7369,
7499 and Display all the details of the records whose employee name starts
with ‘S’.
7. Design an ER diagram for keeping track of the exploits of yourfavourite sports team. You
should store the matches played, the scoresin each match, the players in each match, and
individual playerstatistics for each match. Summary statistics should be modelled as derived
attributes.
8. You need to find the salaries for all the employees who have a higher salary than the Vice
President of a company 'ABC'.What is the query used to obtain the result?
(Consider the table structure as given)
SQL> DESC employees
PHONE_NUMBER VARCHAR2(20)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
9. Construct an ER diagram for a car insurance company whose customers own one or more
cars each. Each car has associated with it zero to any number of recorded accidents. Each
insurance policy covers one or more cars, and has one or more premium payments associated
with it. Each payment is for a particular period of time, and has an associated due date, and
the date when the payment was received.