daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Dec 6th, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. URL: http://node-express-env.y3igtsmx6u.us-east-1.elasticbeanstalk.com/
  2.  
  3. Tables:
  4.  
  5. state(`Name`, `White`, `Black`, `Hispanic`, `Asian`, `AmericanIndian`, `PovertyPercent`, `MedianHouseholdIncome`, `HighSchoolGraduatePercent`, `BachelorPercent`, `AdvancedDegrPercent`, `Age1825`, `Age2564`, `Age65`). 
  6.  
  7. Show percentage of each demographic in each state (race, age, education level, income)
  8.  
  9. turnout_2012_gen(`State`, `PercentTurnout`, `BallotsCounted`, `VotingPopulation`). 
  10.  
  11. turnout_2016_gen(`State`, `PercentTurnout`, `BallotsCounted`, `VotingPopulation`). 
  12.  
  13. polls(`Date`, `State`, `Pollster`, `SampleSize`, `Clinton`, `Trump`)
  14.  
  15. MySQL Login info
  16. Hostname: election2016.cfkfg0dg7ypb.us-east-1.rds.amazonaws.com
  17. Port: 3306
  18. Username: root
  19. Password: password
  20.  
  21. Example Queries:
  22.  
  23. SELECT Date, Clinton, Trump FROM polls WHERE (Date = '10/6/2016' || Date = '10/10/2016') AND State = 'U.S.' GROUP BY Date ORDER BY polls.Date;
  24. SELECT Name FROM state WHERE White>=30 AND White<=40;
  25. SELECT Name FROM state WHERE MedianHouseholdIncome>=60000;
  26.  
  27. SELECT DISTINCT Date, State, AVG(Clinton), AVG(Trump)  FROM polls
  28. WHERE polls.State="Hawaii"
  29. GROUP BY Date
  30. ORDER BY polls.Date;
  31.  
  32. SELECT DISTINCT * FROM polls a
  33. WHERE NOT EXISTS
  34. (/*States that do not follow a certain demographic */
  35. SELECT    b.name FROM State b
  36. WHERE b.Black >= 40)
  37.  
  38. SELECT polls.Date FROM polls, states
  39. WHERE polls.Date LIKE '11/%' AND states.Name NOT IN
  40. (/*states than should not be included*/
  41. SELECT states.name FROM states, polls
  42. WHERE states.name = 'Hawaii' AND states.name <> polls.State
  43. )
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