Add more fun queries

This commit is contained in:
gg 2023-07-19 19:40:30 -07:00
parent d41ef65a7d
commit 8d12ba2049
1 changed files with 21 additions and 1 deletions

View File

@ -19,7 +19,27 @@ SELECT seg.n AS title,
JOIN segment seg ON seg.id = s.segment_id
JOIN caster c ON c.id = s.caster_id
WHERE c.n = "&caster"
ORDER BY n;
GROUP BY title
ORDER BY n DESC;
-- segment distribution for caster using prejoined view
SELECT title,
COUNT(title) AS appearances
FROM schedule_joined
WHERE caster = "&caster"
GROUP BY title
ORDER BY n DESC;
-- appearances by caster
SELECT caster,
COUNT(caster) AS appearances
FROM schedule_joined
WHERE caster IS NOT NULL
GROUP BY caster
ORDER BY appearances DESC, caster ASC;
-- list of all known casters
SELECT * FROM caster;
-- list of all segments
SELECT * FROM segment;