Extra Credit Assignment: Multiple Table Query -Worker - Department Branch Database
- Due Dec 6, 2020 by 11:59pm
- Points 0
- Submitting a text entry box or a file upload
- File Types sql
- Available Oct 12, 2020 at 12am - Dec 7, 2020 at 11:59pm
100 Point Extra Credit Assignment
You will use a text editor such as Notepad ++ or Visual Studio Code to write the queries to the sample database provided. I included an ER Diagram, Metadata, and a sample database to test your queries on.
ER Diagram for the Branch Dept Worker Database Download ER Diagram for the Branch Dept Worker Database
Metadata and Information Requests Download Metadata and Information Requests
Link for Sample Database for Branch Dept Worker problems Download Link for Sample Database for Branch Dept Worker problems
Submit The Following Documents
- SQL Script files containing the SQL Script responding to the information requests. Test File contain the SQL Script must have an SQL Extension
Multiple Table Query Assignment
Below is an illustration of the data of a table named Worker. Write queries to satisfy the information requests at the bottom of the table. Upload your completed list of queries in a text file with an SQL extension
Assume the following about the data in the table
Branch
Attribute |
Data Type |
Range |
Key |
Description |
Branchid |
Text |
All characters |
Primary Key |
|
Branchname |
Text |
All characters |
|
Name of Branch |
Dept
Attribute |
Data Type |
Range |
Key |
Description |
deptID |
Text |
All characters |
Primary Key |
|
deptName |
Text |
All characters |
|
Name of Dept |
branchID_FK |
Text |
All characters |
Foreign Key |
Connects to the Branch Table |
Worker
Attribute |
Data Type |
Range |
Key |
Description |
workerID |
Text |
All characters |
Primary Key |
|
lName |
Text |
All characters |
|
Last Name of Worker |
Gender |
Text |
M or F |
|
Gender of Worker |
Salary |
Numeric |
All numbers |
|
Salary of Worker |
Commission |
Numeric |
All numbers |
|
Bonus of Worker |
deptID_FK |
Text |
All characters |
Foreign Key |
Connects to the Dept Table |
There is also a sample sandbox database with test data available through the assignment link in Canvas
Multiple Table SELECT Queries for this assignment
100 Point Assignment – Questions are 25 Points for each correct query
Constraints (See the following page for table elements)
Dept table: deptID is the primary key & branchID is a foreign key that references the branchID field in the Branch table.
Branch table: branchID is the primary key.
Worker table: workerID is the primary key and deptID references deptID in the dept table.
- Write a query to list the name and gender and total pay for all workers. Total Pay is equal to Salary plus Commission
- Write a query to list the Departments Names for all department in New York and Boston
- Write a query to list the Work Last Name, Gender, Branch Name, and Department Name for all workers that are female
- Write a query to find the employees that do NOT earn a commission. In the output include each employee’s workerID, name, salary and department name.