0% found this document useful (0 votes)
19 views3 pages

Worksheet Week1

This is a document with sql important questions

Uploaded by

himansipowers
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)
19 views3 pages

Worksheet Week1

This is a document with sql important questions

Uploaded by

himansipowers
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/ 3

DBMS Lab Practice

WEEK-1 DDL and DML Commands


1. Create a table called Employee with the following structure.
Name Type
Empno Number
Ename Varchar2(20)
Job Varchar2(20)
Mgr Number
Sal Number
a. Add a column commission with domain to the Employee table.
b. Insert any five records into the table.
c. Update the column details of job
d. Rename the column of Employ table using alter command.
e. Delete the employee whose empno is 19.
2. Create department table with the following structure.
Name Type
Deptno Number
Deptname Varchar2(20)
location Varchar2(20)
a. Add column designation to the department table.
b. Insert values into the table.
c. List the records of emp table grouped by deptno.
d. Update the record where deptno is 9.
e. Delete any column data from the table.
3. Create a table called Customer table
Name Type
Cust_name Varchar2(20)
Cust_street Varchar2(20)
Cust_city Varchar2(20)
a. Insert records into the table.
b. Add salary column to the table.
c. Alter the table column domain.
d. Drop salary column of the customer table.
e. Delete the rows of customer table whose cust_city is „hyd‟.
4. Create a table called branch table.
Name Type
Branch_name Varchar2(20)
Branch_city Varchar2(20)
assets Number
a. Increase the size of data type for asserts to the branch.
b. Add and drop a column to the branch table.
c. Insert values to the table.
d. Update the branch name column
e. Delete any two columns from the table
5. Create a table called sailor table
Name Type
Sid Number
Sname Varchar2(20)
rating Varchar2(20)
a. Add column age to the sailor table.
b. Insert values into the sailor table.
c. Delete the row with rating >8.
d. Update the column details of sailor.
e. Insert null values into the table.
6. Create a table called boats table
Name Type
bid number
bname char(20)
a. Add column color to the boats table
b. Insert 5 records into boats table
c. Display boat ids of red color boat
d. Display unique colors of all boats
e. Display all boats details
f. Delete green color boat from boats table
7. Create a table called reserves table
Name Type
bid Integer
sid Integer
day Integer
a. Insert values into the reserves table.
b. Add column time to the reserves table.
c. Alter the column day data type to date.
d. Drop the column time in the table.
e. Delete the row of the table with some condition

You might also like