/* open comment
*/ close comment
/* this is what a SQL comment looks like */SELECT * FROM table_name;SELECT * FROM artists;SELECT column_name FROM table_name;SELECT name FROM playlists;SELECT first_column_name, second_column_name FROM table_name;SELECT first_name, last_name, title, email FROM employees;SELECT * FROM table_name WHERE column = condition;SELECT * from tracks WHERE unit_price = 1.99;Example 2 - There's a promotion for your customers who live in France. Return the first name, last name, and phone number of the customers you'll add to the telemarketing list.
SELECT first_name, last_name, phone FROM customers WHERE country = 'France';SELECT COUNT(*) FROM table_name;Example - CEO wants to know how many customers there are only in Arizona. Return the number of customers in the state of AZ.
SELECT COUNT(*) FROM customers WHERE state = 'AZ';SELECT AVG(column_name) FROM table_name;SELECT AVG(milliseconds) FROM tracks;SELECT MIN(milliseconds) FROM tracks;SELECT MAX(milliseconds) FROM tracks;SELECT column_name FROM table_name WHERE column_name < condition;SELECT * FROM employees WHERE birth_date < '1962-02-18';SELECT * FROM artists WHERE LENGTH(name) < 5;% - WILDCARD
SELECT column_name FROM table_name WHERE column_name LIKE '%condition%';SELECT * FROM artists WHERE name LIKE 'S%
