DBMS 1
DBMS 1
customer_id INT,
last_name VARCHAR(50),
age INT,
country VARCHAR(50)
);
ORDER BY age;
ORDER BY last_name;
Query : To order the customers by last_name in alphabetically descending
order.
Input :
SELECT * FROM Customers
Query : Find the Customer whose name starts with ‘D’ and is from ‘USA’.
Input :
SELECT * FROM Customers
Query : Find the Customer whose name starts with ‘D’ and is from a country
whose name starts with ‘U’.
Input :
SELECT * FROM Customers
WHERE first_name LIKE 'D%' AND (country = 'USA' or country LIKE 'U%');
Query : Find the Customer who is from ‘USA’ or a country whose name starts
with ‘U’.
Input :
SELECT * FROM Customers
WHERE first_name LIKE 'r%' AND country = 'USA' or country LIKE 'U%';
Query : Find the Customers whose names does not starts with ‘D’.
Input :
SELECT * FROM Customers
Query : Find the customers whose age is not ‘31’ and ‘22’.
Input :
SELECT * FROM Customers
WHERE customer_id = 1;
Query : Update the age of a customer.
Input :
UPDATE Customers
SET age = 30
WHERE customer_id = 5;