SELECT * FROM employeesÂ
2. Display company name and contact for all CUSTOMERS
SELECT CompanyName, phone FROM customersÂ
3. Display first name and last name for all EMPLOYEES as one column, label the column
“Name�
SELECT CONCAT(FirstName, " ", LastName) AS Name FROM employees
4. Display the name of all PRODUCTS in stock.
select ProductName from productsÂ
where UnitsInStock>0 AND UnitsInStock IS NOT NULLÂ
5. Display the name of all PRODUCTS that cost $10 or less
SELECT ProductName FROM products WHERE UnitPrice<=10Â
6. Display name of all EMPLOYEES hired after 1992Â
SELECT CONCAT(FirstName, " ", LastName) AS Name FROM employees WHERE YEAR(HireDate) > 1992Â
7. Display name of all PRODUCTS that cost between $10 and $20
SELECT ProductName FROM products WHERE UnitPrice BETWEEN 10 AND 20Â
8. Display the name and phone # for CUSTOMERS that have no fax number listed
SELECT ContactName, PhoneÂ
FROM customersÂ
WHERE Fax IS NULL
9. Display EMPLOYEE information for employees born in March, June or September
SELECT * FROM employees WHERE MONTH(BirthDate)=3 OR MONTH(BirthDate)=6 OR MONTH(BirthDate)=9
10. Display all EMPLOYEES that are involved with sales sorted alphabetically by their last
name.
SELECT * FROM employees WHERE Title like 'sales %' OR Title like '%sales%' OR Title like '%sales %' ORDER BY LastNameÂ
11. Display the product name and supplier name for all products that cost less than $10 for
suppliers from the UK
SELECT products.ProductName,suppliers.CompanyName FROM products JOIN suppliers ON products.SupplierID = suppliers.SupplierID WHERE products.UnitPrice<10 AND suppliers.Country= 'UK'
12. Display the name(s) and product cost of the supplier with the most expensive product.
You may use multiple queries for this.
SELECT suppliers.CompanyName, products.UnitPrice AS ProductCost FROM suppliers JOIN products on suppliers.SupplierID=products.SupplierID WHERE UnitPrice IN ( SELECT MAX(UnitPrice) FROM products)Â
Don't forget to like & share it.Â
Connect with me if you want to learn - https://www.fiverr.com/mitsol