TRANSACTION CONTROL LANGUAGE (TCL) and DATA CONTROL LANGUAGE (DCL)

35 programming challenges to help you master the fundamentals of DATABASE MANAGEMENT SYSTEM USING ORACLE.

1

Grant SELECT privilege on EMP table to a user named USER1.

(GRANT – BASIC SELECT)

2

Grant SELECT and INSERT privileges on EMP table to USER2.

(GRANT – MULTIPLE PRIVILEGES)

3

Grant all privileges on DEPT table to USER3.

(GRANT – ALL PRIVILEGES)

4

Grant SELECT privilege on EMP table to USER4 with GRANT OPTION.

(GRANT – WITH GRANT OPTION)

5

Grant UPDATE privilege only on SAL column of EMP table to USER5.

(GRANT – COLUMN LEVEL)

6

Grant DELETE privilege on EMP table to USER6.

(GRANT – DELETE)

7

Grant SELECT privilege on both EMP and DEPT tables to USER7.

(GRANT – MULTIPLE TABLES)

8

Grant privileges on EMP table to PUBLIC.

(GRANT – PUBLIC ACCESS)

9

Grant INSERT privilege on EMP table to USER8 with the ability to grant further.

(GRANT – WITH GRANT OPTION)

10

Grant UPDATE and DELETE privileges on EMP table to USER9.

(GRANT – UPDATE & DELETE)

11

Revoke SELECT privilege on EMP table from USER1.

(REVOKE – BASIC)

12

Revoke INSERT and UPDATE privileges on EMP table from USER2.

(REVOKE – MULTIPLE PRIVILEGES)

13

Revoke ALL privileges on DEPT table from USER3.

(REVOKE – ALL)

14

Revoke GRANT OPTION from USER4 on EMP table.

(REVOKE – GRANT OPTION)

15

Revoke UPDATE privilege on SAL column from USER5.

(REVOKE – COLUMN LEVEL)

16

Revoke DELETE privilege on EMP table from USER6.

(REVOKE – DELETE)

17

Revoke privileges granted to PUBLIC on EMP table.

(REVOKE – PUBLIC)

18

Revoke all privileges on EMP table from USER9.

(REVOKE – CLEANUP)

19

Insert a new employee record into EMP table and commit the changes.

(COMMIT – INSERT)

20

Update salary of employees in department 10 and commit the changes.

(COMMIT – UPDATE)

21

Delete employees with salary less than 1000 and commit the transaction.

(COMMIT – DELETE)

22

Insert multiple records into DEPT table and commit them together.

(COMMIT – MULTIPLE OPERATIONS)

23

Update department location and commit the changes.

(COMMIT – DEPT TABLE)

24

Insert a new employee into EMP table but rollback the transaction.

(ROLLBACK – INSERT)

25

Update salary of employees and then rollback the changes.

(ROLLBACK – UPDATE)

26

Delete records from EMP table and rollback the transaction.

(ROLLBACK – DELETE)

27

Perform multiple operations (INSERT, UPDATE, DELETE) and rollback all changes.

(ROLLBACK – MULTIPLE OPERATIONS)

28

Update department location and rollback before committing.

(ROLLBACK – DEPT TABLE)

29

Insert a new employee, update salary, and commit only after verifying results.

(TRANSACTION – COMMIT CONTROL)

30

Insert multiple employees, rollback one operation using SAVEPOINT, then commit remaining.

(TRANSACTION – SAVEPOINT + COMMIT)

31

Create a transaction where some operations are committed and others are rolled back.

(TRANSACTION – PARTIAL CONTROL)

32

Demonstrate use of SAVEPOINT in EMP table operations.

(TRANSACTION – SAVEPOINT)

33

Perform update on EMP table and rollback to a specific SAVEPOINT.

(TRANSACTION – ROLLBACK TO SAVEPOINT)

34

Grant privileges to a user, perform DML operations, and commit changes.

(GRANT + TRANSACTION)

35

Revoke privileges and verify access restrictions using EMP table.

(REVOKE – PRACTICAL SCENARIO)