Question

In: Computer Science

Normalisation (13 marks) The table below has basic information about Sales staff and their sales for...

Normalisation

The table below has basic information about Sales staff and their sales for a small appliance sales chain. It shows the employee, the items they sell as well as which store they work in.

SALES(Cost, Emp_Name, Emp_ID , Make, Grade , Price, Serial_No, Commission, Store _Address, Date, Store _Phone, Model)

The following functional dependencies apply and there are no redundancies present:

Store_Address -> Store_Phone
Grade -> Commission
Emp_ID -> Store _Address
Serial_No -> Model, Make
Emp_ID , Serial_No -> Date, Retail_Price Serial_No ->Wholesale_Price

Emp_ID -> Grade Emp_ID -> Emp_Name

3.1​ ​Find the Primary Key of the SALES relation.
3.2​ Decompose the SALES relation into 3NF. Show the final schema in full with all primary keys and

foreign keys mark appropriately.3.3​ The following FD also holds true:

Store_Phone-> Store_Address

Which relation in your decomposition would it map to? Test that relation to show that it is still in 3NF. Show your working.

Solutions

Expert Solution

SALES(Cost, Emp_Name, Emp_ID , Make, Grade , Price, Serial_No, Commission, Store_Address, Date, Store _Phone, Model)

Given FDs:

Store_Address -> Store_Phone

Grade -> Commission

Emp_ID -> Store _Address

Serial_No -> Model, Make

Emp_ID , Serial_No -> Date, Price

Serial_No ->Cost

Emp_ID -> Grade

Emp_ID -> Emp_Name

The primary key of SALES is combination of Emp_ID and Serial_No : (Emp_ID, Serial_No)

FDs :

Emp_ID -> Emp_Name, Store_Address, Grade

Serial_No -> Model, Make, Cost

(Emp_ID, Serial_No) -> Date, Price

Store_Address -> Store_Phone

Grade -> Commission

First Normal Form (1NF) - 1NF disallows multivalued attributes, composite attributes and their combinations. The domain of attributes must include only atomic values hence it disallows sets of values, a tuple of values or a combination of both as an attribute for a single tuple.

The Schema is in 1NF. Since combination of Emp_ID and Serial_No is primary key of the table which means these contain atomic values and Emp_ID -> Emp_Name, Store_Address, Grade which means Emp_Name, Store_Address , Grade also contain only atomic values and Serial_No -> Model, Make, Cost which means Model, Make and Cost contain only atomic values. Similarly, (Emp_ID, Serial_No) -> Date, Price => Date and Price has atomic values

Store_Address -> Store_Phone , Since Store_Address has atomic values => Store_Phone will also have only atomic values

Grade -> Commission => Commission also has atomic values.

After 1 NF:

SALES(Cost, Emp_Name, Emp_ID , Make, Grade , Price, Serial_No, Commission, Store_Address, Date, Store _Phone, Model)

where (Emp_ID, Serial_No) is the primary key of Sales table with FDs:

Emp_ID -> Emp_Name, Store_Address, Grade

Serial_No -> Model, Make, Cost

(Emp_ID, Serial_No) -> Date, Price

Store_Address -> Store_Phone

Grade -> Commission

Second Normal Form (2NF) - A Relational Schema, R, is in 2NF if every non-prime attribute , A in R is fully functionally dependent on the primary key of R.

  • A prime attribute is a part of key whereas a non-prime attribute doesn't form part of any key of R.
  • A functional dependency X -> Y is a fully functional dependency if removal of any attribute A from X means that the dependency doesn't hold anymore.
  • A functional dependency X->Y is a partial dependency if some attribute A E X can be removed and the depenedency still holds.

For the given Schema:

Emp_Name, Store_Address and Grade are partially dependent on the primary key of Sales (dependent on Emp_ID)

Similarly, Model, Make, Cost are partially dependent on the primary key of Sales (dependent on Serial_No)

To remove the partial dependency from Sales, we remove Emp_ID, Emp_Name, Store_Address, Grade, Store_Phone and Commission from Sales and create another table called Emp and make Emp_ID the primary key of Emp table which in Sales table is a foreign key of Emp table.

Similarly, we remove Serial_No, Model, Make, Cost from Sales table and create another table called Item where Serial_No is the primary key of Item table and foreign key of Item table in Sales table.

After 2NF:

Emp (Emp_ID, Emp_Name, Store_Address, Grade, Store_Phone, Commission)

where Emp_ID is the primary key of Emp with FDs:

Emp_ID -> Emp_Name, Store_Address, Grade

Store_Address -> Store_Phone

Grade -> Commission

Item (Serial_No, Model, Make, Cost)

where Serial_No is the primary key of Item

Serial_No -> Model, Make, Cost

SALES( Emp_ID , Price, Serial_No, Date)

where Emp_ID is the foreign key of Emp table and Serial_No is the foreign key of Item table

and (Emp_ID, Serial_No) is the primary key of Sales table with FDs:

(Emp_ID, Serial_No) -> Date, Price

Third Normal form (3NF) - A Relational Schema, R, is in 3NF if it is in 2NF and no non-prime attribute of R is transitively dependent on the primary key. A Relational Schema, R, is in 3NF if whenever a functional dependency X->A holds in R either:

  • X is the super key of R
  • A is the prime attribute of R

A functional dependency , X->Y in a relational schema, R, is a transitive dependency if there is a set of attributes Z that is not part of any key of R and both X->Z and Z->Y holds.

For the given schema:

In Emp table , Store_Phone and Commission are transitively dependent on Emp_Id

In order to remove this transitive dependency , we remove and create another table called Store with attributes Store_Address and Store_Phone where Store_Address is the primary key of Store and forms foreign key in Emp table

