Changes between Version 1 and Version 2 of AdminManagesGenres
- Timestamp:
- 08/24/26 16:03:09 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdminManagesGenres
v1 v2 8 8 **2.** The system displays all existing genres and their usage counts. 9 9 {{{#!sql 10 SELECT g.genre_id, g. name, COUNT(hg.story_id) AS stories_using_genre10 SELECT g.genre_id, g.genre_name, COUNT(hg.story_id) AS stories_using_genre 11 11 FROM GENRE g 12 12 LEFT JOIN HAS_GENRE hg ON g.genre_id = hg.genre_id 13 13 GROUP BY g.genre_id 14 ORDER BY g. name ASC;14 ORDER BY g.genre_name ASC; 15 15 }}} 16 16 … … 20 20 {{{#!sql 21 21 SELECT * FROM GENRE 22 WHERE LOWER( name) = LOWER('Science Fiction');22 WHERE LOWER(genre_name) = LOWER('Science Fiction'); 23 23 }}} 24 24 25 25 **5.** The genre does not exist, so the system inserts it. 26 26 {{{#!sql 27 INSERT INTO GENRE ( name)27 INSERT INTO GENRE (genre_name) 28 28 VALUES ('Science Fiction'); 29 29 }}}
