daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 15th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top