Contenido del Curso
SQL Tutorial for Beginners
SQL Tutorial for Beginners
Select the Songs!
Database
Of course, we will work with some database, and it will be Music Database. Below you can see a single table songs
with records in it:
It contains info:
id
- the unique id for the record
title
- the name of the song
singer
- song's band or singer
album
- song's album
price
- the price of this record
year
- the year of the release.
In this course, we will work only with the songs
table, so explore and remember which columns it contains. In the advanced course, we'll extend the database with more tables and connections between them.
Each table has a unique name. Each column has a unique name inside the table, but columns from different tables can have the same namings.
Let's start with the very first command SELECT. This simple command lets you retrieve some data from table.
SELECT * FROM songs
Here * means all records with all fields, and songs
is the table we extract the records from. As a result, you'll get all data stored in songs
.
Remember that your code can contain only one SELECT statement.
Tarea
Retrieve all data from the table songs
.
SQL is not case-sensitive, so you can write
select
orSelect
. Same about other commands, table and column names. Records inside the tables are case-sensitive: you cannot writeabba
orAbba
forABBA
value. We'll use the upper-case notation for a better demonstration.
During the course, you'll complete a lot of tasks, and for some attempts to send a query you may receive the <span style='color:red'>Internal Server Error</span> as an output. Most likely, it means that the result of your query is empty (there is no matching record, or the database is empty, for example). Try to change the query so the result is non-empty, and send it again.
¡Gracias por tus comentarios!
Select the Songs!
Database
Of course, we will work with some database, and it will be Music Database. Below you can see a single table songs
with records in it:
It contains info:
id
- the unique id for the record
title
- the name of the song
singer
- song's band or singer
album
- song's album
price
- the price of this record
year
- the year of the release.
In this course, we will work only with the songs
table, so explore and remember which columns it contains. In the advanced course, we'll extend the database with more tables and connections between them.
Each table has a unique name. Each column has a unique name inside the table, but columns from different tables can have the same namings.
Let's start with the very first command SELECT. This simple command lets you retrieve some data from table.
SELECT * FROM songs
Here * means all records with all fields, and songs
is the table we extract the records from. As a result, you'll get all data stored in songs
.
Remember that your code can contain only one SELECT statement.
Tarea
Retrieve all data from the table songs
.
SQL is not case-sensitive, so you can write
select
orSelect
. Same about other commands, table and column names. Records inside the tables are case-sensitive: you cannot writeabba
orAbba
forABBA
value. We'll use the upper-case notation for a better demonstration.
During the course, you'll complete a lot of tasks, and for some attempts to send a query you may receive the <span style='color:red'>Internal Server Error</span> as an output. Most likely, it means that the result of your query is empty (there is no matching record, or the database is empty, for example). Try to change the query so the result is non-empty, and send it again.
¡Gracias por tus comentarios!
Select the Songs!
Database
Of course, we will work with some database, and it will be Music Database. Below you can see a single table songs
with records in it:
It contains info:
id
- the unique id for the record
title
- the name of the song
singer
- song's band or singer
album
- song's album
price
- the price of this record
year
- the year of the release.
In this course, we will work only with the songs
table, so explore and remember which columns it contains. In the advanced course, we'll extend the database with more tables and connections between them.
Each table has a unique name. Each column has a unique name inside the table, but columns from different tables can have the same namings.
Let's start with the very first command SELECT. This simple command lets you retrieve some data from table.
SELECT * FROM songs
Here * means all records with all fields, and songs
is the table we extract the records from. As a result, you'll get all data stored in songs
.
Remember that your code can contain only one SELECT statement.
Tarea
Retrieve all data from the table songs
.
SQL is not case-sensitive, so you can write
select
orSelect
. Same about other commands, table and column names. Records inside the tables are case-sensitive: you cannot writeabba
orAbba
forABBA
value. We'll use the upper-case notation for a better demonstration.
During the course, you'll complete a lot of tasks, and for some attempts to send a query you may receive the <span style='color:red'>Internal Server Error</span> as an output. Most likely, it means that the result of your query is empty (there is no matching record, or the database is empty, for example). Try to change the query so the result is non-empty, and send it again.
¡Gracias por tus comentarios!
Database
Of course, we will work with some database, and it will be Music Database. Below you can see a single table songs
with records in it:
It contains info:
id
- the unique id for the record
title
- the name of the song
singer
- song's band or singer
album
- song's album
price
- the price of this record
year
- the year of the release.
In this course, we will work only with the songs
table, so explore and remember which columns it contains. In the advanced course, we'll extend the database with more tables and connections between them.
Each table has a unique name. Each column has a unique name inside the table, but columns from different tables can have the same namings.
Let's start with the very first command SELECT. This simple command lets you retrieve some data from table.
SELECT * FROM songs
Here * means all records with all fields, and songs
is the table we extract the records from. As a result, you'll get all data stored in songs
.
Remember that your code can contain only one SELECT statement.
Tarea
Retrieve all data from the table songs
.
SQL is not case-sensitive, so you can write
select
orSelect
. Same about other commands, table and column names. Records inside the tables are case-sensitive: you cannot writeabba
orAbba
forABBA
value. We'll use the upper-case notation for a better demonstration.
During the course, you'll complete a lot of tasks, and for some attempts to send a query you may receive the <span style='color:red'>Internal Server Error</span> as an output. Most likely, it means that the result of your query is empty (there is no matching record, or the database is empty, for example). Try to change the query so the result is non-empty, and send it again.