Consider a schema of two tables: Orders and Customers, as given below. Write a query to display the customer ids of customers who placed orders, followed by the grade of the customer. Sort the records as per the grades in descending order. Note: Please don't use Analytical or Windows functions such as RANK, DENSE RANK, ROW_NUMBER, etc, as they are not supported in MySQL Table Names and Column names should be in the same case (lower/uppercase/InitCap) given in question while writing SQL queries else it will create a syntax error Orders Column Ord No Purch Amt Customer Id Salesman id Type Varchar(20) Varchar(20) Int(11) Int(11) Customers Туре Int(11) Varchar(20) Varchar(20) Varchar(20) Int(11) Column Customer Jd Cust. Name City Grade Salesman Jd Sample Ingut Orders Ord NoPurch AmtCustomer_id Salesman_ld 3456 5450 150 250 1002 8976 9976 100%

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

Refer the image and write a sql program as per the question. Don't create any database. Please start your code directly with Select option. The sql program should run on Mysql. An upvote for correct sql program. Just type the correct sql code.

Consider a schema of two tables: Orders and Customers, as glven below. Write a query to display the customer ids of customers who placed orders, followed by
the grade of the customer. Sort the records as per the grades in descending order.
Note: Please don't use Analytical or Windows functions such as RANK, DENSE RANK, ROW_NUMBER, etc, as they are not supported in MYSQL
Table Names and Column names should be in the same case (lower/uppercase/InitCap) given in question while writing SQL queries else it will create a
syntax error
Orders:
Column
Ord No
Purch Amt
Customer ld
Salesman_ld
Туре
Varchar(20)
Varchar(20)
Int(11)
Int(11)
Customers
Column
Customer id
Cust Name
City
Grade
Туре
Int(11)
Varchar(20)
Varchar(20)
Varchar(20)
Int(11)
Salesman Id
Sample Input:
Orders:
Ord NoPurch_AmtCustomer_ld Salesman_ld
1002
TIOK
150
250
3456
5456
8976
9976
1003
Preo estion
Next Question
En
03:55
04:18
11:54 PMM
all
* 即四
O ENG
25-03-2022
SHOT ON REDMI 7
AI DUAL CAMERA
Transcribed Image Text:Consider a schema of two tables: Orders and Customers, as glven below. Write a query to display the customer ids of customers who placed orders, followed by the grade of the customer. Sort the records as per the grades in descending order. Note: Please don't use Analytical or Windows functions such as RANK, DENSE RANK, ROW_NUMBER, etc, as they are not supported in MYSQL Table Names and Column names should be in the same case (lower/uppercase/InitCap) given in question while writing SQL queries else it will create a syntax error Orders: Column Ord No Purch Amt Customer ld Salesman_ld Туре Varchar(20) Varchar(20) Int(11) Int(11) Customers Column Customer id Cust Name City Grade Туре Int(11) Varchar(20) Varchar(20) Varchar(20) Int(11) Salesman Id Sample Input: Orders: Ord NoPurch_AmtCustomer_ld Salesman_ld 1002 TIOK 150 250 3456 5456 8976 9976 1003 Preo estion Next Question En 03:55 04:18 11:54 PMM all * 即四 O ENG 25-03-2022 SHOT ON REDMI 7 AI DUAL CAMERA
Orders:
andur
Ord NoPurch_AmtCustomer_ld Salesman_ld
3456
5456
6456
7895
9895
1002
1003
150
250
8976
9976
1004
1005
1006
1007
620
890
990
789
9876
5647
7647
2568
8856
Customers:
Customer_Id Cust Name
3456
5456
6456
7895
9895
2568
Grade Salesman_ld
8976
9976
9876
5647
City
Bangalore 100
Pune
Rohny
Sanket
Jimmy
Jasmine
200
Bangalore 300
Mumbai
Hyderabad 400
Mumbai
100
Ravi
Kiran
7647
8856
100
Sample Ouput:
9895.400
6456,300
5456,200
2568,100
7895 100
3456 100
Corten Coo
Pinous Yeon
Prious Question
Net Quetion
SHOT ON REDMI 7
AI DUAL CAMERA
Transcribed Image Text:Orders: andur Ord NoPurch_AmtCustomer_ld Salesman_ld 3456 5456 6456 7895 9895 1002 1003 150 250 8976 9976 1004 1005 1006 1007 620 890 990 789 9876 5647 7647 2568 8856 Customers: Customer_Id Cust Name 3456 5456 6456 7895 9895 2568 Grade Salesman_ld 8976 9976 9876 5647 City Bangalore 100 Pune Rohny Sanket Jimmy Jasmine 200 Bangalore 300 Mumbai Hyderabad 400 Mumbai 100 Ravi Kiran 7647 8856 100 Sample Ouput: 9895.400 6456,300 5456,200 2568,100 7895 100 3456 100 Corten Coo Pinous Yeon Prious Question Net Quetion SHOT ON REDMI 7 AI DUAL CAMERA
Expert Solution
steps

Step by step

Solved in 2 steps with 1 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