Question: The following questions are based on a Sporting Goods database described below: customer (id: int , name: string , city: string , country: string, rating:

The following questions are based on a Sporting Goods database described below:

customer (id: int, name: string, city: string, country: string, rating: string, sales_rep_id: int )

dept(id: int, name: string, region_id: string)

sales_rep(id: int, last_name: string, first_name: string, dept_id: int, salary: int)

order(id: int, customer_id: int, date_ordered: date, total: int)

Write SQL queries for each of the following sub-questions.

1) Display the name, city, country, and rating of all customers whose number of orders exceeds the average number of orders for a customer.

2) Display the name of all the departments that have at least one employee.

3 )Display the first name and last name of all sales representatives who do not have customers.

4) Find the countries in which there are no sales representatives. If required, make any assumptions and state them.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!