0% found this document useful (0 votes)
129 views8 pages

Lab 1

This document summarizes a lab experiment on data definition and manipulation commands in a database management system. It includes 15 queries on creating, populating, copying, modifying and deleting tables to demonstrate inserting data, selecting data, modifying structure and data, and removing data and tables. It also includes 7 additional queries demonstrating the use of constraints to validate data values and relationships during inserts and updates.

Uploaded by

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

Lab 1

This document summarizes a lab experiment on data definition and manipulation commands in a database management system. It includes 15 queries on creating, populating, copying, modifying and deleting tables to demonstrate inserting data, selecting data, modifying structure and data, and removing data and tables. It also includes 7 additional queries demonstrating the use of constraints to validate data values and relationships during inserts and updates.

Uploaded by

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

CSE2004-Database Management Systems

Lab Experiment 1

Raguman K
16BCE0917

Aim: To study Data Definition and Data Manipulation commands.

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:

Query 5: Get salaries of the employees without duplications.

Screenshot 5:

Query 6: Retrieve the MgrSSN, MgrStartDate of the manager of ‘Research’ department.

Screenshot 6:

Query 7: Change the department number of an employee having fname as ‘Joyce’ to 3

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:

Query 11: Change name of Table Department to DEPT.

Screenshot11:

Query 12: Alter Table department by removing column MobileNo.

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:

Query 15: Remove COPYOF DEPT table.

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:

Query 3: Insert ( '677678989', null, '40.0' ) into WORKS_ON.

Screenshot 3:

Query 4: Insert ( '453453453', 'John', M, '12-DEC-60', 'SPOUSE' ) into DEPENDENT

Screenshot 4:

Query 5: Insert ( '343453453', 'Varun',’’, '12-DEC-60', 'SON' ) into DEPENDENT

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:

You might also like