Find and display sales men that must not be living in the city similar to their customers also got a commission from the company more than 10%. Find the salesman_id, name and commissions for salesman whose commission is higher than the average commission throughout the company. Find the orders that sales person ‘Hassan’ issued Find orders where the amount of order is more than at least one order from May 2nd Write a SQL statement to make a report with customer name, city, order id, order date, and order amount in ascending order according to the order date to find that either any of the existing customers have placed no order or placed one or more orders.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
  • Find and display sales men that must not be living in the city similar to their customers also got a commission from the company more than 10%.
  • Find the salesman_id, name and commissions for salesman whose commission is higher than the average commission throughout the company.
  • Find the orders that sales person ‘Hassan’ issued
  • Find orders where the amount of order is more than at least one order from May 2nd
  • Write a SQL statement to make a report with customer name, city, order id, order date, and order amount in ascending order according to the order date to find that either any of the existing customers have placed no order or placed one or more orders.

 

Сustomer id
Customer патe
City
Order id
Order date
Order amount Salesman į
1001
Ahmed
Lahore
2001
2020-07-15
2000
2001
1002
Ali
Lahore
2001
2019-05-02
2500
2001
1003
Sara
Islamabad 2003
2021-09-01
15000
2003
1004
Hania
Karachi
2002
2019-05-02
3000
2002
1005
zara
Multan
2004
2018-10-20
3500
2004
1006
Hamid
Islamabad 2003
2019-05-02
4000
2003
Customer Table
Salesman id
Salesman_naте
City
Соmmission
2001
Hassan
Lahore
0.15
2002
Haris
Multan
0.12
2003
Sana
Karachi
0.11
2004
Fizza
Bahawalpur
0.14
2005
Ashir
Lahore
0.14
2006
Anita
Quetta
0.13
Salesman table
Transcribed Image Text:Сustomer id Customer патe City Order id Order date Order amount Salesman į 1001 Ahmed Lahore 2001 2020-07-15 2000 2001 1002 Ali Lahore 2001 2019-05-02 2500 2001 1003 Sara Islamabad 2003 2021-09-01 15000 2003 1004 Hania Karachi 2002 2019-05-02 3000 2002 1005 zara Multan 2004 2018-10-20 3500 2004 1006 Hamid Islamabad 2003 2019-05-02 4000 2003 Customer Table Salesman id Salesman_naте City Соmmission 2001 Hassan Lahore 0.15 2002 Haris Multan 0.12 2003 Sana Karachi 0.11 2004 Fizza Bahawalpur 0.14 2005 Ashir Lahore 0.14 2006 Anita Quetta 0.13 Salesman table
2
id
Dept name
Salary
Hame
1
Hassan
CS
20000
Haris
CE
15000
3
Sana
CS
25000
4
Eizza
SE
40000
Ashir
Maths
35000
Anita
CS
20000
6- Find names of instructors with salary greater than all instructors in the CS department.
7- Find the average instructors' salaries of those departments where the average salary is greater than $22,000."
Compans id
Company name
11
Samsung
12
iBall
13
Asus
14
Ension
Соmpанy table
Product id
Product namE
Price
Comp id
1
Keyboard
3000S
12
Monitor
2000$
13
Mother Board
1000$
12
4
Printer
3500S
14
Product Table
8- Write a SQL query to select sll rows from both participating tables as long as there is a match between
Compaoyid and compid.
9 Write a SQL query to find the most expensive product of each company. Return groduct.name. price and
10- Write SQ query to return lowest of the average price of the product.
Transcribed Image Text:2 id Dept name Salary Hame 1 Hassan CS 20000 Haris CE 15000 3 Sana CS 25000 4 Eizza SE 40000 Ashir Maths 35000 Anita CS 20000 6- Find names of instructors with salary greater than all instructors in the CS department. 7- Find the average instructors' salaries of those departments where the average salary is greater than $22,000." Compans id Company name 11 Samsung 12 iBall 13 Asus 14 Ension Соmpанy table Product id Product namE Price Comp id 1 Keyboard 3000S 12 Monitor 2000$ 13 Mother Board 1000$ 12 4 Printer 3500S 14 Product Table 8- Write a SQL query to select sll rows from both participating tables as long as there is a match between Compaoyid and compid. 9 Write a SQL query to find the most expensive product of each company. Return groduct.name. price and 10- Write SQ query to return lowest of the average price of the product.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY