Lab 1
Lab 1
Lab Experiment 1
Raguman K
16BCE0917
Query 1: Insert the data given above in employee, department and project tables.
ScreenShot 1:
Query 2: Retrieve all the employees’ information for a particular department number.
ScreenShot 2:
Query 3: Get Employee name along with his SSN and Supervisor SSN.
ScreenShot 3:
Query 4: Retrieve the employee names whose bdate is ’29-MAR-1959’.
Screenshot 4:
Screenshot 5:
Screenshot 6:
Screenshot 7:
Query 8: Alter Table department add column ContactNo of NUMBER data type and insert
values into this column only.
Screenshot 8:
Query 9: Change table department by modifying the size of field ContactNo.
Screenshot 9:
Query 10: Modify the field name ContactNo of departments table to MobileNo.
Screenshot 10:
Screenshot11:
Screenshot 12:
Query 13: Create a table COPYOFDEPT as a copy of the table DEPT.
Screenshot 13:
Query 14: Remove the rows from COPYOF DEPT table with department number as 5.
Screenshot 14:
Screenshot 15:
Exercise 2: Constraints
AIM: To know how the constraints are used to make table contain valid data.
Query 1: Insert ('Robert', 'F', 'Scott', '987987987 ', '21-JUN-42', '2365 Newcastle Rd, Bellaire, TX',
M, 58000, '888665555', 1 ) into EMPLOYEE.
Screenshot 1:
Query 2: Insert ('Ramez', 'F', 'Scott', ' ', '21-JUN-42', '2365 Newcastle Rd, Bellaire, TX', M,
58000,
'888665555', 1 ) into EMPLOYEE.
Screenshot 2:
Screenshot 3:
Screenshot 4:
Screenshot5:
Query 6: Delete WORKS_ON tuples with ESSN= '333445555'.
Screenshot6:
Query 7: Modify MGRSSN and MGRSTARTDATE of the DEPARTMENT tuple with DNUMBER=5
to '123456789' and '01-OCT-88', respectively.
Screenshot 7: