Part 1
1

Chapter 3 :
Les jointures : afficher des colonnes depuis plusieurs tables

Exercice sur les jointures : Exercice SQL n°3

The goal of the exercise is to apply what you have learned using the examples.

Statement

Afficher les numéros et les villes des clients en indiquant pour ceux qui ont loué des films, le numéro du film emprunté. Le résultat sera affiché dans l'ordre alphabétique des villes.

  • Show relational schema Download tables (PDF)
  • Table Clients (codecli, prenomcli, nomcli, ruecli, cpcli, villecli)
    Primary key : codecli

    Table Films (codefilm, nomfilm)
    Primary key : codefilm

    Table Locations (codecli, codefilm, datedebut, duree)
    Primary key : codecli, codefilm
    Foreign key : codefilm of the table Films, codecli of the table Clients
Enter your response
Result to obtain
Request 1
codecli
villecli
codefilm
4
Forbach
1
4
Forbach
6
6
Forbach
8
7
Forbach
7
7
Forbach
9
10
Forbach
5
Freyming
2
11
Freyming
1
Saint-Avold
2
1
Saint-Avold
4
1
Saint-Avold
5
2
Saint-Avold
1
3
Saint-Avold
2
8
Saint-Avold
9
Saint-Avold
3 / 5
Exercice sur les jointures