SalesRecord(sID,sName,cID,pNo,pName,quantity)
sID,cID--->pNo,pName,quantity
sID--->sName
cID--->cName
pNo--->pName candidate key=sID,cID
for 1NF: sID,cID--->pNo
sID,cID--->pName
sID,cID--->quantity
sID--->sName
cID--->cName
pNo--->pName Therefore 1NF satisfied.
for 2NF: candidate key=sID,cID prime attributes: {sID,cID}
non-prime attributes: {sName,cID,pNo,pName,quantuty,cName}
sID,cID--->pNo : total dependency
sID,cID--->pName : total dependency
sID,cID--->quantity : total dependency
sID--->sName : partial dependency
cID--->cName : partial dependency
pNo--->pName : total dependency
R:[sID,cID,,pNo,pName,quantity] R1:[sID,sName,cID,cName]
sID,cID--->pNo sID--->sName
sID,cID--->pName cID--->cName
sID,cID--->quantity
pNo--->pName Therefore, 2NF satisfied.
for 3NF: sID,cID--->pNo :it is in 3NF
sID,cID--->pName :it is in 3NF
sID,cID--->quantity :it is in 3NF
pNo--->pName :it is not in 3NF, because there is transitive dependency.
R:[sID,cID,,pNo,pName,quantity] R1:[sID,sName,cID,cName] R2:[pNo,pName]
sID,cID--->pNo sID--->sName pNo--->pName
sID,cID--->pName cID--->cName
sID,cID--->quantity
Now, 3NF is satisfied.
7. A relation schema is given as SalesRecord(sID, sName, cID, CID, PNo, pName, quantity). The functional...
Consider the following schema and functional dependencies: SHIPPING (ShipName, ShipType, VoyageID, Cargo, Port, ArrivalDate) Key: ShipName, ArrivalDate FD1: ShipName > ShipType FD2: VoyageID > ShipName, Cargo FD3: ShipName, ArrivalDate > VoyageId, Port 1.Please list the final set of 3NF schema including all its keys. 2.Do any of the finalized 3NF schema have determinates that are not candidate keys? If yes, explain - which schema(s)? Why?
Consider the following relation R, where {A, B} is its PK. Assume that R is in the first normal form (INF). R (A, B, C, D, E, F) Functional dependencies: FD1: BàC FD2: AàDE FD3: ABàF Why is this table not in 2NF? Specify which FDs make R violate 2NF. Normalize the data shown in this table to second normal form (2NF). Specify the primary and foreign key (if any) in each table of your 3NF relations. Normalize the data...
EXERCISE 1 (SQL Queries) Consider the following schema: SUPPLIERS (SID : integer, SNAME : string, CITY : string) PARTS (PID : integer, PNAME : string, COLOR : string) CATALOG (SID : integer, PID : integer, COST : real) The key fields are underlined, and the domain of each field is listed after the field name. Thus, SID is the key for SUPPLIERS, PID is the key for PARTS, and SID and PID together form the key for CATALOG. The CATALOG...
Normalize EVERY relation to 3NF step by step Q1: Given the following table, identify the functional dependencies VisitID InvoiceDate Invoice Amt Invoiceltem 1002 11/09/2016 $65.00 Updated shots 1002 11/09/2016 $45.00 Flea & tick medications 1006 11/14/2016 $35.00 Heartworm medication 1006 11/14/2016 $65.00 Updated shots 1006 11/14/2016 $75.00 Lab work 1009 11/16/2016 $50.00 Grooming 1009 11/16/2016 $15.00 Nail trim 1012 11/21/2016 $65.00 Updated shots 1012 11/21/2016 $75.00 Lab work 1013 11/21/2016 $65.00 Updated shots 1013 11/21/2016 $75.00 Lab work 1014 11/21/2016...
Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...
Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...
Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string, ZIP: string) PARTS (PID: integer, PNAME: string, COLOR: string) CATALOG (SID: integer, PID: integer, COST: real) The primary key attributes are underlined, and the domain of each attribute is listed after the attribute name. Thus, SID is the primary key for SUPPLIERS, PID is the primary key for PARTS, and SID and PID together form the primary key for CATALOG. Attribute SID in CATALOG is a foreign...
Consider a relation R(A,B,C,D,E) with the following functional dependencies: 8. AB C BCD CDE DEA (a) Specify all candidate keys for R. (b) Which of the given functional dependencies are Boyce-Codd Normal Form (BCNF) violations'? (c) Give a decomposition of R into BCNF based on the given functional dependencies. (d) Give a different decomposition of R into BCNF based on the given functional dependencies. (e) Give a decomposition of R into 3NF based on the given functional dependencies.
Consider a...
Language: SQL - Normalization and Functional
Dependencies
Part 4 Normalization and Functional Dependencies Consider the following relation R(A, B, C, D)and functional dependencies F that hold over this relation. F=D → C, A B,A-C Question 4.1 (3 Points) Determine all candidate keys of R Question 4.2 (4 Points) Compute the attribute cover of X-(C, B) according to F Question 43 (5 Points) Compute the canonical cover of F.Show each step of the generation according to the algorithm shown in class....
Help ASAP! 1. (10 pts) Given a relation schema R = (A, B, C, D, G, H) and a set of functional dependencies F = {D -> G, CD -> G, D -> C, H -> G} Find FC, a canonical cover of F. Please show all the steps to get your answer. 2. (30 pts) A Hollywood movie studio uses a relation called Movie to keep track of information about movie stars, what fee a star charges for...