September 2017
Intermediate to advanced
240 pages
5h 57m
English
Out of the CRUD matrix you only know create. You can create tables and you can create rows in those tables. I’ll now show you how to read, or in the case of SQL, SELECT:
ex5.sql
1 SELECT * FROM person; 2 3 SELECT name, age FROM pet; 4 5 SELECT name, age FROM pet WHERE dead = 0; 6 7 SELECT * FROM person WHERE first_name != "Zed";
Here’s what each of these lines does:
Line 1 This says “select all columns from person and return all rows.” The format for SELECT is SELECT what FROM tables(s) WHERE (tests), and the WHERE clause is optional. The * (asterisk) character is what says you want all columns.
Line 3 In this one I’m only asking for two columns, name and age, from the ...
Read now
Unlock full access