Tables disponibles
clients.id_client est la clé primaire ; commandes.id_client est la clé étrangère utilisée dans la condition ON.Table clients
| Colonne | Type | Rôle |
|---|---|---|
id_client | INTEGER | clé primaire |
nom | VARCHAR | nom fictif |
ville | VARCHAR | ville |
| nom | ville | id_client |
|---|---|---|
| Amira | Tunis | 1 |
| Youssef | Sfax | 2 |
Table commandes
| Colonne | Type | Rôle |
|---|---|---|
id_commande | INTEGER | clé primaire |
id_client | INTEGER | clé étrangère vers clients |
montant | DECIMAL | montant en DT |
| montant | id_client | id_commande |
|---|---|---|
| 134 | 1 | 101 |
| 89 | 2 | 102 |
| 45 | 1 | 103 |
Votre mission
Retournez le nom du client, l’identifiant de commande et son montant en reliant clients et commandes par id_client.
SELECT c.nom, co.id_commande, co.montant
FROM clients AS c
INNER JOIN commandes AS co
ON -- condition de jointure;Exécution SQL non activée. Résolvez la requête dans votre outil SQL puis comparez votre résultat. Aucun code n’est envoyé au serveur.
Résultat attendu
| nom | id_commande | montant |
|---|---|---|
| Amira | 101 | 134 |
| Youssef | 102 | 89 |
| Amira | 103 | 45 |