Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Database | Database and Nested Queries
Data Manipulation using SQL
course content

Course Content

Data Manipulation using SQL

Data Manipulation using SQL

1. Database and Nested Queries
2. SQL Joining Tables
3. SQL Tasks

bookDatabase

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 ids 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' ids 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 of id. 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.

Task

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.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 1
toggle bottom row

bookDatabase

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 ids 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' ids 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 of id. 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.

Task

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.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 1
toggle bottom row

bookDatabase

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 ids 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' ids 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 of id. 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.

Task

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.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

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 ids 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' ids 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 of id. 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.

Task

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.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 1
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt