Assignment for March 12
SQLite: Download the following CSV files: members, positions and votes, then import them into a new sqlite database using the SQLite Manager for Firefox.
Then, using what we’ve learned about SQL Joins, write queries to answer the following:
- Show me how the members from California voted on the Captive Primate Safety Act.
- Which Democrat has voted the most often against the majority position of the party?
- How many times have at least 10 Republicans voted “Yes” on Approving the Journal
All three of these require joining at least two tables together; two require joining three tables. Remember the join syntax:
SELECT some_field, some_other_field FROM table1 JOIN table 2 ON (table1.field = table2.field) JOIN table3 on (table2.field = table3.field)
You can also join via the WHERE clause:
SELECT some_field, some_other_field FROM table1, table2, table3 WHERE table1.field=table2.field and table2.field = table3.field
Reading: Wichita Eagle on potholes.
About this entry
You’re currently reading “Assignment for March 12,” an entry on Computer-Assisted Reporting
- Published:
- March 6, 2009 / 5:41 pm
- Category:
- Assignments
- Tags:
No comments yet
Jump to comment form | comments rss [?] | trackback uri [?]