Part 1
1

Exemple du chapitre Trier les données : Example SQL n°1

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.De quelle table provient les données affichées ?

R : De la table Livres.

2.Comparez la table Livres dans la base de données et la table du résultat obtenu. Que constatez vous ?

R : Les livres ne sont pas classés dans le même ordre.

3.Dans quel ordre les prix ont ils été triés ?

R : Du plus petit au plus grand. Donc dans l'ordre croissant.
Validated example

SELECT * 
FROM Livres 
ORDER BY prix;
Table Auteurs (auid, nom)
Primary key : auid

Table Editeurs (edid, nom, adresse)
Primary key : edid

Table Livres (isbn, titre, prix, edid, date_edition)
Primary key : isbn
Foreign key : edid of the table Editeurs
Table Livres_auteurs (auid, isbn)
Foreign key : isbn of the table Livres, auid of the table Auteurs
Table stock (id, isbn, id_librairie, nbre_exemplaire)
Primary key : id
Foreign key : isbn of the table Livres

Request 1
isbn
titre
prix
edid
date_edition
0x0
Journal Interne
3
3
2016-04-03
215
Hypérion
7
1
2016-02-01
214
La chute d'Hypérion
7
1
2016-01-03
548
Les misérables
7
2
2016-02-11
547
Notre dame de Paris
7
2
2016-04-04
856
Les noms propres
43
3
2016-05-04
855
Dictionnaire
44
3
2016-05-05
744
JavaScript 1.3
55
1
2016-03-02