Practice: Lists for the Manager
Time to put what you've learned together. The shop's manager needs a few lists, and you know everything it takes to make them: SELECT with the columns you want, FROM with the table, and a semicolon at the end of each query.
Before you write a query, find the columns in the Tables tab. Which table has the data you need, and what are its columns called? That's always the first question, and in a larger database, it's often the hardest one.
And remember that the result of a query is a table too: it has columns and rows, just like the tables of the database. That will be important later, when you'll use the result of one query in another one.
Instructions
The manager wants to know which games are out and which aren't yet. Show the title and the release date of every game:
| title | released |
|---|---|
| Dragon Forge | 2024-03-14 |
| Pixel Racer | 2023-07-02 |
| … | … |
For the newsletter, show the name and the email of every customer.
| name | |
|---|---|
| Emma Clark | emma.clark@mail.com |
| Liam Turner | liam.t@mail.com |
| … | … |
And for the accounts, show the ID of the order, the ID of the game, and the price of every item of every order.
| order_id | game_id | price |
|---|---|---|
| 1 | 3 | 20 |
| 1 | 6 | 5 |
| … | … | … |
Start programming for free
7/7