{"database": "h3_units", "private": false, "path": "/h3_units", "size": 4497408, "tables": [{"name": "artifacts", "columns": ["icon", "name", "slot", "rarity", "gold", "effect", "combo", "expansion"], "primary_keys": [], "count": 156, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "battles_1v1", "columns": ["seed", "left_name", "left_count", "right_name", "right_count", "winner", "rounds", "winner_survivors"], "primary_keys": [], "count": 72, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "battles_army", "columns": ["seed", "left_army", "right_army", "rounds"], "primary_keys": [], "count": 72, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "heroes", "columns": ["icon", "name", "class", "town", "specialty", "skill_1", "skill_2", "spell"], "primary_keys": [], "count": 200, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "resources", "columns": ["icon", "name", "category"], "primary_keys": [], "count": 7, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "skills", "columns": ["icon", "name", "basic", "advanced", "expert"], "primary_keys": [], "count": 30, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "towns", "columns": ["icon", "town", "expansion", "alignment", "native_terrain", "special_resource", "mage_guild_level", "might_class", "magic_class", "description"], "primary_keys": [], "count": 12, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "units", "columns": ["portrait", "name", "town", "level", "attack", "defense", "min_dmg", "max_dmg", "hp", "speed", "growth", "ai_value", "gold", "resource", "special", "icon"], "primary_keys": [], "count": 190, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}], "hidden_count": 0, "views": [], "queries": [{"title": "Heroes by town", "description": "How many heroes each faction has.", "sql": "SELECT town, COUNT(*) as heroes FROM heroes GROUP BY town ORDER BY heroes DESC", "name": "heroes_by_town", "private": false}, {"title": "Heroes with starting spells", "description": "Heroes that start with a spell in their spell book.", "sql": "SELECT icon, name, class, town, specialty, spell FROM heroes WHERE spell != '' ORDER BY town, name", "name": "heroes_with_spells", "private": false}, {"title": "Heroes grouped by class", "description": "All heroes grouped by their class.", "sql": "SELECT class, town, COUNT(*) as n FROM heroes GROUP BY class, town ORDER BY town, class", "name": "heroes_by_class", "private": false}, {"title": "Artifacts by slot", "description": "How many artifacts fit each equipment slot.", "sql": "SELECT slot, COUNT(*) as n FROM artifacts GROUP BY slot ORDER BY n DESC", "name": "artifacts_by_slot", "private": false}, {"title": "Artifacts by rarity", "description": "Artifact counts by treasure class.", "sql": "SELECT rarity, COUNT(*) as n FROM artifacts GROUP BY rarity ORDER BY n DESC", "name": "artifacts_by_rarity", "private": false}, {"title": "Combined (combo) artifacts", "description": "Artifacts that are assembled from multiple component artifacts.", "sql": "SELECT icon, name, slot, rarity, effect, combo FROM artifacts WHERE slot = 'Combo' ORDER BY name", "name": "combo_artifacts", "private": false}, {"title": "Relic-class artifacts", "description": "The most powerful (Relic) artifacts in the game.", "sql": "SELECT icon, name, slot, gold, effect, combo, expansion FROM artifacts WHERE rarity = 'Relic' ORDER BY name", "name": "relic_artifacts", "private": false}, {"title": "All secondary skills", "description": "Complete list of secondary skills with level descriptions.", "sql": "SELECT icon, name, basic, advanced, expert FROM skills ORDER BY name", "name": "all_skills", "private": false}, {"title": "All towns", "description": "Every faction with its portrait, alignment, terrain, and hero classes.", "sql": "SELECT icon, town, expansion, alignment, native_terrain, special_resource, mage_guild_level, might_class, magic_class, description FROM towns ORDER BY town", "name": "all_towns", "private": false}, {"title": "Towns by alignment", "description": "Towns grouped by moral alignment, with their might and magic hero classes.", "sql": "SELECT icon, town, alignment, might_class, magic_class FROM towns ORDER BY alignment, town", "name": "towns_by_alignment", "private": false}, {"title": "1-v-1 win rates by creature", "description": "How often each creature wins its 1-v-1 duels.", "sql": "SELECT name, SUM(wins) AS wins, SUM(battles) AS battles, ROUND(SUM(wins) * 100.0 / SUM(battles), 1) AS win_pct FROM (SELECT left_name AS name, SUM(CASE WHEN winner = 'left' THEN 1 ELSE 0 END) AS wins, COUNT(*) AS battles FROM battles_1v1 GROUP BY left_name UNION ALL SELECT right_name, SUM(CASE WHEN winner = 'right' THEN 1 ELSE 0 END), COUNT(*) FROM battles_1v1 GROUP BY right_name) GROUP BY name ORDER BY win_pct DESC", "name": "1v1_winrates", "private": false}, {"title": "1-v-1 upset victories", "description": "Battles where the side with fewer creatures still won.", "sql": "SELECT seed, left_name, left_count, right_name, right_count, winner, rounds, winner_survivors FROM battles_1v1 WHERE (winner = 'left' AND left_count < right_count) OR (winner = 'right' AND right_count < left_count) ORDER BY rounds DESC", "name": "1v1_upsets", "private": false}, {"title": "Longest full-army battles", "description": "Army battles that took the most combat rounds.", "sql": "SELECT seed, rounds, left_army, right_army FROM battles_army ORDER BY rounds DESC LIMIT 20", "name": "army_longest_battles", "private": false}, {"title": "Army battle survivor totals", "description": "Total creatures surviving on the winning side after each army battle.", "sql": "SELECT seed, rounds, (SELECT SUM(json_extract(value, '$.survivors')) FROM json_each(left_army)) AS left_survivors, (SELECT SUM(json_extract(value, '$.survivors')) FROM json_each(right_army)) AS right_survivors FROM battles_army ORDER BY rounds DESC", "name": "army_survivors", "private": false}], "allow_execute_sql": true, "query_ms": 9.595721960067749}