Question
In this assignment/project you are asked to create a relational database and query it using SQLite. To do: Create an SQL database My_Company The database
In this assignment/project you are asked to create a relational database and query it using SQLite.
To do:
Create an SQL database My_Company
The database should have 2 tables: Department and Employee. The structure of the tables (columns) is shown below Write and run SQLite statements to create these two tables, declare primary keys for each of them(Department primary key is DepartmentName, Employee primary key is EmployeeNumber, Department in Employee table is a foreign key that refers DepartementName from Department)
EMPLOYEE
Employee Name | First Name | Last Name | Department | Phone | Salary |
1 | Mary | Jacobs | Administration | 360-285-8110 | 54 |
2 | Rosalie | Jackson | Administration | 360-285-8120 | 60 |
3 | Richard | Bandalone | Legal | 360-285-8210 | 65 |
4 | Tom | Caruthers | Accounting | 360-285-8310 | 53 |
5 | Heather | Jones | Accounting | 360-285-8320 | 46 |
6 | Mary | Abemathy | Finance | 360-285-8410 | 55 |
7 | George | Smith | Human Resources | 360-285-8510 | 46 |
8 | Tom | Jackson | Production | 360-287-8610 | 52 |
9 | George | Jones | Production | 360-287-8620 | 44 |
10 | Ken | Numoto | Marketing | 360-287-8710 | 51 |
11 | James | Nestor | InfoSystems | 360-287-8810 | 55 |
12 | Rick | Brown | InfoSystens | 360-287-8820 | 60 |
DEPARTMENT | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Write and run SQLite statement to insert the shown records/data into the corresponding tables (shown above).
Write and run SQLite queries to find:
Departments (the entire their information) with budgets less than $30, 000.
Departments (display only department name and budget) with budgets larger $40, 000
Find total budget for the company (use corresponding SQL aggregate function)
Find average budget for the company (use corresponding SQL aggregate function)
Find largest budget for the company (use corresponding SQL aggregate function)
Find smallest budget for the company (use corresponding SQL aggregate function)
Find the employees (the entire information of them) who work at Administration
Find the employees (display first name, last name and department) with salary larger than 46K (Salary numbers are given in K).
Find the employees (display first name, last name, salary) for those who works at Accounting or Finance.
Find the employees (the entire information) who works at Production and has a salary larger than 50K.
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