1.a
SELECT TITRE 
FROM DISQUE
WHERE PRIX_ACHAT < 11;

1.b
SELECT TITRE 
FROM DISQUE
WHERE PRIX_ACHAT < 11
ORDER BY PRIX_ACHAT ASC;

1.c
SELECT TITRE 
FROM DISQUE
WHERE PRIX_ACHAT >= 11 AND PRIX_ACHAT <= 12;

1.d
SELECT TITRE 
FROM DISQUE
WHERE ANNEE = 1999;

1.e
SELECT TITRE 
FROM DISQUE
WHERE ANNEE >= 1990 AND ANNEE < 2000;

1.f
SELECT TITRE 
FROM DISQUE
WHERE ANNEE >= 1990 AND ANNEE < 2000
ORDER BY ANNEE DESC, PRIX_ACHAT ASC;

1.g
SELECT TITRE 
FROM DISQUE
WHERE ANNEE >= 1990 AND ANNEE < 2000
  AND PRIX_ACHAT >= 11 AND RPIX_ACHAT <= 13;

1.h
SELECT TITRE 
FROM DISQUE
WHERE ETAT = 'Endommagé';

1.i
SELECT TITRE 
FROM DISQUE
WHERE ETAT = 'Endommagé'
ORDER BY PRIX_ACHAT DESC;

1.j
SELECT TITRE 
FROM DISQUE
WHERE ETAT = 'Endommagé'
ORDER BY ANNEE ASC;

1.k
SELECT TITRE 
FROM DISQUE
WHERE ETAT = 'Endommagé'
  AND ANNEE = 1998
  AND PRIX_ACHAT < 13;

1.l
SELECT TITRE 
FROM DISQUE
WHERE NOT ETAT = 'Neuf';

2.a
SELECT COUNT(*)
FROM DISQUE;

2.b
SELECT COUNT(*)
FROM DISQUE
WHERE ETAT = 'Endommagé';

2.c
SELECT COUNT(*)
FROM CHANSON;

2.d 
SELECT COUNT(*)
FROM ARTISTE;

2.e
SELECT SUM(PRIX_ACHAT)
FROM DISQUE;

2.f
SELECT SUM(PRIX_ACHAT)
FROM DISQUE
WHERE ETAT = 'Détruit';

2.g
SELECT AVG(ANNEE)
FROM DISQUE
WHERE ETAT = 'Neuf';

2.h
SELECT AVG(ANNEE)
FROM DISQUE;

2.i
SELECT MAX(PRIX_ACHAT), MIN(PRIX_ACHAT)
FROM DISQUE;

2.j
SELECT MAX(PRIX_ACHAT), MIN(PRIX_ACHAT), AVG(PRIX_ACHAT)
FROM DISQUE;

3.a
SELECT CHANSON.TITRE, GENRE.NOM
FROM CHANSON, GENRE
WHERE CHANSON.ID_GENRE = GENRE.ID;

-- SELECT TITRE, NOM
-- FROM CHANSON, GENRE
-- WHERE ID_GENRE = GENRE.ID

3.b
SELECT CHANSON.TITRE, GENRE.NOM
FROM CHANSON, GENRE
WHERE CHANSON.ID_GENRE = GENRE.ID;
  AND GENRE.NOM = 'Blues';

3.c
SELECT CHANSON.TITRE, GENRE.NOM
FROM CHANSON, GENRE
WHERE CHANSON.ID_GENRE = GENRE.ID;
  AND (GENRE.NOM = 'New Age' OR GENRE.NOM = 'Jazz');

3.d
SELECT CHANSON.TITRE
FROM ARTISTE, CHANSON, INTERPRETE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
  AND CHANSON.ID = INTERPRETE.ID_CHANSON
  AND ARTISTE.NOM = 'Gothic Slam';

3.e
SELECT DISQUE.TITRE
FROM ARTISTE, DISQUE, INTERPRETE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
  AND DISQUE.ID = INTERPRETE.ID_DISQUE
  AND ARTISTE.NOM = 'Le Tigre';

3.f
SELECT DISQUE.TITRE
FROM ARTISTE, DISQUE, INTERPRETE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
  AND DISQUE.ID = INTERPRETE.ID_DISQUE
  AND ARTISTE.NOM = 'Le Tigre';
ORDER BY DISQUE.TITRE ASC;

3.g
SELECT DISTINCT ARTISTE.NOM
FROM ARTISTE, INTERPRETE, DISQUE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
  AND DISQUE.ID = INTERPRETE.ID_DISQUE
  AND DISQUE.TITRE = 'Il faut tourner l''apache'

3.h
SELECT DISQUE.NOM
FROM DISQUE, INTERPRETE, CHANSON
WHERE CHANSON.ID = INTERPRETE.ID_CHANSON
  AND DISQUE.ID = INTERPRETE.ID_DISQUE
  AND CHANSON.TITRE = '(I can''t get no) Satisfaction'

3.i
SELECT DISTINCT ARTISTE.NOM, GENRE.NOM
FROM ARTISTE, INTERPRETE, CHANSON, GENRE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
  AND INTERPRETE.ID_CHANSON = CHANSON.ID
  AND CHANSON.ID_GENRE = GENRE.ID
ORDER BY ARTISTE.NOM ASC, GENRE.NOM ASC

4.c
SELECT GENRE.NOM, COUNT(*)
FROM GENRE, CHANSON
WHERE GENRE.ID = CHANSON.ID_GENRE
GROUP BY GENRE.NOM

4.d
SELECT DISQUE.TITRE, COUNT(*) AS NOMBRE_CHANSONS
FROM DISQUE, INTERPRETE
WHERE DISQUE.ID = INTERPRETE.ID_DISQUE
GROUP BY DISQUE.TITRE
ORDER BY NOMBRE_CHANSONS DESC

4.e
SELECT ARTISTE.NOM, COUNT(*) AS NOMBRE_CHANSONS
FROM ARTISTE, INTERPRETE
WHERE ARTISTE.ID = INTERPRETE.ID_ARTISTE
GROUP BY ARTISTE.NOM
ORDER BY NOMBRE_CHANSONS DESC
LIMIT 10 OFFSET 10;

4.f
SELECT GENRE.NOM, SUM(DISQUE.PRIX_ACHAT) AS PRIX_TOTAL
FROM GENRE, CHANSON, INTERPRETE, DISQUE
WHERE GENRE.ID = CHANSON.ID_GENRE
  AND CHANSON.ID = INTERPRETE.ID_CHANSON
  AND INTERPRETE.ID_DISQUE = DISQUE.ID
GROUP BY GENRE.NOM
ORDER BY PRIX_TOTAL DESC


