Part 1
1

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

Exemple du thème sur les jointures : Example SQL n°3

The questions should help you understand the code shown below.
Once you hold the solution, you can view the answer by clicking on the question title.

1.Que signifie le message d'erreur ?

R : Le champ CodeFilm est ambigu. En français ambigu signifie "dont le sens est incertain".

2.Dans l'instruction SELECT, de quelles tables peut provenir le champ codefilm ?

R : De la table FILMS ou de la table LOCATION. Comme le champ peut provenir de deux tables, le serveur SQL dit qu'il est ambigu.

3.Comment a-t-on levé l'ambigüité sur le champ CodeFilm dans l'instruction ON ?

R : Le nom de la table de provenance du champ CodeFilm est précisé sous la forme TABLE.champs

4.Rédigez l'instruction SELECT pour lever l'ambigüité du champ CodeFilm.

R : SELECT Films.codefilm, nomfilm, duree
Validated example
SELECT codefilm, nomfilm, duree 
FROM Films 
INNER JOIN Locations
    ON Films.codefilm=Locations.codefilm;
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

A syntax or coherence error has been revealed.
ambiguous column name: codefilm
3 / 6
Exemple du thème sur les jointures