SQSQL · Lesson 1 of 8
Tables & SELECT
A relational database is just spreadsheets with rules: tables made of rows and columns. SELECT is how you ask questions about them — and it's 80% of the SQL you'll ever write.
Everything in SQL revolves around tables. A table has named columns (each with a type) and any number of rows. SELECT reads rows out of a table. You choose which columns you want, and optionally filter which rows come back.
◆ Note
SQL keywords are case-insensitive — select, SELECT, and SeLeCt all work. Convention is UPPERCASE for keywords and lowercase for table/column names, which makes queries easier to scan.
SQL keywords are case-insensitive — select, SELECT, and SeLeCt all work. Convention is UPPERCASE for keywords and lowercase for table/column names, which makes queries easier to scan.
✦ Tip
Note the 'not equal' operator is <> in standard SQL, though most databases also accept !=. Also: SQL strings use single quotes ('Ada'), not double quotes — double quotes mean identifiers (column/table names) in standard SQL.
Note the 'not equal' operator is <> in standard SQL, though most databases also accept !=. Also: SQL strings use single quotes ('Ada'), not double quotes — double quotes mean identifiers (column/table names) in standard SQL.