This document contains SQL queries that select data from the customer table based on different criteria and sorting orders. The queries filter rows by country, city, name fields and ID using operators like equals, LIKE, OR, AND and NOT. Some queries also sort the results in ascending or descending order by city and country fields.
This document contains SQL queries that select data from the customer table based on different criteria and sorting orders. The queries filter rows by country, city, name fields and ID using operators like equals, LIKE, OR, AND and NOT. Some queries also sort the results in ascending or descending order by city and country fields.
This document contains SQL queries that select data from the customer table based on different criteria and sorting orders. The queries filter rows by country, city, name fields and ID using operators like equals, LIKE, OR, AND and NOT. Some queries also sort the results in ascending or descending order by city and country fields.
SELECT * FROM customer WHERE ccountry = 'Germany'; SELECT * FROM customer WHERE ccountry = 'Germany' AND ccity = 'Frankfurt a.M.'; SELECT * FROM customer WHERE ccity = 'London' AND ccountry = 'UK'; SELECT * FROM customer WHERE ccity = 'London' OR ccountry = 'UK'; SELECT * FROM customer WHERE NOT ccity = 'London' ; SELECT * FROM customer WHERE ccountry LIKE '_____' ; SELECT * FROM customer WHERE ccountry LIKE'%n' ; SELECT * FROM customer WHERE ccountry LIKE '%n%'; SELECT * FROM customer WHERE ccountry LIKE '%n_%'; SELECT * FROM customer WHERE ccountry LIKE '%n_'; SELECT * FROM customer WHERE ccountry LIKE '%S%' OR ccountry LIKE '%s%'; SELECT * FROM customer WHERE cname LIKE '%d%' OR cname LIKE '%ra%'; SELECT * FROM customer WHERE cname LIKE '%d' OR cname LIKE '%ra'; SELECT * FROM customer WHERE cid LIKE '20%' AND ccountry ='Germany'; SELECT * FROM customer WHERE cid LIKE '20%' AND ccountry='Germany' ORDER BY ccity; SELECT * FROM customer WHERE cid LIKE '20%' AND ccountry='Germany' ORDER BY ccity DESC; SELECT * FROM customer WHERE cid LIKE '20%' AND ccountry='Germany' ORDER BY ccity ASC; SELECT * FROM customer ORDER BY ccountry, cname; SELECT * FROM customer ORDER BY ccountry, cname;