This document provides a comprehensive guide to database management for business. It includes an entity relationship diagram, normalization techniques, relational schema, MySQL database, and more. The content covers various topics such as stores, departments, employees, pay slips, products, and patrons in a business setting.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Database Management for Business May 30 2019 Student ID: Student Name:ISY1002/ISY103
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Group Members ID: Group Members Name: Contents Report..........................................................................................................................................................3 Part A: Entity Relationship Diagram...........................................................................................................3 Case Study Requirements........................................................................................................................3 ER Diagram.............................................................................................................................................4 Part B: Normalization..................................................................................................................................5 Part C: Relational Schema and MySQL database........................................................................................6 Relational Schema...................................................................................................................................6 MySQL Database..................................................................................................................................11 Database Tables.................................................................................................................................12 Records in MySQL Database................................................................................................................17 Part D: Relational Schema and MySQL database......................................................................................25 References.................................................................................................................................................31 2ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: Report Part A: Entity Relationship Diagram Case Study Requirements 1.The complete detail of all stores in AMC will be stored into the database e.g. name, address, phone etc. 2.The complete detail of all departments in AMC will be stored into the database. 3.The complete detail of all employees will be stored into the database e.g. name, address, phone etc. 4.A store may have any number of employees. 5.Each store will have the manager. 6.The manager will be one of the employees. 7.Each department will have the supervisor. 8.The supervisor will be one of the employees. 9.The pay slip detail will be stored into the database. 10.The product detail will be stored into the database. 11.The inventory of all products will be stored into the database. 12.The complete detail of all patrons in AMC will be stored into the database e.g. name, address, phone etc. 13.The complete detail of orders by patrons will be stored into the database e.g. order date, ordered product, quantity etc. 14.An employee will be employed in one store only. 3ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: ER Diagram (Cinergix Pty Ltd. 2011) 4ISY1002/ISY103 Database Management for Business
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Group Members ID: Group Members Name: Part B: Normalization 5ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: All relations are in third normal form because all are following the rules of third normal form- -All the tables do not have any repeated group. -No table has partial dependency i.e. all fields depend upon the primary key only. -No table has transitive dependency i.e. no field depend upon any other field except primary key. (Rouse M. n.d.) (Dimitri Fontaine 2019) (Perucci D. n.d.) Part C: Relational Schema and MySQL database Relational Schema Employee Table Field NameData TypeLengthKey Constraints employeeNumberintegerPrimary Key firstNameVarchar20 lastNameVarchar20 addressVarchar50 mobileVarchar20 EmailVarchar50 TFNVarchar20 joiningDateDatetime Fulltime Table Field NameData TypeLengthKey Constraints employeeNumberintegerPrimary Key Foreign Key references Employee (employeeNumber) annualSalarydouble Casual Table Field NameData TypeLengthKey Constraints 6ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: employeeNumberintegerPrimary Key Foreign Key references Employee (employeeNumber) hourlyRatedouble Store Table Field NameData TypeLengthKey Constraints storeIDintegerPrimary Key storeNameVarchar40 PhoneVarchar20 EmailVarchar50 FaxVarchar20 streetAddressVarchar50 suburbVarchar20 stateVarchar20 postcodeVarchar6 managerIDintegerForeign Key references Employee (employeeNumber) Department Table Field NameData TypeLengthKey Constraints departmentNumberIntegerPrimary Key TitleVarchar20 PhoneVarchar20 EmailVarchar50 supervisorEmpIDIntegerForeign Key references Employee (employeeNumber) DepartmentStore Table Field NameData TypeLengthKey Constraints departmentNumberintegerPrimary Key Foreign Key references Department (departmentNumber) 7ISY1002/ISY103 Database Management for Business
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Group Members ID: Group Members Name: join product prod on prod.productNumber=ord.productNumber where orderNumber=1005 ; +-------------+---------------+-----------+----------+-------+-------------+ | orderNumber | productNumber | title| quantity | price | TotalAmount | +-------------+---------------+-----------+----------+-------+-------------+ |1005 | P4| Face Wash |4 |3 |12 | +-------------+---------------+-----------+----------+-------+-------------+ Question 4 select storeName, concat(streetAddress,' ',suburb, ' ', state, ' ' ,postc ode) 'Address', fax from storewhere streetAddress like '%George%'; +-----------+-----------------------------------+------------+ | storeName | Address| fax| +-----------+-----------------------------------+------------+ | George| 101 George Rd. Bankstown NSW 7865 | 5678912897 | | Joseph| 101 George Rd. Bankstown SA 6754| 4580812389 | +-----------+-----------------------------------+------------+ Question 5 select * from productOrder where orderNumber in (select orderNumber from productOrder group by orderNumber having count(productNumber)>1); +-------------+---------------+---------------------+---------- +---------------- + | orderNumber | productNumber | orderDate| quantity | customerNumber | +-------------+---------------+---------------------+---------- +---------------- + 26ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: |1004 | P3| 2017-11-11 00:00:00 |3 | 1003 | |1004 | P4| 2017-11-11 00:00:00 |3 | 1003 | +-------------+---------------+---------------------+---------- +---------------- Question 6 select customerNumber, concat(firstName,' ',lastName) 'Customer Full Name ', address from Patron where customerNumber not in (select customerNumber from productOrder); +----------------+--------------------+---------------+ | customerNumber | Customer Full Name | address| +----------------+--------------------+---------------+ |1004 | Marcus Brown| 15 Smith Rd| |1005 | Felix Smith| 101 George Rd | +----------------+--------------------+---------------+ Question 7 select Employee.employeeNumber, firstName, lastName, storeName,title as DepartmentName from Employee inner join storeEmployee on Employee.employeeNumbe r=storeEmployee.employeeNumberinner join Store on storeEmployee.storeID=Store.S toreID inner join Department on storeEmployee.departmentNumber=Department.depart mentNumber; +----------------+-----------+----------+-----------+----------------+ | employeeNumber | firstName |lastName | storeName | DepartmentName | +----------------+-----------+----------+-----------+----------------+ |1001 | John|Smith| George| accounts| 27ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: |1002 | Nick|Jonas| Joseph| HR| |1003 | Max|White| City| finance| |1004 | Noah|Brown| Max| sales| |1005 | Rose|Kelvin| Max| sales| +----------------+-----------+----------+-----------+----------------+ Question 8 select storeName, count(StoreEmployee.employeeNumber) 'Number of Employee s' from Store inner join StoreEmployee on Store.storeID=StoreEmployee.storeID in ner join department on StoreEmployee.departmentNumber=Department.departmentNumbe r group by storeName, title having title='accounts'; +-----------+---------------------+ | storeName | Number of Employees | +-----------+---------------------+ | George|1 | +-----------+---------------------+ Question 9 select * from productOrder where orderDate>'2017-06-30' and orderDate< '2 018-07-01'; +-------------+---------------+---------------------+---------- +---------------- + | orderNumber | productNumber | orderDate| quantity | customerNumber | +-------------+---------------+---------------------+---------- +---------------- + 28ISY1002/ISY103 Database Management for Business
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Group Members ID: Group Members Name: |1001 | P1| 2017-07-01 00:00:00 |1 | 1001 | |1002 | P5| 2017-08-11 00:00:00 |2 | 1002 | |1003 | P2| 2018-06-01 00:00:00 |1 | 1001 | |1004 | P3| 2017-11-11 00:00:00 |3 | 1003 | |1004 | P4| 2017-11-11 00:00:00 |3 | 1003 | |1005 | P4| 2017-09-05 00:00:00 |4 | 1003 | +-------------+---------------+---------------------+---------- +---------------- + Question 10 select customerNumber, count(orderNumber) 'Number of Orders' from product Order group by customerNumber; +----------------+------------------+ | customerNumber | Number of Orders | +----------------+------------------+ |1001 |2 | |1002 |1 | |1003 |3 | +----------------+------------------+ 29ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: Question 11 select orderNumber, orderDate,count(productNumber) as 'Number of Product s' from productOrder group by orderNumber, orderDate; +-------------+---------------------+--------------------+ | orderNumber | orderDate| Number of Products | +-------------+---------------------+--------------------+ |1001 | 2017-07-01 00:00:00 |1 | |1002 | 2017-08-11 00:00:00 |1 | |1003 | 2018-06-01 00:00:00 |1 | |1004 | 2017-11-11 00:00:00 |2 | |1005 | 2017-09-05 00:00:00 |1 | +-------------+---------------------+--------------------+ 30ISY1002/ISY103 Database Management for Business
Group Members ID: Group Members Name: References Rouse M. (n.d.). Database Normalization.Online. Available: https://searchsqlserver.techtarget.com/definition/normalization. [Accessed: 30-May-2019] Dimitri Fontaine (2019). Database Normalization and Primary Keys.Online. Available: https://tapoueh.org/blog/2018/03/database-normalization-and-primary-keys/. [Accessed: 30- May-2019] Holowczak.com (n.d.). Database Normalization. [Online]. Available: http://holowczak.com/database-normalization/. [Accessed: 30-May-2019] Perucci D. (n.d.). Pros and Cons of Database Normalization.Online. Available: https://dzone.com/articles/pros-and-cons-of-database-normalization. [Accessed: 30-May-2019] Cinergix Pty Ltd. (2011). Ultimate Guide to ER Diagrams,[Online]. Available:http://creately.com/blog/diagrams/er-diagrams-tutorial/. [Accessed: 30-May-2019] Refsnes Data. (2019). SQLData Types for MySQL, SQL Server, and MS Access.[Online]. Available:https://www.w3schools.com/sql/sql_datatypes.asp. [Accessed: 30-May-2019] 31ISY1002/ISY103 Database Management for Business