1 | P a g e Unit ISY1002/ISY103 Database Management for Business Assessment Type Group Assignment – Database Project, Report and Presentation Assessment Number 3 Assessment Weighting 25% Total Marks...

2 answer below »
DBMS


1 | P a g e Unit ISY1002/ISY103 Database Management for Business Assessment Type Group Assignment – Database Project, Report and Presentation Assessment Number 3 Assessment Weighting 25% Total Marks 100 Alignment with Unit and Course Unit Learning Outcome ULO2: Show an understanding of the fundamentals of database design, implementation, management, and maintenance, including consideration of appropriate data security ULO3: Implement a relational database using the Structured Query Language (SQL) Data Definition Language (DDL) ULO4: Demonstrate an ability to query a relational database using Structured Query Language (SQL) and Data Manipulation Language (DML) Graduate Attributes Assessed GA1:Communication GA2: Collaboration GA4: Critical Thinking & Problem Solving GA5: Flexibility Due Date/Time End of Week 11 – refer Moodle for date and time 2 | P a g e Aim: To give you practical experience in database modelling, normalization and writing SQL statements to query a relational database Assignment Summary: The project specification details provided in this document and you must use only given specifications to come up with your solution. Make appropriate assumptions where ever required. Please make sure that your group must meet your lecturer/tutor at least twice to update the progress of your assignment. Background Information for Sample Database Project: Australian Manufacturing Company (AMC) requires a database system to manage their stores, employees, products, suppliers, patrons and orders. The following information has been gathered about current business activities of AMC.  AMC has many stores in different cities across Australia. Each store has unique store number and other details like name, contact details (phone number, email address and fax number) and location details (postal address composed of street number, suburb, state and postcode).  There are many departments within each store, for example, HR, accounts, finance and sales etc. each department is uniquely identified by department number. AMC also records department title, phone number and email address.  Each store has a number of employees. Each department is supervised by a department supervisor and each store is managed by a store manager who both are employees of AMC. Each department has a single supervisor only i.e. the department supervisor is also the supervisor for all the employees work within that department.  Each employee is referenced by unique employee number, name (first and last names), address, mobile number, email, TFN, salary and joining date. An employee’s salary is recorded differently as per his or her employment type. Employees can be employed as fulltime or casual basis. For a fulltime staff, annual salary is recorded and hourly rate for a casual staff.  Each store creates payslips for all employees work in that store on a weekly basis. As a minimum payslip number, no of hours worked, employee detail, store detail and gross pay are recorded.  AMC sales different products like fashion, health, beauty, electronics etc. Each product is characterised by product number, name, brand, description and price.  Each product can be supplied by one or more supplier and each supplier can supply one or many products. AMC also keeps appropriate details of their suppliers.  Each store maintains an inventory of their products available for sale. The quantity of each product available in store and the quantity ordered are kept.  AMC patron visits the store and shops in the store. Each customer is characterised by customer number, name (first and last names), mobile number and address.  A patron may place orders. An order contains one or many products at a time. A store keeps track of order number, order date, product(s) ordered and quantity ordered for each product. 3 | P a g e The proprietors of AMC have appointed your group as Database System Consultant to analyse, design and develop conceptual data model and physical database. They want a software/online application in future to be built on the database you design so that the operation of the AMC is greatly improved. Your created models must accommodate the provided requirements. It is understandable that the provided information may not sufficient to create model that centralise all the data appropriately. You are free to make assumptions about their business activities if require. Make sure you record your assumptions. System Requirements: The system is a prototype system and as such is not a full production version. You will be required to enter a representative sample data into your tables in order to test the design and operation of your database. Project Specification: 1. Part A: Entity Relationship Diagram (20 marks) 1. Your first task is to study the Case study requirements and gather as much knowledge to list all the main Entities and attributes. 2. Create an Entity Relationship Diagram (ERD) to help you decide on the relationships. Your entity relation diagram that models your database design should: i. Include all entities, relationships (including names) and attributes. ii. Identify primary and foreign keys. iii. Include cardinality/ multiplicity and show using crow’s feet or UML notation. iv. Include participation (optional / mandatory) symbols if applicable. The ERD should be created as part of a Microsoft Word document. Hand-drawn diagrams will not be accepted. It is recommended that you complete your ERD using Draw.io, Visio or try www.gliffy.com (Search for ERD gliffy to get started). 2. Part B: Normalisation (10 marks) 1. Normalise all entities and relationships in optimal normal form. Provide the normalised schema and discuss the level of normalisation achieved for each relation. You goal should be normalise all entities in 3NF. Provide the reasons for any relation that is not maintained in 3NF. 3. Part C: Relational schema and MySQL database (35 marks) 1. Create relational schema that matches ERD and normalised schemas you created in Part A and B. The schema should include suitable data validation, integrity and referential integrity constraints, for example, types and length of attributes, primary and foreign keys etc. Make sure you follow standards, naming conventions and notation. (10 Marks) http://www.gliffy.com/ 4 | P a g e 2. Using MySQL, you are required to develop a demonstration prototype system (database) that stores data for AMC stores, employees, products, suppliers, patrons and orders. Create a new database called AMCDB. Create tables according to your relational schema created in step 1. (20 Marks) Follow a standard naming convention for table names and also field names. Avoid using spaces and any special characters in table and field names. Use underscore_case or use camelCase to separate parts of a name. You are required to be consistent in tables’ name, fields’ name, data types, field size and key constraints with relational schema created in step 2. 3. Add at least three records into each table. (5 Marks) 4. Part D: SQL (24 marks) Use the AMCDB database that you created in MySQL to design and execute SQL queries that answer the following questions. Number your answers to each question clearly. The answer to each question must be tabulated as shown in the example below and include the SQL statement and also the output that is produced when you execute the statement in your database. The output includes the records that are listed and also the message that appears when you run the SQL statement. For example: Question 1: SQL: SELECT lName, position FROM Staff WHERE salary > 20000; Output: +-------+----------+ | lName | position | +-------+----------+ | Brand | Manager | | White | Manager | +-------+----------+ 2 rows in set (0.03 sec) Do not use screen captures to display the SQL statement or the output. You should right-click on the MySQL Command Prompt window; choose Mark and then press the [Enter] key to Copy and then Paste into your Word document that includes the answers to all questions. Format and indent the clauses in your SQL statements for better readability and understanding as shown in the example above. Statements must be syntactically and semantically correct. Format both the SQL and also the Output in Courier New 10 or 11 point. 5 | P a g e 1. List the full name of Patrons, phone number and address in the descending order of customer number. The full name is comprised of first and last name joined with single space. Use the alias Customer full name for the composed column heading. (2 marks) 2. List all the products having price less than $100. (2 marks) 3. List the product number, product title, quantity ordered, unit price and total amount per product (unit price * quantity ordered) for order having order number 1005. (3 marks) 4. List name, full address and fax number of stores that has the word ‘George’ anywhere in the street component of address. Your query should consider the case sensitivity of the street as well i.e. the stores with words ‘George’, ‘GEORGE’, ‘george’, ‘GeorGe’ etc. in street should be returned by your query too. (2 marks) 5. List all the orders having at least two different products ordered. (2 marks) 6. List customer number, name and address of all the customers who has not placed any order. (2 minutes) 7. Retrieve first name, last name and employee number of all the employees along with department name and store name where they work. (3 marks) 8. For each store, display store name and number of employees works in account department. (2 marks) 9. List all the orders placed for financial year 2018 i.e. orders placed after 30/06/2017 and before 01/07/2018. (2 marks) 10. Retrieve customer number and the total number of orders placed by each customer. (2 marks) 11. For each order, retrieve the order number, order date and number of products ordered in it
Answered Same DayFeb 03, 2021ISY103