Similarly, we remove and create another table called Comm with fields Grade and Commission where Grade is the primary key of Comm table and forms foreign key in Emp table

After 3NF:

Store(Store_Address, Store_Phone)

where Store_Address is the primary key with FD:

Store_Address -> Store_Phone

Comm(Grade, Commission)

where Grade is the primary key of Comm with FD:

Grade -> Commission

Emp (Emp_ID, Emp_Name, Store_Address, Grade, Commission)

where Store_Address is the foreign key of Store and Grade is the foreign key of Comm

and Emp_ID is the primary key of Emp with FDs:

Emp_ID -> Emp_Name, Store_Address, Grade

Item (Serial_No, Model, Make, Cost)

where Serial_No is the primary key of Item

Serial_No -> Model, Make, Cost

SALES( Emp_ID , Price, Serial_No, Date)

where Emp_ID is the foreign key of Emp table and Serial_No is the foreign key of Item table

and (Emp_ID, Serial_No) is the primary key of Sales table with FDs:

(Emp_ID, Serial_No) -> Date, Price


Related Solutions

Question 5 (25 marks) – ALL CALCULATIONS MUST BE SHOWN The table below contains information about...
Question 5 – ALL CALCULATIONS MUST BE SHOWN The table below contains information about weekly production and costs of a firm. Number of Workers Output (units) Marginal Product of Labour Fixed Cost (capital) Variable Cost (labour) Total Cost Marginal Costs Average Fixed Costs Average Variable Costs Average Total Costs 0 -- -- -- -- -- 1 330 $600 $300 2 375 $600 $1,200 3 1020 $600 $1,500 4 1260 $600 $1,200 5 150 $600 $2,100 6 1470 $600 $1,800 a....
. Below is information about actual sales of a product for June and July and the...
. Below is information about actual sales of a product for June and July and the expected sales of August, September and October. Selling price for the product is $100. June $230,000, July $240,000, August $220,000, September $280,000 and October $310,000. November $340,000 Costs of Goods Sold equals to 70% of Sales. The end of inventory policy is 40% of the next month of quantity sales.   Inventory is purchased on continuous basis during the month. 60% of inventory costs are...
1.) Given the information below about Farmer Sally’s wheat crop, fill in the table below and...
1.) Given the information below about Farmer Sally’s wheat crop, fill in the table below and calculate her economic profit or loss when the market price is $3 per bushel. Hint: Recall that         MR = P under perfectly competitive conditions. Bushels of wheat MR TR TC MC VC ATC AVC Economic Profit or Loss 0 15.00 -- 0 -- -- 1 4.75 2 3.75 3 3.00 4 2.50 5 2.00 6 1.50 7 1.25 8 1.50 9 2.00 10 2.75...
The table below contains information about the production, costs and profits of a firm. The price...
The table below contains information about the production, costs and profits of a firm. The price faced by the firm is $40 per unit. There are 50 empty cells in the table. (a) Fill in all the empty cells. Output Total Fixed Costs Total Variable Costs Marginal Costs Average Variable Costs Average Fixed Costs Average Total Costs Price per unit Profits 0 12 1 12 50 50.0 50.0 -22.0 2 12 75 25.0 37.5 43.5 3 10.0 28.3 4 20.0...
In the Table below is information about two options that face the Alpha & Omega Company...
In the Table below is information about two options that face the Alpha & Omega Company as it seeks to expand its operations. Note that  all cash flows are at the end of the year except for the initial costs. Option 1 Option 2 Initial cost $680,000 $720,000 Usage life 5 years 6 years Salvage value at end of useful life $20,000 $30,000 Cash flows (excluding salvage value): Year 1 $140,000 $ 80,000 Year 2 $140,000 $180,000 Year 3 $140,000 $280,000...
1. The table below provides information about the cost of inputs and value of output for...
1. The table below provides information about the cost of inputs and value of output for the production of a road bike. Note there are four different stages of production. Raw materials Manufacturing Construction Sale by the retailer Rubber for one tire ($20) Tire maker sells tires for $30 each Bike mechanic puts everything together and sells the bike for $345 Retailer sells the bike for $500 Aluminum for the frame ($80) Other component materials ($70) Frame maker sells bike...
Manufacturing is thinking about expanding its facilities and its finance staff has obtained the following information:...
Manufacturing is thinking about expanding its facilities and its finance staff has obtained the following information: The expansion will require the company to purchase today (t = 0) $5million of equipment.  The equipment will be depreciated over the following four years at the following rates: .33, .45, .15 and .07 in years 1,2,3,4, respectively. The expansion will require the company to increase its net operating working capital by $500,000 today (t=0).  This net operating working capital will be recovered at the end...
The table below provides information about price and output produced in country X for the years...
The table below provides information about price and output produced in country X for the years 2010 and 2015. The base year is 2010.                                                             p2010              y2010              p2015             y2015 Clothing                                              20                    100                  20                    150 Food                                                   10                    50                    12                    60 Government pension payments        75                    500                  100                  750 Military equipment                            250                  750                  250                  800 Using the GDP deflator, determine whether inflation or deflation occurred during the period. Enter the value of the GDP deflator and...
The table below provides some information about the possible outcomes of a particular study. From the...
The table below provides some information about the possible outcomes of a particular study. From the information provided determine the effect size and power of each scenario. Sketch the distributions involved and show the areas representing alpha, beta, and power for each scenario. You can assume that all the populations are normally distributed. Hint 1: For scenario 1, the power is 80.23%. For scenario 2 the power is 99.63. So be sure to show your work for the rest of...
the table below provides information for a probability distribution. use the table below to answer the...
the table below provides information for a probability distribution. use the table below to answer the following questions. X p(X) 0 .10 1 .60 2 .30 a. calculate the variance. b. calculate the standard deviation
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT