DBMS Practical 6
DBMS Practical 6
D.O.P: D.O.S:
CO22333 Page 1
PRACTICAL 6
D.O.P: D.O.S:
GRANT privilege_name
ON object_name
TO {user_name | PUBLIC | role_name}
[WITH GRANT OPTION];
REVOKE: used to revoke privileges from users or roles.
SYNTAX:
REVOKE privilege_name
ON object_name
FROM {user_name | PUBLIC | role_name}
WHERE: clause is used to filter records.
It is used to extract only those records that fulfill a specified condition.
Syntax:
SELECT column1, column2, ...
FROM table_name
WHERE condition;
ORDER BY :keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in
descending order, use the DESC keyword.
Syntax:
SELECT column1, column2, ...
FROM table_name
ORDER BY column1, column2, ... ASC|DESC;
PROCEDURE:
CO22333 Page 2
PRACTICAL 6
D.O.P: D.O.S:
4. SELECT I.name, I.dept_name, D.building, D.budget FROM instructor I INNER JOIN department
D ON I.dept_name = D.dept_name;
CO22333 Page 3
PRACTICAL 6
D.O.P: D.O.S:
CO22333 Page 4
PRACTICAL 6
D.O.P: D.O.S:
CO22333 Page 5
PRACTICAL 6
D.O.P: D.O.S:
CO22333 Page 6
PRACTICAL 6
D.O.P: D.O.S:
11. UPDATE `takes` SET `grade` = 'A+' WHERE `takes`.`ID` = '00128' AND `takes`.`course_id` =
'CS-347' AND `takes`.`sec_id` = '1' AND `takes`.`semester` = 'Fall' AND CONCAT(`takes`.`year`) =
2009;
12. INSERT INTO `student` (`ID`, `name`, `dept_name`, `tot_cred`) VALUES ('0122', 'RAM', 'CSE',
'100');
CO22333 Page 7
PRACTICAL 6
D.O.P: D.O.S:
CO22333 Page 8
PRACTICAL 6
D.O.P: D.O.S:
15. ALTER TABLE `time_slot` DROP PRIMARY KEY, ADD PRIMARY KEY(`time_slot_id`);
RESULT:
All the queries have been executed on banking database.
CO22333 Page 9