Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Department Name Budget Code OfficeNumber Phone Budget
Accounting BC-300-10

BLDG01-100

360-285-8300

20000
Administration BC-100-10

BLDG01-300

360-285-8100

30000
Finance BC-400-10

BLDG10-140

360-285-8400

25000
Human Resources BC-500-10

BLDG01-180

360-285-8500

20000
InfoSystems BC-800-10

BLDG02-270

360-287-8800

50000
Legal BC-200-10

BLDG01-200

360-285-8200

24000
Marketing BC-700-10

BLDG02-200

360-287-8700

25000
Production BC-600-10

BLDG02-100

360-287-8600

100000

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions