Guest User

Untitled

a guest
Jan 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. SELECT
  2. COUNT(events.event_id) AS total_events,
  3. COUNT(matches.fight_id) AS total_matches,
  4. COUNT(players.fighter_id) AS total_players,
  5. COUNT(DISTINCT events.organization) AS total_organizations,
  6. COUNT(DISTINCT players.country) AS total_countries
  7. FROM
  8. events, matches, players
  9.  
  10. SELECT
  11. COUNT(events.event_id) AS total_events,
  12. COUNT(DISTINCT events.organization) AS total_organizations
  13. FROM
  14. events;
  15.  
  16. SELECT
  17. COUNT(matches.fight_id) AS total_matches
  18. FROM
  19. matches;
  20.  
  21. SELECT
  22. COUNT(players.fighter_id) AS total_players,
  23. COUNT(DISTINCT players.country) AS total_countries
  24. FROM
  25. players;
  26.  
  27. CREATE INDEX "events_organization" ON events (organization);
  28. CREATE INDEX "players_country" ON events (country);
Add Comment
Please, Sign In to add comment