Answer To: 1 | P a g e Unit ISY1002/ISY103 Database Management for Business Assessment Type Group Assignment –...

Deepti answered on Feb 06 2021
154 Votes
50268-Solution/DDL-DML.sql
/* The following code includes the data definition language statements and data manipulation language statements for all the tables in AMCDB Database.*/
DDL Statements for each of the Tables are given below.
Functional Dependencies and Key Constraints have been successfully implemented.*/
CREATE TABLE Customers
(
C_Num         integer Primary Key NOT NULL auto_increment,
C_FName        varchar(30),
C_LName     varchar(30),
C_MobileNum    varchar(15) NOT NULL,
C_Adress    varchar(50)
);
CREATE TABLE Orders
(
O_Num         integer Primary Key NOT NULL auto_increment,
Order_Date    date,
C_Num        integer NOT NULL,
foreign key (C_Num) references Customers(C_Num)
);
CREATE TABLE Stores
(
S_Num        integer Primary Key NOT NULL auto_increment,
S_Name        varchar(30),
S_Phone        varchar(15) NOT NULL,
S_Fax        varchar(15),
S_Email        varchar(30),
S_Street    varchar(30),
S_Suburb    varchar(30),
S_State        varcha
r(30),
S_PostCode    varchar(6)
);
-- The department will have unique phone number and email ID at each store. The same Store can have many departments each of which has three unique attributes.
CREATE TABLE Department
(
D_Num        integer Primary Key NOT NULL auto_increment,
D_Title        varchar(13),
D_Phone        varchar(15) Unique,
D_Email        varchar(30) Unique,
S_Num        integer NOT NULL,
foreign key (S_Num) references Stores(S_Num)
);
CREATE TABLE Store_Department
(D_Num integer NOT NULL,
S_Num integer NOT NULL,
foreign key (S_Num) references Stores(S_Num),
foreign key (D_Num) references Department(D_Num)
);
CREATE TABLE Employee
(
E_Num        integer Primary Key NOT NULL auto_increment,
E_FName        varchar(30),
E_LName        varchar(30),
E_MobileNum    varchar(15),
E_Email        varchar(30),
E_TFN        varchar(30),
Employment_Type        varchar(6),
E_Salary        float,
Hourly_Rate        float,
Joining_Date    date,
Manager_Status    varchar(1),
S_Num            integer NOT NULL,
D_Num            integer NOT NULL,
foreign key (S_Num) references Stores(S_Num),
foreign key (D_Num) references Department(D_Num)
);
CREATE TABLE Products
(
P_Num        integer Primary Key NOT NULL auto_increment,
P_Name        varchar(30),
Brand        varchar(30),
Description    varchar(100),
Price        float
);
CREATE TABLE Product_Order
(
P_Num        integer NOT NULL,
O_Num        integer NOT NULL,
Quantity_Ordered integer NOT NULL,
foreign key (O_Num) references Orders(O_Num),
foreign key (P_Num) references Products(P_Num)
);
CREATE TABLE Product_Store
(
P_Num        integer NOT NULL,
S_Num        integer NOT NULL,
Quantity_Available integer,
Quantity_Ordered integer,
foreign key (P_Num) references Products(P_Num),
foreign key (S_Num) references Stores(S_Num)
);
CREATE TABLE Suppliers
(
Sup_Num        integer Primary Key NOT NULL auto_increment,
S_Detail    varchar(100)
);
CREATE TABLE Product_Supplier
(
Sup_Num        integer NOT NULL,
P_Num        integer NOT NULL,
foreign key (P_Num) references Products(P_Num),
foreign key (Sup_Num) references Suppliers(Sup_Num)
);
/* One supervisor who already exists as an employee can supervise one department.
We assume a store manager can supervise a department in the same store.
So the supervisor can supervise only in the same department of the store where he is employed.
The table Employee caould be further normalized by bifurcating the department number from it. */
CREATE TABLE Supervisor
(
Supervisor_Num integer primary key NOT NULL,
D_Num        integer NOT NULL,
foreign key (D_Num) references Employee(D_Num),
foreign key (Supervisor_Num) references Employee(E_Num)
);
/* DML Statements for each of the Tables are given below.
The data has been entered in acoordance with the queries to retrieve records successfully in each case.*/
-- Table: Customers
INSERT INTO Customers (C_FName,C_LName,C_MobileNum,C_Adress)
VALUES ('Elizabeth','Ross','708123234','1024 Chalet Court Melbourne AU');
INSERT INTO Customers (C_FName,C_LName,C_MobileNum,C_Adress)
VALUES ('Rachel','Shaw','708234345','171 Berkley Avenue Melbourne AU');
INSERT INTO Customers (C_FName,C_LName,C_MobileNum,C_Adress)
VALUES ('Tom','Moore','708345567','1200 Fort Worth Street Bathurst AU');
INSERT INTO Customers (C_FName,C_LName,C_MobileNum,C_Adress)
VALUES ('Russell','Crow','708345568','1340 Rambo Street Sydney AU');
INSERT INTO Customers (C_FName,C_LName,C_MobileNum,C_Adress)
VALUES ('Ashton','Kutcher','708345569','12 Romeo Street Sydney AU');
-- Table: Orders
INSERT INTO Orders (Order_Date,C_Num)
VALUES('2018-4-12',1);
INSERT INTO Orders (Order_Date,C_Num)
VALUES('2018-5-13',2);
INSERT INTO Orders (Order_Date,C_Num)
VALUES('2017-11-28',3);
INSERT INTO Orders (Order_Date,C_Num)
VALUES('2019-1-4',1);
INSERT INTO Orders (Order_Date,C_Num)
VALUES('2017-10-10',2);
INSERT INTO Orders (O_Num,Order_Date,C_Num)
VALUES(1005,'2017-10-10',1);
-- Table: Stores
INSERT INTO Stores(S_Name,S_Phone,S_Fax,S_Email,S_Street,S_Suburb,S_State,S_PostCode)
VALUES('StoreA','7063454563','7063454564','storeA@AMC,com','4 legacy drive','Arlington','Melbourne','12345');
INSERT INTO Stores(S_Name,S_Phone,S_Fax,S_Email,S_Street,S_Suburb,S_State,S_PostCode)
VALUES('StoreB','8172343452','8172343453','storeB@AMC,com','7 Fort Worth','Fort Worth','Sydney','23456');
INSERT INTO Stores(S_Name,S_Phone,S_Fax,S_Email,S_Street,S_Suburb,S_State,S_PostCode)
VALUES('StoreC','8171171171','8171171172','storeC@AMC,com','7th Avenue','Newark','Adelaide','34567');
INSERT INTO Stores(S_Name,S_Phone,S_Fax,S_Email,S_Street,S_Suburb,S_State,S_PostCode)
VALUES('StoreD','8172271171','8172271172','storeD@AMC,com','7th George Avenue','Newark','Adelaide','34567');
INSERT INTO Stores(S_Name,S_Phone,S_Fax,S_Email,S_Street,S_Suburb,S_State,S_PostCode)
VALUES('StoreE','8173371171','8173371172','storeE@AMC,com','7th george Avenue','Newark','Adelaide','34567');
-- Table: Department
INSERT INTO Department(D_Title,D_Phone,D_Email, S_Num)
VALUES('HR','7063454564','[email protected]',1);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Sales','7063454565','[email protected]',1);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Finance','7063454566','[email protected]',1);
INSERT INTO Department(D_Title,D_Phone,D_Email, S_Num)
VALUES('HR','8172343453','[email protected]',2);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Sales','8172343454','[email protected]',2);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Finance','8172343455','[email protected]',2);
INSERT INTO Department(D_Title,D_Phone,D_Email, S_Num)
VALUES('HR','8171171172','[email protected]',3);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Sales','8171171173','[email protected]',3);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Finance','8171171174','[email protected]',3);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Account','8172343456','[email protected]',2);
INSERT INTO Department(D_Title,D_Phone,D_Email,S_Num)
VALUES('Account','7063454567','[email protected]',1);
-- Table: Store_Department
INSERT INTO Store_Department(D_Num,S_Num)
VALUES(5,1);
INSERT INTO Store_Department(D_Num,S_Num)
VALUES(6,1);
INSERT INTO Store_Department(D_Num,S_Num)
VALUES(7,2);
-- Table: Employee
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('aaa','zzz','9876543211','[email protected]','AB23','Full',70000,null,'2017-8-12','Y',1,3);
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('bbb','yyy','9876543212','[email protected]','BC34','Casual',null,25,'2017-10-15','N',3,3);
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('ccc','ppp','9876543213','[email protected]','CD45','Full',75000,null,'2018-3-3','Y',3,4);
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('fff','mmm','9876543214','[email protected]','CD47','Full',65000,null,'2018-8-3','Y',2,10);
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('eee','ttt','9876543215','[email protected]','CD48','Full',65000,null,'2018-9-3','Y',3,11);
INSERT INTO Employee(E_FName,E_LName,E_MobileNum,E_Email,E_TFN,Employment_Type,E_Salary,Hourly_Rate,Joining_Date,Manager_Status,S_Num,D_Num)
VALUES('ddd','www','9876543216','[email protected]','CD49','Full',65000,null,'2018-11-3','Y',3,11);
-- Table: Products
INSERT INTO Products(P_Name,Brand,Description,Price)
VALUES('Shoe','Gimmy Choo','Size 7',234.99);
INSERT INTO Products(P_Name,Brand,Description,Price)
VALUES('Bag','Da Milano','Black Clutch',20.99);
INSERT INTO Products(P_Name,Brand,Description,Price)
VALUES('Tie','Luis Philip','Bow tie Tux',24.99);
-- Table: Product_Order
INSERT INTO Product_Order(P_Num,O_Num,Quantity_Ordered)
VALUES(1,2,2);
INSERT INTO Product_Order(P_Num,O_Num,Quantity_Ordered)
VALUES(2,2,1);
INSERT INTO Product_Order(P_Num,O_Num,Quantity_Ordered )
VALUES(3,4,1);
INSERT INTO...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here