Lecture 4
Lecture 4
1
Semantic Data Control
◼ Involves:
❑ View management
❑ Security control
❑ Integrity control
◼ Objective :
❑ Ensure that authorized users perform correct operations on the
database, contributing to the maintenance of the database
integrity.
2
View Management
3
View Management
Example :
4
Query Modification
SELECT ENAME,PNO,RESP
FROM EMP, ASG
WHERE EMP.ENO = ASG.ENO
AND TITLE = "Syst. Anal."
5
View Management
◼ To restrict access
CREATE VIEW ESAME
AS SELECT * Note that the user J. Doe
FROM EMP E1, EMP E2 also appears in the result.
If the user who creates
WHERE E1.TITLE = E2.TITLE ESAME is an electrical
AND E1.ENO = USER(); engineer, as
◼ Query
SELECT *
FROM ESAME
6
View Updates
◼ Updatable
CREATE VIEW SYSAN(ENO,ENAME)
AS SELECT ENO,ENAME
FROM EMP
WHERE TITLE="Syst. Anal."
◼ Non-updatable
CREATE VIEW EG(ENAME,RESP)
AS SELECT ENAME,RESP
FROM EMP, ASG
WHERE EMP.ENO=ASG.ENO
7
View Management in Distributed DBMS
8
Materialized View
9
Materialized View Maintenance
10