Вы находитесь на странице: 1из 2

LAB EXERCISE

Create the LIT_DEPT table based on the table following chart given below.

COLUMN_
NAME

DATATYP
E

LENGT
H

KEY TYPE

FOREIGN
TABLE

Deptno
Dname

Number
Varchar2

4
30

Loc

Varchar2

30

Primary Key
Not Null
Check(SALES,PURCHASE,A
DMIN,FINANCE)
Not Null
Check(CUTTACK,BBSR,RKL
,BPD)

KEY

FOREIGN
KEY
COLUMN

Insert few data to LIT_DEPT table.

Create the LIT_EMP table based on the table instance chart given below. Confirm
that the table is created by selection structure.

COLUMN_NAM
E

DATATYPE

LENGTH

KEY TYPE

EID
Name
Salary

Number
Varchar2
Number

4
30
7,2

Mgr
DEPTNO
SUBJECT

Number
Number
Varchar2

4
4
20

Primary Key
Not Null
Check(200010000)
Not Null
Foreign Key
Foreign Key
Unique

FOREIGN
KEY TABLE

FOREIGN
KEY
COLUMN

LIT_EMP
LIT_DEPT

EID
Deptno

Add new column job Varchar2 (30) to LIT_EMP table and confirm the change.

Increase the size of Name Colum to 50.Confirm the change.

Insert few data to LIT_EMP table.

Change the salary rule and provide a new rule between 2000 and 20000

Disable the sal column constraint and enter an invalid record.

Again enable the sal column constraint

10 Check the constraint name, table name and status from its data dictionary
11 Delete salary column from LIT_EMP table. Confirm the modification.

barikbishnu192@gmail.com

9937917604

12 Delete Name and job Column from LIT_EMP using a single command.
13 Create the EMP_COPY table based on the structure of the EMP table. Include only the
empno, Ename, sal, deptno columns. Confirm the structure.
14 Check the number of tables available inside the current user and their names.
15 Rename the EMP_COPY table to COPY_EMP.
16 Delete the COPY_EMP table logically from the database and display contents of
recycle bin.
17 Write a query to retrieve table COPY_EMP from recycle bin.
18 Delete the LIT_EMP table physically from the database.
19 Create the above LIT_EMP table with above specification. Now provide all the
constraints in table level. Impose ON DELETE CASCDE option to deptno.
20 Insert few records and update those salaries to 10000 whose salary is greater than
maximum salary of department 30.
21 Commit all pending changes.
22 Delete very first record from LIT_EMP. Confirm your changes to the table.
23 Discard the most recent DELETE operation.
24 Empty the entire table and confirm that table is empty permanently.
25 Empty the recycle bin.

barikbishnu192@gmail.com

9937917604