7102ICT- Case Study 2814ICT & 7003ICT - Assignment Part 2 Page 1 2814ICT – DATA MANAGEMENT 7003ICT – DATABASE MANAGEMENT School of Information & Communication Technology Trimester 1, 2021 Assignment...

1 answer below »
It is a database management course which I need to apply some SQL statement like update, insert, delete... into local host phpMyAdmin. Please let me know if you can do it. I will send you some sample from previous year if you are unsure about this assignment.




7102ICT- Case Study 2814ICT & 7003ICT - Assignment Part 2 Page 1 2814ICT – DATA MANAGEMENT 7003ICT – DATABASE MANAGEMENT School of Information & Communication Technology Trimester 1, 2021 Assignment Part 2: Designing a Database for BigM Aims  To analyse and comprehend a given ER diagram and Relational Database schema  To implement a database based on the given ER diagram and Database schema  To write required SQL statements to query the database  To write SQL statements to manipulate the data in the database Learning Objectives In the process of this assessment task you will:  plan, schedule & execute project tasks to improve your personal/group productivity;  gain awareness of the typical challenges related to the practical implementation of databases;  learn how to use Data Definition statements to implement a database from a given ER diagram and the corresponding Database schema  learn how to use Data Manipulation statements to query a database, and insert and update data in the tables Due date: Week 11, 28 May Friday, 5:00 PM Submit the individual work file, named 'a2-.zip', by the above due date. Any student’s ID in the group is fine. Each group member will have a short presentation or viva. Late submission: Any submission after the due date will receive a deduction of 5% per day. Standard university policy will apply for all late submissions. See the course website/profile for detail. Marks: (a) Group submission: a total 100 marks and it is worth 7% out of the total assessment, plus (b) individual viva/presentation: 3% out of the total assessment. Extensions: An extension will only be considered with supporting documentation from a health professional and if the problem/illness occurred within the week prior to the due date. If an extension is granted the extension will then equal the number of days specified on the doctor's certificate, with a maximum limit of five (5) working days. Authorship: This assignment is a Group assignment and it shall be completed by the students in each group only. The final submission must be identifiably the work of the individual group members. Breaches of this requirement will result in an assignment not being accepted for assessment and may result in the offending student or students being required to present before the Disciplinary Committee. 2814ICT & 7003ICT - Assignment Part 2 Page 2 of 4 Implement a Database for BigM Assignment Specification BigM now requires a partial implementation of the design made in Assignment Part 1. To keep consistency between the assignments, database specification containing the ER diagram and the corresponding schema are provided with this document. You should create your database according to this documentation. Make sure that your implementation is consistent with this design, i.e., your table names, field names, and data types are according to the specifications provided in this document. The implementation phase includes writing SQL statements to create a database and its tables, populating the tables with appropriate test data, and writing a number of queries to create reports that can be used by the management team. You need to insert at least five records in each of the tables and ensure that each of the query returns at least one record. Implementation of the Database and Manipulation of the Data You are required to perform the followings tasks: 1. Task 1: Create a text file named Create_.sql or Create_.txt (for example, Create_s3087654.sql or Create_s3087654.txt) that will contain SQL statements to: I. Create a database named BigM_. II. Create all of the tables for the database according to the Database schema given with this document (separately attached). 2. Task 2: Create a text file named Insert_.sql or Insert_.txt that will contain SQL statements to: I. Insert at least five records in each of the tables. The test data inserted into the table must ensure that each of the queries, specified in Task 3, outputs at least one record. 3. Task 3: Create a text file named Query_.sql or Query_.txt that will contain all the queries to display the following I. List of names of all employees sorted by their hourly salary. II. The date on which the most recent customer order has been made. The customer name and date of the order will be sufficient. III. List of all the store names and their manager names, sorted in dictionary order of the store name. IV. A list of all customers that have not placed an order yet. Displaying customer number and name will be sufficient. V. A list containing the name of employees, who work as supervisors for ‘Sports’ departments in various stores. Show store names and the supervisors of Sports departments. VI. A list containing the total quantity on hand for each product (product number and description) regardless of stores. VII. A list showing each product sold (picked) on or before May 20, 2018. Show product number, name and quantity sold, sorted by product number and then quantity sold. VIII. A list of products (show product number, description and price) whose price is less than or equal to the average product price. IX. Increase each employee’s salary by 7.5% and show the updated salary of all employees (name and salary). X. Show the pay information (employee name, hours paid, amount paid) of all employees in the most recent pay date. 2814ICT & 7003ICT - Assignment Part 2 Page 3 of 4 Additional queries for 7003ICT students only: XI. Make a list of all “Medium” size shirts and their price in ascending order of price. Show the product description and price. XII. A list of supervisors (employee id, name) and all of their subordinates (employee id, name). 4. Task 4: Create a text file named Update_.sql or Update_.txt that will perform the followings. Insert additional data in the tables appropriately if needed. A customer, named Daniel Ortega and having a mobile number 0431xxx668, ordered two shirts of size “Medium” on 6 Sep 2018. The full order was ready on 8 Sep 2018 for pickup, but the customer picked up on 10 Sep 2018. You should insert data into appropriate tables for the above order and make sure you update the data in the relevant tables after the order is picked up. Note: Tasks 1 to 4 are for all students, only 7003ICT students should do Queries XI and XII in Task 3. You are required to adhere to the following output formatting conventions:  Any query requiring names of people should be printed as GivenName FamilyName (e.g. John Wang) in a column labelled NAME; and  All monetary values should be printed with a dollar symbol ($), two digits after the decimal point. What to submit? An electronic copy of your assignment should be submitted online and should include a copy of your report and the four files described in Task 1 to Task 4 above. Zip all the files into a single file named 'a2‐.zip' before uploading. Your report should include:  Use the supplied template for your Assignment Report.  An appropriate title page that includes an acknowledgement of all students you have spoken to about the assignment.  A table of contents and page numbers.  A report of the results from running the SQL queries (Task 3) by using copy/paste of their output.  A bibliography containing a list of all resources used to complete the assignment. If no resources, apart from the course materials, have been used please indicate this. Assessment Criteria  How clear and well organised your presentation is. On the front page of your report you should include a list of acknowledgements of all people who have assisted you with this assignment including fellow students.  Adherence to our standards. How clear and well organised your presentation is. You should write all the queries in consistent style and use indent format. 2814ICT & 7003ICT - Assignment Part 2 Page 4 of 4  Data correctness and quality. Please use appropriate data for your examples (e.g., do not use inappropriate person names)  Please refer to the provided marking guide (below) to see the distribution of marks. Assignment Resources Find the following information in attached files:  The logical ER Diagram, and  Relational Database Schema. Assessment Criteria and Marking Overview (may be subject to change) For 2814ICT students only: ITEM Marks 1. Presentation How clear and well‐presented your submission is. 8 2. Creation of database and tables (Task 1) Create the relevant tables: Database correctly named and created, includes all of the PKs and FKs in the database. No evidence that tables have been created using the GUI. They work properly. 20 3. Insertion (Task 2) Successfully inserts data into the tables. NO evidence exporting from GUI. They work properly. 30 4. Query (Task 3) Use of appropriate query statements. They work as intended. Each query should output at least one row of valid data. 32 5. Update (Task 4) Use of appropriate data manipulation statements to perform the required actions. They work as intended. 10 Total 100 Out of 7% of the total assessment 7 For 7003ICT students only: ITEM Marks 1. Presentation How clear and well‐presented your submission is. 5 2. Creation of database and tables (Task 1) Create the relevant tables: Database correctly named and created, includes all of the PKs and FKs in the database. No evidence that tables have been created using the GUI. They work properly. 20 3. Insertion (Task 2) Successfully inserts data into the tables. NO evidence exporting from GUI. They work properly. 30 4. Query (Task 3) Use of appropriate query statements. They work as intended. They work as intended. Each query should output at least one row of valid data. 35 5. Update (Task 4) Use of appropriate data manipulation statements to perform the required actions. They work as intended. 10 Total 100 Out of
Answered Same DayMay 23, 20212814ICTGriffith University

Answer To: 7102ICT- Case Study 2814ICT & 7003ICT - Assignment Part 2 Page 1 2814ICT – DATA MANAGEMENT 7003ICT –...

Rushendra answered on May 24 2021
147 Votes
sql_assignment/Task1/tables.txt-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema bigM
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema bigM
-- -----------------------------------------------------
CREATE SC
HEMA IF NOT EXISTS `bigM` DEFAULT CHARACTER SET utf8 ;
USE `bigM` ;
-- -----------------------------------------------------
-- Table `bigM`.`CUSTOMER`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`CUSTOMER` (
`cust_number` INT NOT NULL AUTO_INCREMENT,
`cust_fname` VARCHAR(30) NULL,
`cust_lname` VARCHAR(30) NULL,
`cust_phone` CHAR(10) NULL,
PRIMARY KEY (`cust_number`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`CUSTOMERORDER`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`CUSTOMERORDER` (
`custord_id` INT NOT NULL AUTO_INCREMENT,
`custord_date` DATE NULL,
`cust_number` INT NULL,
`str_num` INT NULL,
PRIMARY KEY (`custord_id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`orderline`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`orderline` (
`custord_id` INT NOT NULL AUTO_INCREMENT,
`prod_num` INT NULL,
`ordin_datearrived` DATE NULL,
`ordin_datepicked` DATE NULL,
`ordin_qnty` INT NULL,
PRIMARY KEY (`custord_id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`product`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`product` (
`prod_num` INT NOT NULL AUTO_INCREMENT,
`prod_desc` VARCHAR(50) NULL,
`prod_size` VARCHAR(10) NULL,
`prod_price` DECIMAL(4,2) NULL,
PRIMARY KEY (`prod_num`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`inventory`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`inventory` (
`productnum` INT NOT NULL AUTO_INCREMENT,
`str_num` INT NULL,
`inv_qntyonhand` INT NULL,
`inv_qtyordered` INT NULL,
PRIMARY KEY (`productnum`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`store`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`store` (
`str_num` INT NOT NULL AUTO_INCREMENT,
`str_name` VARCHAR(50) NULL,
`str_phone` CHAR(10) NULL,
`str_fax` CHAR(10) NULL,
`str_email` VARCHAR(40) NULL,
`storemanagerid` INT NULL,
`supstore_num` INT NULL,
PRIMARY KEY (`str_num`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`storedepartment`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`storedepartment` (
`strdept_id` INT NOT NULL AUTO_INCREMENT,
`strdept_phone` CHAR(10) NULL,
`strdept_email` VARCHAR(40) NULL,
`deptsupervisorid` INT NULL,
`str_num` INT NULL,
`dept_id` INT NULL,
PRIMARY KEY (`strdept_id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`department`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`department` (
`dept_id` INT NOT NULL AUTO_INCREMENT,
`dept_name` VARCHAR(40) NULL,
PRIMARY KEY (`dept_id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`employee`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`employee` (
`emp_id` INT NOT NULL AUTO_INCREMENT,
`emp_fname` VARCHAR(30) NULL,
`emp_lname` VARCHAR(30) NULL,
`emp_phone` CHAR(10) NULL,
`emp_dob` DATE NULL,
`emp_startdate` DATE NULL,
`emp_taxfnum` CHAR(15) NULL,
`emp_hourlysalary` DECIMAL(10,2) NULL,
`strdept_id` INT NULL,
`supervisorid` INT NULL,
PRIMARY KEY (`emp_id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `bigM`.`payslip`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `bigM`.`payslip` (
`pay_id` INT NOT NULL AUTO_INCREMENT,
`pay_date` DATE NULL,
`pay_num_of_hours` DECIMAL(4,2) NULL,
`pay_amount_gross` DECIMAL(6,2) NULL,
`emp_id` INT NULL,
`str_num` INT NULL,
PRIMARY KEY (`pay_id`))
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
Constraints
ALTER TABLE `bigm`.`employee`
CHANGE COLUMN `supervisorid` `supervisorid` INT NULL DEFAULT NULL ,
ADD INDEX `supervises_idx` (`supervisorid` ASC) VISIBLE;
;
ALTER TABLE `bigm`.`employee`
ADD CONSTRAINT `supervises`
FOREIGN KEY (`supervisorid`)
REFERENCES `bigm`.`employee` (`emp_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
UPDATE `bigm`.`store`
SET
`supstore_num` = 200
WHERE `supstore_num` >0;
ALTER TABLE `bigm`.`store`
ADD INDEX `supervises_idx2` (`supstore_num` ASC) VISIBLE;
;
ALTER TABLE `bigm`.`store`
ADD CONSTRAINT `supervises2`
FOREIGN KEY (`supstore_num`)
REFERENCES `bigm`.`store` (`str_num`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
ALTER TABLE `bigm`.`customerorder`
ADD INDEX `storNum_idx` (`str_num` ASC) VISIBLE,
ADD INDEX `custNo_idx` (`cust_number` ASC) VISIBLE;
;
ALTER TABLE `bigm`.`customerorder`
ADD CONSTRAINT `storeNum`
FOREIGN KEY (`str_num`)
REFERENCES `bigm`.`store` (`str_num`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
ADD CONSTRAINT `custNo`
FOREIGN KEY (`cust_number`)
REFERENCES `bigm`.`customer` (`cust_number`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
ALTER TABLE `bigm`.`orderline`
ADD INDEX `prodNum_idx` (`prod_num` ASC) VISIBLE;
;
ALTER TABLE `bigm`.`orderline`
ADD CONSTRAINT `cust_order`
FOREIGN KEY (`custord_id`)
REFERENCES `bigm`.`customerorder` (`custord_id`)
ON DELETE...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here