Professional Documents
Culture Documents
Advanced Database (Lab)
Advanced Database (Lab)
Advanced Database (Lab)
Eyasu D.
Outline:
• View
• Trigger
? create view which display all employee details for those who are department 1.
• CREATE VIEW emp_dpt1 As Select * From Employee WHERE DNO= 1
Eyasu D.
Examples
• View2
• Contains employee fname, salary and address of those working either in
department 2 or who earn salary greater than 7000
Eyasu D.
exercises
Create the following view based on STUDENT table
Fname Lname SID Dept GPA
• View1
• Contains only information of computer science student
• View2
• Contains student id, dept and GPA
• View3
Eyasu D.
• Contains student id, dept and GPA of computer science student
Data Control Language (DCL)
• Used for controlling the access to database objects for users. Generally
these statements will be used by DBA people to control the access of users
to the database.
• We have 2 DCL statements available in SQL.
1.GRANT
2. REVOKE
Eyasu D.
GRANT
• Grant will be used for giving permissions on the database to users. Using this we can
give any type of permissions to the users on the database.
For example if we want to give Select permission on all the database tables to a user,
Like this we can give any privilege to the users on the database.
Eyasu D.
Grant:
Eyasu D.
ExampleGrant: Insertion for Abel to employee table
Eyasu D.
Exercise
User log name Password Privilege given On Table Propagation
name to user
Sara Log11 abc@123 Select Employee No
Eyasu D.