Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
SQL Joins | SQL Joining Tables
Data Manipulation using SQL
course content

Зміст курсу

Data Manipulation using SQL

Data Manipulation using SQL

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

bookSQL Joins

There are four main types of joining: Inner, Full, Left, and Right. The difference is based on which records are autocompleted with NULL if there are no matching in left or right tables.

On this example, we can see, that for INNER joining takes place only for that id's that are present in both joining columns, or for their intersection. For FULL, it makes joining for all ids that are present, or for their union. LEFT and RIGHT join does the joining for ids in the left or right table.

We can see more on the diagram:

Usually, we use INNER or LEFT join, but it depends on the situation.

Завдання

Try to join 3 tables. Select all songs and their albums and singers: join singers and songs on singer_id and songs and albums on album_id. Order albums lexicographically (column title of albums).

Use aliases for column names: song for songs.title, album for albums.title, and singer for singers.naming.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2
toggle bottom row

bookSQL Joins

There are four main types of joining: Inner, Full, Left, and Right. The difference is based on which records are autocompleted with NULL if there are no matching in left or right tables.

On this example, we can see, that for INNER joining takes place only for that id's that are present in both joining columns, or for their intersection. For FULL, it makes joining for all ids that are present, or for their union. LEFT and RIGHT join does the joining for ids in the left or right table.

We can see more on the diagram:

Usually, we use INNER or LEFT join, but it depends on the situation.

Завдання

Try to join 3 tables. Select all songs and their albums and singers: join singers and songs on singer_id and songs and albums on album_id. Order albums lexicographically (column title of albums).

Use aliases for column names: song for songs.title, album for albums.title, and singer for singers.naming.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2
toggle bottom row

bookSQL Joins

There are four main types of joining: Inner, Full, Left, and Right. The difference is based on which records are autocompleted with NULL if there are no matching in left or right tables.

On this example, we can see, that for INNER joining takes place only for that id's that are present in both joining columns, or for their intersection. For FULL, it makes joining for all ids that are present, or for their union. LEFT and RIGHT join does the joining for ids in the left or right table.

We can see more on the diagram:

Usually, we use INNER or LEFT join, but it depends on the situation.

Завдання

Try to join 3 tables. Select all songs and their albums and singers: join singers and songs on singer_id and songs and albums on album_id. Order albums lexicographically (column title of albums).

Use aliases for column names: song for songs.title, album for albums.title, and singer for singers.naming.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

There are four main types of joining: Inner, Full, Left, and Right. The difference is based on which records are autocompleted with NULL if there are no matching in left or right tables.

On this example, we can see, that for INNER joining takes place only for that id's that are present in both joining columns, or for their intersection. For FULL, it makes joining for all ids that are present, or for their union. LEFT and RIGHT join does the joining for ids in the left or right table.

We can see more on the diagram:

Usually, we use INNER or LEFT join, but it depends on the situation.

Завдання

Try to join 3 tables. Select all songs and their albums and singers: join singers and songs on singer_id and songs and albums on album_id. Order albums lexicographically (column title of albums).

Use aliases for column names: song for songs.title, album for albums.title, and singer for singers.naming.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 2
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
some-alt