Question
Q1 Explain the difference among the terms Primary Key, Candidate Key and Super Key with suitable examples. Q2 Consider the following schema: Supplier(sid: integer, sname:
Q1 Explain the difference among the terms Primary Key, Candidate Key and Super Key with suitable examples.
Q2 Consider the following schema: Supplier(sid: integer, sname: string, address: string) Part(pid: integer, pname: string, colour: string) Catalog(sid: integer, pid: integer, cost: real) The relation Supplier stores suppliers and the key of that relation is sid. The relation Part stores parts, and pid is the key of that relation. Finally, Catalog stores which supplier supplies which part at which cost. The key is the combination of the two attributes sid and pid. A. Write the queries in relational algebra for the following: 1. Find the names of suppliers who supply some red part. 2. Find the IDs of suppliers who supply some red or green part. 3. Find the IDs of suppliers who supply some red part or are based at 21 George Street. 4. Find the IDs of suppliers who supply some red part and some green part. B. For each of the following relational algebra queries, write in English what they mean. 1. sname(colour=red(Part) cost<100 (Catalog) Supplier) 2. sname(sid(colour=red(Part) cost<100 (Catalog)) Supplier)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started