All courses › Databases, Networks and Security › SELECT and WHERE
SELECT and WHERE
An SQL query fetches data. FROM says which table, WHERE which rows, and SELECT which columns are shown. ORDER BY sorts the result. The database runs the parts in a different order than you write them.
fetch names of students over 20
sort the result
Symbols
| which table | ||
| which rows | ||
| which columns |
Example
Salaries 520, 610, 480 and 700 (thousand):
gives 3.
If you forget WHERE in an UPDATE or DELETE, every row is changed.
Practise relational databases and SQL for free →
← Tables and keys · JOIN and GROUP BY →
Part of Databases, Networks and Security: Relational databases and SQL.