Skip to content
Snippets Groups Projects
Commit ef246389 authored by SAEZ Theo's avatar SAEZ Theo
Browse files

Ajout de la VIEW NbPlacesLibresLiaisons -- FIN DU TP

parent 50428f14
Branches main
No related tags found
No related merge requests found
......@@ -45,7 +45,18 @@ GROUP BY l.NUMT, l.VILLED, l.VILLEA
/* Test de la vue */
SELECT * FROM NbPlacesOccupéesLiaisons;
---
/* Vue NbPlacesLibresLiaisons */
CREATE OR REPLACE VIEW NbPlacesLibresLiaisons AS
SELECT n.NUMT, n.VILLED, n.VILLEA, b.CAPACITÉB - n.PLACESOCCUPÉES AS PlacesLibres
FROM NbPlacesOccupéesLiaisons n
JOIN TRAJETS t ON t.NUMT = n.NUMT
JOIN BUS b ON b.NUMB = t.NUMB
;
/* Test de la vue */
SELECT * FROM NbPlacesLibresLiaisons;
COMMIT;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment