

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Learn SQL
incomplete
2: Select Single Column
incomplete
3: Select Multiple Columns
incomplete
4: What Is SQL?
incomplete
5: Which Databases Use SQL?
incomplete
6: NoSQL vs. SQL
incomplete
7: Comparing SQL Databases
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Databases are made up of tables which are made up of columns (AKA "fields"). It's just like an Excel spreadsheet.
Our CashPal database has a users table with these columns:
id (integer)name (string)age (integer)balance (float)is_admin (boolean: true/false)There can be many records (rows) in this table, each representing a single user. For example, here are three user rows:
| id | name | age | balance | is_admin |
|---|---|---|---|---|
| 1 | John Smith | 28 | 450 | 1 |
| 2 | Darren Walker | 27 | 200 | 1 |
| 3 | Jane Morris | 33 | 496.24 | 0 |
In the last lesson, we used the * wildcard to get all the columns. To select only a single column, we simply swap out the * for the name of the column.
Returns all columns from the users table:
SELECT * FROM users;
Returns only the name column from the users table:
SELECT name FROM users;
Update the query to only select the age column from the users table.