3 superkey a superset of a candidate key is a

Info icon This 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)
Image of page 36

Info icon This 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)
Image of page 37
(4) Define a view over the suppliers-parts-projects database consisting of all
Image of page 38

Info icon This 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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern