Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Acknowledgment to Dr. Greg Wadley from The University of Melbourne to help us design this assignment. Setup Script To set up the database in your
Acknowledgment to Dr. Greg Wadley from The University of Melbourne to help us design this assignment. Setup Script To set up the database in your MySQL server, download the file Assignmentsetup.sql from Canvas and run it in Workbench. This script creates the schema and database tables and populates them with data. The SQL queries required In this section are listed 15 questions for you to answer. Write one SQL statement per question. Do not use views or temporary tables to answer the questions. Where it would improve readability, order your output, and use aliases. Format large numbers and fractions appropriately. Beside each question is a maximum mark which reflects the difficulty of that question. Your total score will be scaled to 15% of your overall marks in the subject. Your work will be assessed on the correctness and simplicity of the SQL that you write. (A query that produces correct output but is more complex than it needs to be, for example joining more tables than is necessary, may not achieve full marks, even if it produces the correct results.) Table: department Columns: DepartmentID smallint PK DepartmentName varchar(50) DepartmentFloor int DepartmentPhone int ManagerID smallint Table: employee Columns: EmployeeID smallint PK EmployeeName varchar(50) Employee Salary decimal(8,2) DepartmentID smallint BOSSID smallint Table: item Columns: ItemID smallint PK ItemName varchar(50) Item Type char(1) ItemColour varchar(20) 5. Type the query to find the average salary of employees in the Clothes department 6. List the name and salary of the managers with more than 2 employees
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started