Assignment Document

Order: order id, order date, customer id , customer name,

Pages:

Preview:


  • "Order: order id, order date, customer id , customer name, customer address,customer_telephone_number, item num, item name, item size, item quantity, discount code, discountconditions, discount percentage, discount amount, payment card, bank name , b..

Preview Container:


  • "Order: order id, order date, customer id , customer name, customer address,customer_telephone_number, item num, item name, item size, item quantity, discount code, discountconditions, discount percentage, discount amount, payment card, bank name , bank address, bankaccount num, employee id, employee name.Customer: customer name , customer address, item no , item name, item ordered quantity, payment,telephone.Menu: item no , item name, size, ingredientsnum, ingredient name, ingredients quantityIngredients: ingredient num, name, quantity, stockpresent, stock used, stock need, stock date , supplierno , supplier name, supplier address.Using normalization, we can create the table which strictly the constraints specified by the differentstages of normal form First Normal Form (1NF)As per First Normal Form, no two Rows of data must contain repeating group of information i.e each setof column must have a unique value, such that multiple columns cannot be used to fetch the same row.Each table should be organized into rows, and each row should have a primary key that distinguishes itas unique.In order table, we remove all the related attributes like customer details, discount details, itemdetails and make the order table a very simple and precise table Similarly all the tables, where same values are repeated and removed, then those domain values ofattributes are place into one entitySecond Normal FormBefore we learn about the second normal form, we need to understand the following -? Prime attribute - An attribute, which is a part of the prime-key, is known as a prime attribute.? Non-prime attribute - An attribute, which is not a part of the prime-key, is said to be a non- prime attribute.If we follow second normal form, then every non-prime attribute should be fully functionallydependent on prime key attribute. That is, if X ? A holds, then there should not be any proper subset Yof X, for which Y ? A also holds true.For every table, there should be one column which should be not empty and not repetitive. It shouldalso represent the whole table with its reference.For the order date, orderid is a column which is not empty and not repetitive; hence it is representedas a primary key.1. Take each non-key domain in turn and check it is more dependent on another non-key domainthan the primary key.2. If yesa. Move the dependent domain, together with a copy of the non-key attribute upon whichit is dependent, to a new relation.b. Make the non-key domain, upon which it is dependent, the key in the new relation.c. Underline the key in this new relation as the primary key. d. Leave the non-key domain, upon which it was dependent, in the original relation andmark it a foreign key (*).3. Move down the relation to each of the domains repeating steps 1 and 2 till you have coveredthe whole relation.4. Once completed with all transitive dependencies removed, the table is in 3rd normal form.In our example above, we have orderidas our primary key, we also have a custidthat is dependent onitemid and ingrdid, dependent on supplierid. Though itemid could be dependent on orderid it moredependent on ingrdid , therefore it is transitively dependent on ingrdid.So following the steps, remove ingrdid with a copy of suppierid to another relation and make ingrdid theprimary key of the new relation. In the original table mark supplierid as our foreign key. Boyce Codd Normal Form (BCNF)rd Even when a database is in 3 Normal Form, still there would be anomalies resulted if it has more thanone Candidate KeyThe following will be tables for Gourmet Pizza after following the above rules of normalization1. Order: orderid, orderdate, type, custid, itemid, discountid, discountamt, bankcardid, itemquantity, total amount, eid.2. Customer: customerid, custname, custaddress, custphone.3. Menu: itemid, itemname, size, sellingprice, ingredid.4. Ingredients: ingrdid, ingrdname, type, supplierid, quantityused, date. "

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top