Today you’ll use SELECT to choose what to see and WHERE to decide which records belong in the result.
Which columns do I need? Use SELECT. Which rows qualify? Use WHERE. Text values need single quotes; numbers usually do not.
SELECT name, country FROM customers WHERE country = 'India';
From the customers table, return each person's name and country, but only for rows where country is India.
Without looking above, complete this sentence: SELECT chooses ______; WHERE filters ______.
SELECT chooses columns; WHERE filters rows.
Task: return the name and country of customers from India. Sort names alphabetically. You can edit the starter query or clear it and write your own.
Use WHERE country = 'India', then ORDER BY name.
SELECT lists the columns you want returned.FROM names the source table.WHERE keeps rows that match a condition.ORDER BY sorts the result.Tomorrow’s lesson can build on this without replacing today’s page. Bookmark this page and return to it for review.