60-second card
Choosing columns
SELECT chooses which columns you see; FROM says which table they come from.
- SELECT name, city FROM students; shows two columns.
- SELECT * shows every column.
- DISTINCT removes repeated rows: SELECT DISTINCT city.
SELECT DISTINCT city FROM students ORDER BY city;Result
Chennai
Delhi
PuneRemember: List only the columns you need; it's clearer and faster.
Common mistake: Putting commas wrongly, like SELECT name city. That shows name, renamed to 'city'.