SQL Exercises: Display customer name, city, grade (according to the smallest ID)
SQL Formatting Output : Exercise-6 with Solution
Write a SQL statement to display the customer name, city, and grade and the display will be arranged according to the smallest customer ID.
Sample table: customer
SELECT cust_name,city,grade FROM customer ORDER BY customer_id;
Output of the Query:
cust_name city grade Brad Guzan London Nick Rimando New York 100 Jozy Altidor Moscow 200 Fabian Johnson Paris 300 Graham Zusi California 200 Brad Davis New York 200 Julian Green London 300 Geoff Cameron Berlin 100
Pictorial presentation :
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a SQL statement to display the orders with all information in such a manner that, the older order date will come first and the highest purchase amount of same day will come first.
Next: Write a SQL statement to make a report with salesman ID, order date and highest purchase amount in such an arrangement that, the smallest salesman ID will come first along with their smallest order date.
What is the difficulty level of this exercise?