You are on page 1of 2

CSC385 Database Management Systems

Program BS(SE)/BS(CS)
Semester Fall 2022

Assignment

Note: Attempt All Questions. Also Show data using SELECT


statement to verify each query.

Q1) Make a new user named after your name and set your id as password. (Hint: user: ali
password:12345)

Q2) Grant necessary privileges to the user you’ve created. (Hint: create table, create session etc
don’t use grant all command)

Q3) Now connect to the user you’ve have created and make tables with following structure.
Student_info (s_id , s_name , s_semester );
Departments ( dept _no , dept_ name , dept_location,s_id );
Subjects ( sbj_id , sbj_name , sjb_CrHrs,s_id );

Note: s_id, dept_no and Sbj_id are primary keys, s_id is a foreign key in other tables. No
attribute is allowed to take NULL values.

Q4) Now Alter the tables and do the following changes:

i) Change the size/width of s_name attribute from Students_info table.


ii) Add a new attribute name sbj_dept into Subjects table. (hint: sbj_dept = CS/SE)

Q5) Insert records into the tables you’ve created (Atleast 5 rows in each).

Q6) Create a savepoint and then add or delete the records.


CSC385 Database Management Systems
Program BS(SE)/BS(CS)
Semester Fall 2022

Q7) Take back the schema to the savepoint you have created.

Q8) Empty all the tables. (Don’t delete the tables).

Q9) Create a public synonym and insert data into tables using another user.(i.e ali1
password:12345)

Q10) Delete all the tables and connect to SYSTEM.

Q11) Revoke all the privileges you have granted to user and then delete the user as well but
before that show all the privileges granted to that user.

You might also like