9 lines
454 B
SQL
9 lines
454 B
SQL
/*8. Write a query to create a union of two queries that shows the names, cities, and ratings of all customers. Those with
|
|
a rating of 300 or greater will also have the words High Rating, while the others will have the words Low Rating.*/
|
|
SELECT customer_id, city, grade, 'High Rating'
|
|
FROM customer
|
|
WHERE grade >= 300
|
|
UNION
|
|
SELECT customer_id, city, grade, 'Low Rating'
|
|
FROM customer
|
|
WHERE grade < 300; |