Sie sind auf Seite 1von 2

LAB EXERCISE

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

COLUMN_ DATATYP LENGT KEY TYPE FOREIGN KEY FOREIGN


NAME E H TABLE KEY
COLUMN
Deptno Number 4 Primary Key
Dname Varchar2 30 Not Null
Check(SALES,PURCHASE,A
DMIN,FINANCE)
Loc Varchar2 30 Not Null
Check(CUTTACK,BBSR,RKL
,BPD)

2. Insert few data to LIT_DEPT table.

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

COLUMN_NAME DATATYPE LENGTH KEY TYPE FOREIGN FOREIGN


KEY TABLE KEY
COLUMN
EID Number 4 Primary Key
Name Varchar2 30 Not Null
Salary Number 7,2 Check(2000-
10000)
Not Null
Mgr Number 4 Foreign Key LIT_EMP EID
DEPTNO Number 4 Foreign Key LIT_DEPT Deptno
SUBJECT Varchar2 20 Unique

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

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

6. Insert few data to LIT_EMP table.

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

8. Disable the sal column constraint and enter an invalid record.

9. 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.

12. Delete Name and job Column from LIT_EMP using a single command.

barikbishnu192@gmail.com 9937917604 1
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 2

Das könnte Ihnen auch gefallen