SELECT Queries
In the last lecture, we already covered what the basic syntax of SQL looks like, and wrote a SELECT query already but now it is time to practice.
Recap: To retrieve data from an SQL database we need to write SELECT statements
Let's suppose we have the following table with movies:
Exercises
- Find the title of each film
SELECT title FROM movies;
- Find the director of each film
SELECT director FROM movies;
- Find the title and director of each film
SELECT title, director FROM movies;
- Find the title and year of each film
SELECT title, year FROM movies;
- Find all the information about each film
SELECT * FROM movies;
It's not that hard to filter data by columns, right?
Maybe you don't remember, the asterisk ( * ) means "all". So through the last statement, we'll retrieve exactly the same table as shown in the upper picture.
To make visualization easier, here is the returned table of the "SELECT title, director FROM movies; " query.
See? Only the relevant columns remained.
This is the material I planned for the second lesson, we are advancing in baby steps but maybe this way the material is easier to understand.
About the course
In this course I will and comment sqlbolt's tutorial and do their exercises together with you, sharing the results.
If you would like to fasten up the material or just simply practice by yourself check out their site.
Another suggestion of mine would be to have a look at Sololearn's SQL lessons. This site is also free and you can get a quite solid basic knowledge by completing their material.
Thank you for reading my article!
Follow Upvote Resteem @goodguymate

Steem Gaming Community

OP Gaming
<I suggest Partiko if you are browsing from Android/iOS and would like to earn extra $>