Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Will rate 2. [80 points] Consider the employee database of Fig. 1, where the primary keys are underlined. Write an SQL query to find, for

image text in transcribedWill rate
2. [80 points] Consider the employee database of Fig. 1, where the primary keys are underlined. Write an SQL query to find, for every state, the number of families in every city with family incomes higher than the average family income of the state. Assume that the family income of a family is the sum of salaries of employees living al the same address. Note that you shall generate a relation higherThanAverage Families(count, city, state). employee(employee-id, employee-name, street-number, street, city, state) works(employee-id, company-id, salary Figure 1. Employee database

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions