goodguymate avatar

SQL course [Lesson 2] - SELECT Queries

goodguymate

Published: 29 Apr 2019 › Updated: 29 Apr 2019SQL course [Lesson 2] - SELECT Queries

SQL course [Lesson 2] - SELECT Queries

image.png

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:
aaa.jpg.png

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.

asda.png

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

ya6cczq3qa.png
OP Gaming

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


Header picture source | Content source

Leave SQL course [Lesson 2] - SELECT Queries to:

Written by

Gamer | Programmer | Homo sapiens sapiens

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