-
Count samurai per clan
Showclan.name,COUNT(*)of samurai; include only samurai with a clan. -
Average valor by role
Fromparticipation, group byrole, computeAVG(valor_points). -
List distinct weapon types available
UseDISTINCTonweapon.type. -
Samurai trained in Kyoto
Joinsamurai → dojo; filterdojo.city = 'kyoto'.
-
Top 3 most valorous entries overall
Returnsamurai.name,battle.name,valor_pointsordered desc withLIMIT 3. -
Average casualties per clan at Sekigahara
Joinparticipation → samurai → clan → battle;
filterbattle.name = 'battle of sekigahara';
group byclan.name; exclude NULL clans (WHEREorHAVING). -
Dojo style impact
For eachdojo.style, computeAVG(p.valor_points)across its samurai’s participations.
Requires join chain. Order by avg desc. -
Bow specialists
Find samurai whose highest mastery level is on aweapon.type = 'bow'.
Hint: compare each samurai’s max level across weapons and filter where the max occurs on a bow; use subquery.
-
Clan dominance by province
For eachbattle.province, return theclan.namewith the highest total casualties_caused in battles held in that province.
Hint: aggregate per province + clan, then pick the max per province via correlated subquery or window-function emulation. -
Consistent performers
List samurai who participated in at least 2 battles and have an average valor_points ≥ 75.
Showname,count of battles, andavg valor.
(UseGROUP BY … HAVING COUNT(*) >= 2.) -
Weapon breadth vs depth
For each samurai, show:namedistinct_weapons_masteredavg_mastery_level
Then filter to those withdistinct_weapons_mastered ≥ 2andavg_mastery_level ≥ 7.0.
-
Ronin effect
Compare averagevalor_pointsof ronin vs non-ronin across all participations.
Return two rows: group label and avg. -
Young commanders
Find commanders (role = 'commander') who were ≤ 35 years old at the time of the battle.
Usebattle.year - samurai.birth_year ≤ 35.
Returnsamurai.name,battle.name,age_at_battle.