a: Give an example of a deletion anomaly and one example for the insertion anomaly
.....
b: Give the all partial dependencies and transitive dependencies
>>>
c: Normalize this relation into 2NF. Please draw the table(s) with data, and use underline to indicate the primary key and squiggly line to indicate foreign keys if a table has for each table
<<<<<
d: Normalize the 2NF into 3NF. Please draw the table(s) with data, and use underline to indicate the primary key and squiggly line to indicate foreign keys if a table has for each table
a:
deletion anomaly
If a product is no more available and is deleted from the database, the corresponding invoice and customer details will also get deleted. Example : If product P50 is deleted from the table, invoice 1059 will also get deleted.
insertion anomaly
If a new customer is added to the database , but he has not purchased any product, we still have to insert invoiceNo and productId as these are primary key components. If we left them blank identity constraint is violated.
b: Full Dependency
InvoiceNo, ProductId -> Quantity
partial dependencies
InvoiceNo -> CustomerNo
ProductId -> ProductPrice
transitive dependencies
CustomerNo -> CustomerName
c: 2NF(all non key attributes should be functionally dependent on primary key)
Invoice
InvoiceNo | ProductId | Quantity |
1057 | P10 | 2 |
1057 | P20 | 3 |
1057 | P30 | 1 |
1058 | P10 | 5 |
1058 | P40 | 1 |
1059 | P50 | 3 |
InvoiceCustomer
InvoiceNo | CustomerNo |
1057 | 30213 |
1058 | 28914 |
1059 | 30213 |
Product
ProductId | ProductPrice |
P10 | $29.99 |
P20 | $15.00 |
P30 | $23.00 |
P40 | $29.99 |
P50 | $29.99 |
d: 3NF(remove transitive dependencies)
Invoice
InvoiceNo | ProductId | Quantity |
1057 | P10 | 2 |
1057 | P20 | 3 |
1057 | P30 | 1 |
1058 | P10 | 5 |
1058 | P40 | 1 |
1059 | P50 | 3 |
InvoiceCustomer
InvoiceNo | CustomerNo |
1057 | 30213 |
1058 | 28914 |
1059 | 30213 |
Product
ProductId | ProductPrice |
P10 | $29.99 |
P20 | $15.00 |
P30 | $23.00 |
P40 | $29.99 |
P50 | $29.99 |
Customer
CustomerNo | CustomerName |
30213 | Rose |
30214 | Tom |
underlined are primary keys and italicised are foreign keys.
Do ask if any doubt. Please upvote.
a: Give an example of a deletion anomaly and one example for the insertion anomaly ..... b: Give the all partial depe...
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...
The following is the relation notation of the Veterinary Office List. VETERINARY_OFFICE (PetID, PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName, ServiceDescription, ServiceDate, ServiceCharge) The functional dependencies are given below: PetID -> PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName OwnerID -> OwnerLastName, OwnerFirstName ServiceDescription -> ServiceCharge PetID, ServiceDate -> ServicedDescription, ServiceCharge Assumption: A pet belongs to only one owner, while an owner may have more than one pet. A pet receives at most one treatment on any given date. Use the functional dependencies...
Normalize the un-normalized table given below through INF, 2NF and 3NF. Show the normalization process in a file (e.g., creating tables and drawing lines in MS Word or MS Excel), save as a .pdf file, and submit it through the link available on Canvas. Name your file according to this scheme: yourlastname a3_normalize.pdf. Do not protect your .pdf file. The presentation of your normalization process should mimic the normalization class exercise and the example provided on Canvas In order to...
2. The following is the relation notation of a table for a veterinary office. [70 pts. total] VETERINARY_OFFICE (PetID, PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName, ServiceDescription, ServiceDate, ServiceCharge) The functional dependencies are given below: PetID -> PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName OwnerID -> OwnerLastName, OwnerFirstName ServiceDescription -> ServiceCharge PetID, ServiceDate > ServiceDescription, ServiceCharge Assumptions: 1)A pet belongs to only one owner, 2) an owner may have more than one pet, 3A pet receives at most one treatment on any...
for question (c) do like this 3. A table to record the information of Dentists, Patients, and Appointments in a clinic is given below. DentistNo DentistName PatientNo PatientName PatientPhone AppointmentDate Appointment Time AppointmentFee On a single day each patient can have more than one appointment. It is known that DentistNo is unique for each dentist. PatientNo is unique for each patient. PatientNo must not be used as a composite key. A patient is allowed to see any dentist. (a) Use...
PROBLEM STATEMENT: Suppose you have a client that has given you the following business rules to form the basis for a database design. The database must enable the manager of a company dinner club to mail invitations to the club’s members, to plan the meals, to keep track of who attends the dinners, and so on. Each dinner serves many members, and each member may attend many dinners. A member receives many invitations, and each invitation is mailed to many...