Skip to content

Instantly share code, notes, and snippets.

@Ernir
Created May 23, 2014 15:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Ernir/4ab19f6affbe687ad76e to your computer and use it in GitHub Desktop.
D&D 3.5 sorcerer/wizard spells by level
CREATE VIEW spell_names AS
SELECT name, min(level) as lvl
FROM dnd_spell
INNER JOIN dnd_spellclasslevel
ON dnd_spell.id = spell_id
WHERE dnd_spellclasslevel.character_class_id in (SELECT id FROM dnd_characterclass WHERE name ="Wizard" OR name = "Sorcerer")
GROUP BY name;
SELECT lvl, count(name)
FROM spell_names
GROUP BY lvl
ORDER BY lvl DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment