Dpms Ex
Dpms Ex
? Display only those rows whose total ranges between 250 and 300.
select * from mark_details where total between 250 and 300;
? Drop the table mark_details and Delete the row whose register_no=161.
delete mark_details where register_no=161;
drop table mark_details;
Definition of Grant:
The command is use to give user access privileges to a database.
Syntax: GRANT SELECT ,UPDATE ON MY_TABLE TO SOME_USER,ANOTHER_USER
example:GRANT SELECT ON USER TO 'Tom' @ Local cost:
Definition of Revoke:
It is useful to back permission from to user.
Syntax: REVOKE privilege_name on object_name from{user_name/PUBLIC role_name}
example:REVOKE SELECT,UPDATE ON STUDENT,FROM BCA MCA
Print the names of employees who have borrowed any books published by McGraw-Hill
select name from employee e,book b,loan l where e.empno=l.empno and l.isbn=b.isbn
and b.publisher='McGrawHill';
Print the names of employees who have borrowed all books published by McGraw-Hill.
select name from employee where empno in (select emp_no from book_i natural join
loan where publisher ='jam');
For each publishers, print the names of employees who have borrowed more than five
books of that publisher.
select name from employee where empno in (select emp_no from book_i natural join
loan where publisher in (select publisher from book_i natural join loan group by
publisher having count (publisher)>5));