Зміст курсу
Data Manipulation using SQL
Data Manipulation using SQL
Database
In this course, we'll work with multiple tables: songs, singers, and albums. They are connected to each other, and this is shown in the schema:
Each record in these tables has an id
, and these id
s are presented in other tables. For example, singer Britney Spears
has an id = 2
, so the song 'Sometimes' has a column singer_id
with value 2
in it.
It's much more comfortable to use id values instead of raw values to avoid mistakes and keep it consistent. You can see the content of each table below:
songs
albums
singers
We can see that NULL fields appeared. We may also notice that some albums and singers' records are not using in the songs table, but we still keep it.
Records' id
s have values starting with 1, but these values can be not integers, but strings, or fixed-bitness numbers (from 10000 to 99999, for example), etc. and some numbers can be missed.
Note that there are repeated names for columns in different tables (for example,
id
is present in all tables). To select some columns from a specific table, we have to refer to the column with the table's name: for example,songs.id
instead ofid
. It is more clear to specify the column name with a table name to understand what data we work with. But if the column's name is unique among all columns, we can refer column by its name only, and it will still be correct.
Завдання
Remember how to retrieve the data from the table: return all records from the songs
table.
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.
Дякуємо за ваш відгук!
Database
In this course, we'll work with multiple tables: songs, singers, and albums. They are connected to each other, and this is shown in the schema:
Each record in these tables has an id
, and these id
s are presented in other tables. For example, singer Britney Spears
has an id = 2
, so the song 'Sometimes' has a column singer_id
with value 2
in it.
It's much more comfortable to use id values instead of raw values to avoid mistakes and keep it consistent. You can see the content of each table below:
songs
albums
singers
We can see that NULL fields appeared. We may also notice that some albums and singers' records are not using in the songs table, but we still keep it.
Records' id
s have values starting with 1, but these values can be not integers, but strings, or fixed-bitness numbers (from 10000 to 99999, for example), etc. and some numbers can be missed.
Note that there are repeated names for columns in different tables (for example,
id
is present in all tables). To select some columns from a specific table, we have to refer to the column with the table's name: for example,songs.id
instead ofid
. It is more clear to specify the column name with a table name to understand what data we work with. But if the column's name is unique among all columns, we can refer column by its name only, and it will still be correct.
Завдання
Remember how to retrieve the data from the table: return all records from the songs
table.
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.
Дякуємо за ваш відгук!
Database
In this course, we'll work with multiple tables: songs, singers, and albums. They are connected to each other, and this is shown in the schema:
Each record in these tables has an id
, and these id
s are presented in other tables. For example, singer Britney Spears
has an id = 2
, so the song 'Sometimes' has a column singer_id
with value 2
in it.
It's much more comfortable to use id values instead of raw values to avoid mistakes and keep it consistent. You can see the content of each table below:
songs
albums
singers
We can see that NULL fields appeared. We may also notice that some albums and singers' records are not using in the songs table, but we still keep it.
Records' id
s have values starting with 1, but these values can be not integers, but strings, or fixed-bitness numbers (from 10000 to 99999, for example), etc. and some numbers can be missed.
Note that there are repeated names for columns in different tables (for example,
id
is present in all tables). To select some columns from a specific table, we have to refer to the column with the table's name: for example,songs.id
instead ofid
. It is more clear to specify the column name with a table name to understand what data we work with. But if the column's name is unique among all columns, we can refer column by its name only, and it will still be correct.
Завдання
Remember how to retrieve the data from the table: return all records from the songs
table.
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.
Дякуємо за ваш відгук!
In this course, we'll work with multiple tables: songs, singers, and albums. They are connected to each other, and this is shown in the schema:
Each record in these tables has an id
, and these id
s are presented in other tables. For example, singer Britney Spears
has an id = 2
, so the song 'Sometimes' has a column singer_id
with value 2
in it.
It's much more comfortable to use id values instead of raw values to avoid mistakes and keep it consistent. You can see the content of each table below:
songs
albums
singers
We can see that NULL fields appeared. We may also notice that some albums and singers' records are not using in the songs table, but we still keep it.
Records' id
s have values starting with 1, but these values can be not integers, but strings, or fixed-bitness numbers (from 10000 to 99999, for example), etc. and some numbers can be missed.
Note that there are repeated names for columns in different tables (for example,
id
is present in all tables). To select some columns from a specific table, we have to refer to the column with the table's name: for example,songs.id
instead ofid
. It is more clear to specify the column name with a table name to understand what data we work with. But if the column's name is unique among all columns, we can refer column by its name only, and it will still be correct.
Завдання
Remember how to retrieve the data from the table: return all records from the songs
table.
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.