{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

3 superkey a superset of a candidate key is a

Info iconThis preview shows pages 36–39. Sign up to view the full content.

View Full Document Right Arrow Icon
(3) Superkey A superset of a candidate key is a superkey. A superkey has the uniqueness property but not necessarily the irreducibility property. (4) Functional Dependency If SK is a superkey for relvar R and A is an attribute of R, then the functional dependency SK A necessarily holds true in R. A superkey to be a subset SK of the attributes of R such that the functional dependency SK A holds true for all attributes A of R. (5) Triggered Procedure A triggered procedure is a procedure that is involves “automatically” on the occurrence of some specified event or trigger condition. 11. What do you understand about view, explain with reasons? (20-Marks) Solutions There are many reasons why view support is desirable. ± Views provide automatic security for hidden data (2-Marks) ± Views provide a shorthand or ‘macro’ capability (2-Marks) Consider the query ‘Get cities that store parts that are available from some supplier in London’. Assume view CITY-PAIR is given. (CITY-PAIR WHERE SCITY = ‘London’) {PCITY} (4-Marks) Without the view, the query is much more complex: ( ( ( S RENAME CITY AS SCITY ) JOIN SP JOIN ( P RENAME CITY AS PCITY ) ) WHERE SCITY = ‘London’ ) {PCITY} (4-Marks) There is a strong analogy here with macros in a programming language system. Thus, view in a database system play a role somewhat analogous to that of macro in a programming language system, and the well-known advantages and benefits of macro apply directly to views as well, mutatis mutandis. (3-Marks)
Background image of page 36

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
± Views allow the same data to be seen by different users in different users in different ways at the same time. (2-Marks) ± Views can provide logical data independence. This is one of the most important points of all logical data independence (a1) be defined as the immunity of users and user programs to change in the logical structure of the database. (3-Marks) 12. (1) Define a view consisting of supplier numbers and part numbers for suppliers and parts that are not colocated. (5-Marks) (2) Define a view for suppliers in London. (5-Marks) (3) Define relvar SP of the suppliers and parts database as a view of relvar SPJ of the suppliers-parts-projects database. (5-Marks) (4) Define a view over the suppliers-parts-projects database consisting of all projects (project number and city attributes only) that are supplied by supplier S 1 and use part P 1 . (5-Marks) Sol (1) VAR NON COLOCATED VIEW ( S TIMES P ) { S#, P# } MINUS ( S JOIN P ) { S#, P# }; (2) VAR LONDON SUPPLIER VIEW ( S WHERE CITY = ‘London’ ) { ALL BUT CITY }; (3) VAR SP VIEW SUMMARIZE SPJ PPE SPJ { S#, P# } ADD SUM {QTY} AS QTY; (4) VAR JC VIEW ( ( SPT WHERE S# = S# ( ‘S1’ ) ) { J# } JOIN ( SPT WHERE P# = P# ( ‘P1’ ) ) { J# } JOIN J { J#, CITY } 13. Give SQL solutions to the following operations. (20-Marks) (1) Define a view consisting of supplier numbers and part numbers for suppliers and parts that are not colocated. (5-Marks) (2) Define a view for suppliers in London. (5-Marks) (3) Define relvar SP of the suppliers and parts database as a view of relvar SPJ of the suppliers parts projects database. (2-Marks)
Background image of page 37
(4)
Background image of page 38

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 39
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page36 / 168

3 Superkey A superset of a candidate key is a superkey A...

This preview shows document pages 36 - 39. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online