You will need to use MySQL Workbench to write and run these SQL statements. Writ
ID: 3874034 • Letter: Y
Question
You will need to use MySQL Workbench to write and run these SQL statements.
Write and execute a SELECT statement that counts how many companies in the Companies table that are in FL.
Write and execute a SELECT statement that returns the lowest starting salary and the highest starting salary from the Jobs table.
Write and execute a SELECT statement that returns the average starting salary of the jobs listed in the Jobs table.
Write and execute a SELECT statement that returns the name of the company from the Companies table that has the most number of employees.
Write and execute a SELECT statement that returns the name of the company from the Companies table that has the least number of employees.
Write and execute a SELECT statement that returns the average starting salary for each job title. Here is a hint on how to write this query:
Select JobTitle, AVG(StartingSalary) FROM Jobs GROUP BY JobTitle
Companies table data: Please use this data for company id, name, city, state, recruiter id, and number of employees. The CompanyID will be the primary key.
CompanyID
(PK)
CompanyName
City
State
RecruiterID
(FK)
NumberEmployees
1
Best in Class Ttors
Tampa
FL
10
200
2
Database Pros
Jacksonville
FL
1
22000
3
InfoTech Partners
Orlando
FL
5
1500
4
Aces of Data
Atlanta
GA
4
30000
5
Data for Charity
Augusta
GA
2
1200
6
Supreme Data Analysis
Pittsburgh
PA
3
3535
7
The Data Experts
Birmingham
AL
6
10000
8
Software Artists
Boston
MA
9
5000
9
Datacon
San Francisco
CA
7
7701
10
Datacentric Warehouse
Los Angeles
CA
8
90090
CompanyID
(PK)
CompanyName
City
State
RecruiterID
(FK)
NumberEmployees
1
Best in Class Ttors
Tampa
FL
10
200
2
Database Pros
Jacksonville
FL
1
22000
3
InfoTech Partners
Orlando
FL
5
1500
4
Aces of Data
Atlanta
GA
4
30000
5
Data for Charity
Augusta
GA
2
1200
6
Supreme Data Analysis
Pittsburgh
PA
3
3535
7
The Data Experts
Birmingham
AL
6
10000
8
Software Artists
Boston
MA
9
5000
9
Datacon
San Francisco
CA
7
7701
10
Datacentric Warehouse
Los Angeles
CA
8
90090
Explanation / Answer
SQL QUERIES
1) SELECT COUNT(DISTINCT CompanyID) FROM Companies WHERE STATE='FL';
2) SELECT MIN(StartingSalary),MAX(StartingSalary) FROM Jobs;
3) SELECT AVG(StartingSalary) From Jobs;
4) SELECT CompanyName FROM Companies WHERE NumberEmployees =
(SELECT MAX(NumberEmployees) FROM Companies );
5) SELECT CompanyName FROM Companies WHERE NumberEmployees =
(SELECT MIN(NumberEmployees) FROM Companies );
6) SELECT JobTitle,AVG(StartingSalary) FROM Jobs GROUP BY Jobtitle;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.