SQL course [Lesson 2] - SELECT Queries
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
<I suggest Partiko if you are browsing from Android/iOS and would like to earn extra $>
Leave SQL course [Lesson 2] - SELECT Queries to:
Read more #technology posts
Best Posts From goodguymate
We have not curated any of goodguymate's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From goodguymate
- First run of 2022
- Spring is on the corner
- Wonderful Hiking - Hit 20k step yesterday
- NBA Top Shot "Seeing Stars" packs drop today at 10PM PST !!!
- My Actifit Report Card: March 4 2021
- Slowly getting more into crypto - My Actifit Report Card: March 3 2021
- My Actifit Report Card: March 1 2021
- Belated Stonesplitter Orc Challenge - From a Total Beginner's Point of View
- Still recovering from my last bigger run
- Valorant goes live TODAY!
- I had my first 15km run yesterday
- Running in the forest - My Actifit Report Card: May 18 2020
- I bought some magical-internet-cash-cats! CryptoKitties - First Impressions
- Posting from actifit.io would be a much appreciated feature
- My Actifit Report Card: May 12 2020
- Thank You For Your Support! - My Actifit Report Card: May 11 2020
- Saving a hedgehog - My Actifit Report Card: May 10 2020
- [VALORANT] - First Impressions Review
- My Actifit Report Card: May 8 2020
- Easy run with girlfriend and doggo - My Actifit Report Card: May 6 2020