Question

Consider the Goldstar database. Choose the query that displays the average salary for all positions in...

Consider the Goldstar database. Choose the query that displays the average salary for all positions in the city of Chicago.

SELECT title, AVG(max_salary) AS AverageSalary FROM position, employee, location WHERE location.location_id = employee.location_id AND position.position_id = employee.position_id AND city = "Chicago" GROUP BY title;

SELECT title, AVG(salary) AS AverageSalary FROM position, employee, location WHERE position.position_id = employee.position_id AND location.location_id = employee.location_id AND city = "Chicago" GROUP BY title;

SELECT title, AVG(salary) AS AverageSalary FROM position, employee, location WHERE location.location_id = employee.location_id AND city = "Chicago" GROUP BY title;

SELECT title, AVG(max_salary) AS AverageSalary FROM position, employee, location WHERE location.location_id = employee.location_id AND position.position_id = employee.position_id OR city = "Chicago" GROUP BY title;

Homework Answers

Answer #1

The answer is:

SELECT title, AVG(salary) AS AverageSalary FROM position, employee, location WHERE position.position_id = employee.position_id AND location.location_id = employee.location_id AND city = "Chicago" GROUP BY title;

Explanation

  • The select statement is selecting the title and the average salary
  • We have three tables here - position, employee and location
  • The where statement is telling show the position for those employees in the city of Chicago
  • Grouping is by title which is required

Let me know in the comments if anything is not clear. I will reply ASAP! Please do upvote if satisfied!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the Goldstar database. Choose the query that will display all of the position titles and...
Consider the Goldstar database. Choose the query that will display all of the position titles and the number of employees that hold that position. SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id = employee.position_id GROUP BY title; SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title; SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title; SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id =...
Consider the Goldstar database and the query below. What will the query display? SELECT city, COUNT(performance)...
Consider the Goldstar database and the query below. What will the query display? SELECT city, COUNT(performance) AS TotalEmployees FROM location, employee WHERE location.location_id = employee.location_id GROUP BY city; ? The total number of employees in each city that have NOT received performance ratings The total number of employees in each city The total number of employees in each city that have received performance ratings None of the other answers provided is correct
Which query lists all products with a total quantity sold less than the average quantity sold?...
Which query lists all products with a total quantity sold less than the average quantity sold? Select one: a. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < AVG(LINE_UNITS); b. SELECT P_CODE, AVG(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING AVG(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); c. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); d. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE...
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a....
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a. operator b. subquery c. alias d. view If a subquery returns list of values, which operator can be used in the outer query predicate? Select one: a. > b. < c. IN d. = Which query returns a list of all products with a price greater than or equal to the average product price? Select one: a. SELECT P_CODE,MAX(AVG(P_PRICE)) FROM PRODUCT GROUP BY P_CODE;...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make the files to create and populate the Company database available on Isadore shortly): List the last name and address of managers who have a dependent with the same first name as themselves. Retrieve the names of all employees who are directly supervised by ‘Franklin Wong’. Retrieve the names of employees in the Research department who work more than 20 hours per week on the...
Project Description: As the Human Resources Manager, you maintain employee salary data. You exported data from...
Project Description: As the Human Resources Manager, you maintain employee salary data. You exported data from the corporate database into an Excel workbook. You want to display subtotals for salary by city. For further analysis, you want to create a PivotTable to determine what the total salaries would be if employees who earn an Excellent rating get a 5% increase in salary. Finally, you want to create a PivotChart that depicts what percentage of employees earn each performance rating. Instructions:...
Translating MongoDB Queries to SQL - WILL UPVOTE!! 1. Write the equivalent sql queries for all...
Translating MongoDB Queries to SQL - WILL UPVOTE!! 1. Write the equivalent sql queries for all mongoDB queries. The following is an example of what you are asked to do. Assume the collection name is the table name in an sql database. Example: MongoDB Query: db.zips.aggregate([ {$match: {state: "MO"}}, {$group: {_id: "$city", totalPop: {$sum: "$pop"}}}, {$sort: {totalPop: -1}}, {$limit: 10} ]) SQL Result: Select city, SUM(pop) AS "totalPop" From zips Where state = "MO" Group By city Order By SUM(pop)...
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects....
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch08_ConstructCo database are shown in Figure P8.1. Use this database to answer the following problems. Database Schema The schema for the Ch08_ConstructCo database is shown below and should be used to answer the next several problems. Click this image to view it in its own...
You are most likely to observe secondary succession when you visit (choose ALL options that are...
You are most likely to observe secondary succession when you visit (choose ALL options that are correct): Note: you must select ALL the correct answers to receive credit. There is no partial credit. Group of answer choices an area that was recently covered by a glacier that is now receding. a volcanic mountain slope where a volcano recently erupted. a Chautauqua meadow in Boulder recovering from a drought. a forest where trees have been blown down by a hurricane. an...