-
Notifications
You must be signed in to change notification settings - Fork 9
/
queries.txt
248 lines (99 loc) · 19.6 KB
/
queries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
SELECT T2.contributor_name, T2.recipient_name, SUM(T2.amount)/Total.total_by_PAC FROM (SELECT T1.fec_committee_id, SUM(T1.amount) AS total_by_PAC FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' GROUP BY T1.fec_committee_id LIMIT 100) AS Total, fec_committee_contributions T2 WHERE T2.transaction_type = '24K' AND T2.entity_type = 'PAC' GROUP BY T2.fec_committee_id, T2.other_id LIMIT 100;
SELECT T2.contributor_name, T2.recipient_name, SUM(T2.amount), Total.total_by_PAC, SUM(T2.amount)/Total.total_by_PAC FROM (SELECT T1.fec_committee_id, SUM(T1.amount) AS total_by_PAC FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' GROUP BY T1.fec_committee_id LIMIT 100) AS Total, fec_committee_contributions T2 WHERE T2.transaction_type = '24K' AND T2.entity_type = 'PAC' GROUP BY T2.fec_committee_id, T2.other_id LIMIT 100;
SELECT T1.contributor_name, SUM(T1.amount) AS total_by_PAC FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' GROUP BY T1.fec_committee_id LIMIT 100;
SELECT T1.fec_committee_id, T1.contributor_name, T2.other_id, T2.recipient_name, T2.amount/T1.total_by_PAC AS exclusivity_score, T2.report_type FROM (SELECT T.fec_committee_id, T.contributor_name, SUM(T.amount) AS total_by_PAC FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' GROUP BY T.fec_committee_id LIMIT 100) AS T1, fec_committee_contributions T2 WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' GROUP BY T1.fec_committee_id, T2.other_id LIMIT 100;
SELECT T1.fec_committee_id, T1.contributor_name, T1.total_by_PAC, T2.other_id, T2.recipient_name, T2.amount, T2.amount/T1.total_by_PAC AS exclusivity_score
FROM (
SELECT T.fec_committee_id, T.contributor_name, SUM(T.amount) AS total_by_PAC
FROM fec_committee_contributions T
WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC'
GROUP BY T.fec_committee_id LIMIT 1000
) AS T1, fec_committee_contributions T2
WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC'
GROUP BY T1.fec_committee_id, T2.other_id LIMIT 100;
--------------
# Query to find maximum amount donated by each PAC. Might want to incorporate transaction_type and break down by race :)
SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, MAX(T1.amount) AS max_amount FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' GROUP BY T1.fec_committee_id LIMIT 100;
# Query to find maximum amount donated above $5,000:
SELECT * FROM (SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, T1.date, MAX(T1.amount) AS max_amount FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' AND T1.fec_committee_id NOT IN (SELECT filer_id FROM super_PACs_list) AND T1.other_id NOT IN (SELECT filer_id FROM super_PACs_list) GROUP BY T1.fec_committee_id LIMIT 1000) T WHERE T.max_amount > '5000' ORDER BY T.max_amount DESC;
# get all donations above $5,000
SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, T1.date, T1.amount FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' AND T1.fec_committee_id NOT IN (SELECT filer_id FROM super_PACs_list) AND T1.other_id NOT IN (SELECT filer_id FROM super_PACs_list) AND T1.amount > '5000' ORDER BY T1.amount DESC;
#Query to find PACs whose donations went all to a single candidate:
#Strategy: find all pairs with exclusivity_score = 1
SELECT T1.fec_committee_id, T1.contributor_name, T1.amount FROM exclusivity_scores T1 WHERE T1.exclusivity_score = '1';
SELECT * FROM (SELECT T1.fec_committee_id, T1.contributor_name, T1.total_by_PAC, T2.other_id, T2.recipient_name, T2.amount, T2.amount/T1.total_by_PAC AS exclusivity_score FROM (SELECT T.fec_committee_id, T.contributor_name, SUM(T.amount) AS total_by_PAC FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' GROUP BY T.fec_committee_id LIMIT 1000) AS T1, fec_committee_contributions T2 WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' GROUP BY T1.fec_committee_id, T2.other_id LIMIT 1000) T3 WHERE T3.exclusivity_score = '1';
#or compare sum of all PACs donations with maximum amount donated:
SELECT * FROM (SELECT T1.fec_committee_id, T1.contributor_name, T2.other_id, T2.recipient_name, T1.total_by_PAC, MAX(T2.amount) AS max_amount FROM (SELECT T.fec_committee_id, T.contributor_name, SUM(T.amount) AS total_by_PAC FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' GROUP BY T.fec_committee_id LIMIT 1000) AS T1, fec_committee_contributions T2 WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' GROUP BY T1.fec_committee_id) T3 WHERE T3.total_by_PAC = T3.max_amount LIMIT 100;
#Query to find all donations from 2003 on
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, EXTRACT(YEAR FROM T.date) FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' ORDER BY T.date LIMIT 100;
#Query to look up specific pair
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, T.amount FROM fec_committee_contributions T WHERE T.other_id = 'C00544346' AND T.fec_committee_id = 'C00504753' AND T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003';
SELECT * FROM (SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, MAX(T.amount) AS max_amount FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.other_id LIMIT 1000) T1 WHERE T1.max_amount > 5000 ORDER BY T1.max_amount DESC;
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, T.amount FROM fec_committee_contributions T WHERE T.fec_committee_id = 'C00028860' AND T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003';
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, T.amount FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' AND T.amount > 5000 ORDER BY T.amount DESC LIMIT 1000;
SELECT * FROM (SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, IFNULL(1/VAR_POP(DAYOFYEAR(T1.date)), 0) AS periodicity_score FROM fec_committee_contributions T1 WHERE T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' GROUP BY T1.fec_committee_id, T1.other_id ORDER BY T1.fec_committee_id, T1.other_id LIMIT 1000) T ORDER BY T.periodicity_score DESC;
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, T.amount FROM fec_committee_contributions T WHERE T.other_id = 'C00271338' AND T.fec_committee_id = 'C00000422' AND T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003';
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.state, T.amount, T.date FROM fec_committee_contributions T WHERE T.fec_committee_id = 'C00000422' AND T.other_id = 'C00348607' AND T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003';
SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, COUNT(T.state) FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T1.fec_committee_id, T1.other_id;
# answering Derek's question - same pairs donating in different cycles, different states
SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, COUNT(T1.state) FROM (SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.state FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.other_id, T.state) T1 GROUP BY T1.fec_committee_id, T1.other_id ORDER BY COUNT(T1.state) DESC LIMIT 100;
SELECT * FROM (SELECT T4.fec_committee_id, T4.contributor_name, T4.other_id, T4.recipient_name, T4.state_count, COUNT(T4.cycle) AS cycle_count FROM (SELECT T2.fec_committee_id, T2.contributor_name, T2.other_id, T2.recipient_name, T2.state_count, T3.cycle FROM (SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, COUNT(T1.state) AS state_count FROM (SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.state FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.other_id, T.state) T1 GROUP BY T1.fec_committee_id, T1.other_id ORDER BY COUNT(T1.state)) T2, fec_committee_contributions T3 WHERE T2.other_id = T3.other_id AND T2.fec_committee_id = T3.fec_committee_id AND T2.state_count > 1 ORDER BY T2.fec_committee_id, T2.other_id) T4) T5 WHERE T5.cycle_count > 1;
# geographical query: how many states does a PAC donate to?
SELECT T1.fec_committee_id, T1.contributor_name, COUNT(T1.state) FROM (SELECT T.fec_committee_id, T.contributor_name, T.state FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.state) T1 GROUP BY T1.fec_committee_id ORDER BY COUNT(T1.state) LIMIT 100;
SELECT T1.fec_committee_id, T1.contributor_name, COUNT(T1.state) FROM (SELECT T.fec_committee_id, T.contributor_name, T.state FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.state) T1 GROUP BY T1.fec_committee_id ORDER BY COUNT(T1.state) DESC LIMIT 100;
SELECT T.fec_committee_id, T.contributor_name, COUNT(DISTINCT T.state), COUNT(*) FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id, T.state ORDER BY COUNT(DISTINCT T.state) DESC;
# see all report types
SELECT T.report_type FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.report_type;
# see all PGIs
SELECT T.report_type, EXTRACT(YEAR FROM T.date) FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' AND T.report_type = 'M11' GROUP BY EXTRACT(YEAR FROM T.date);
SELECT T1.fec_committee_id, T1.contributor_name, T2.filer_name, T1.other_id, T1.recipient_name FROM fec_committee_contributions T1, super_PACs_list T2 WHERE T1.fec_committee_id = T2.filer_id AND T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003'LIMIT 10;
SELECT T.fec_candidate_id FROM fec_committees T WHERE fec_candidate_id LIKE '[HPS]%' LIMIT 100;
# Query that joins fec_committees, fec_candidates and fec_committee_contributions table
# How many races does a PAC support? (Disregard year)
SELECT T.fec_committee_id, T.contributor_name, COUNT(T.fec_committee_id)
FROM races_list T
GROUP BY T.district, T.office_state, T.branch
ORDER BY NULL;
SELECT *
FROM (
SELECT T.fec_committee_id, COUNT(*)
FROM races_list T
GROUP BY T.fec_committee_id
ORDER BY NULL
) T1
ORDER BY T1.count_races;
SELECT T.fec_committee_id, T.contributor_name, T.other_id, T.recipient_name, T.date, T.amount FROM fec_committee_contributions T WHERE T.fec_committee_id = 'C00210187' AND T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003';
+----------
"SELECT * FROM (SELECT T1.fec_committee_id, T1.contributor_name, 1/COUNT(*) AS race_focus_bonus FROM (SELECT T.fec_committee_id, T.contributor_name, T.district, T.office_state, T.branch FROM races_list T GROUP BY T.fec_committee_id, T.district, T.office_state, T.branch ORDER BY NULL) T1 GROUP BY T1.fec_committee_id ORDER BY NULL) T2 ORDER BY T2.count_races;"
SELECT * FROM fec_committee_contributions T1, fec_committees T2, fec_candidates T3 WHERE T2.fec_candidate_id = T3.fecid AND T1.other_id = T2.fecid AND T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' AND T1.fec_committee_id NOT IN (SELECT fecid FROM super_PACs_list) AND T1.other_id NOT IN (SELECT fecid FROM super_PACs_list) AND T2.fec_candidate_id REGEXP '^[HPS]' LIMIT 10;
SELECT T2.committee_type FROM fec_committee_contributions T1, fec_committees T2 WHERE T1.other_id = T2.fecid AND T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' AND T2.is_super_PAC = '0' GROUP BY T2.committee_type;
SELECT T1.fec_committee_id, T1.contributor_name, T1.other_id, T1.recipient_name, T2.committee_type FROM fec_committee_contributions T1, fec_committees T2 WHERE T1.other_id = T2.fecid AND T1.transaction_type = '24K' AND T1.entity_type = 'PAC' AND EXTRACT(YEAR FROM T1.date) >= '2003' AND T2.is_super_PAC = '0' AND T2.committee_type = 'A' LIMIT 100;
SELECT T4.fec_committee_id, T4.contributor_name, T4.total_by_PAC, T4.other_id, T4.recipient_name, T4.amount, T4.date, T4.exclusivity_score
FROM (
SELECT T1.fec_committee_id, T1.contributor_name, T1.total_by_PAC, T2.other_id, T2.recipient_name, T3.is_super_PAC, T2.amount, T2.date, T2.amount/T1.total_by_PAC AS exclusivity_score
FROM total_donated_by_PAC T1, fec_committee_contributions T2, fec_committees T3
WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' AND EXTRACT(YEAR FROM T2.date) >= '2003' AND T2.other_id = T3.fecid AND T3.is_super_PAC = '0'
) T4, fec_committees T5
WHERE T4.fec_committee_id = T5.fecid AND T5.is_super_PAC = '0';
GROUP BY T1.fec_committee_id, T2.other_id
ORDER BY NULL
-----
total_donated_by_PAC T1
-----
SELECT T1.fec_committee_id, T1.contributor_name, T1.total_by_PAC, T2.other_id, T2.recipient_name, T2.amount, T2.date, T2.amount/T1.total_by_PAC AS exclusivity_score FROM (SELECT T.fec_committee_id, T.contributor_name, SUM(T.amount) AS total_by_PAC FROM fec_committee_contributions T WHERE T.transaction_type = '24K' AND T.entity_type = 'PAC' AND EXTRACT(YEAR FROM T.date) >= '2003' GROUP BY T.fec_committee_id ORDER BY NULL) AS T1, fec_committee_contributions T2, fec_committees T3 WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' AND EXTRACT(YEAR FROM T2.date) >= '2003' AND T2.other_id = T3.fecid AND T3.is_super_PAC = '0' GROUP BY T1.fec_committee_id, T2.other_id ORDER BY NULL LIMIT 100;
"SELECT T.fec_committee_id, T.contributor_name, T.total_by_PAC, T.other_id, T.recipient_name, SUM(T.amount) AS total_amount, SUM(exclusivity_subscore) AS exclusivity_score FROM (SELECT T1.fec_committee_id, T1.contributor_name, T1.total_by_PAC, T2.other_id, T2.recipient_name, T2.amount, T2.date, T2.amount/T1.total_by_PAC AS exclusivity_subscore FROM fec_committee_contributions T2, total_donated_by_PAC T1 WHERE T1.fec_committee_id = T2.fec_committee_id AND T2.transaction_type = '24K' AND T2.entity_type = 'PAC' AND EXTRACT(YEAR FROM T2.date) >= '2003' AND T2.fec_committee_id NOT IN (SELECT fecid FROM super_PACs_list T3) AND T2.other_id NOT IN (SELECT fecid FROM super_PACs_list T4)) T GROUP BY T.fec_committee_id, T.other_id ORDER BY NULL;"
SELECT T1.fec_committee_id, T1.contributor_name, T2.cycle, CASE T2.committee_type WHEN 'X' OR 'Y' THEN CASE T1.fec_committee_id WHEN 'C00003418' OR 'C00163022' OR 'C00027466' OR 'C00075820' OR 'C00000935' OR 'C00042366' OR 'C00010603' THEN 'national_party' ELSE 'other_party' END ELSE CASE WHEN (T2.cycle >= EXTRACT(YEAR FROM T2.multiqualify_date)) THEN 'multi_pac'ELSE 'non_multi_pac' END END AS contributor_type FROM fec_committees T2, fec_committee_contributions T1 WHERE T1.fec_committee_id = T2.fecid AND (T2.committee_type = 'X' OR T2.committee_type = 'Y' OR T2.committee_type = 'N' OR T2.committee_type = 'Q' OR T2.committee_type = 'F') GROUP BY T1.fec_committee_id ORDER BY NULL
SELECT T1.fec_committee_id, T1.contributor_name, T2.cycle, CASE T2.committee_type WHEN 'X' OR 'Y' THEN CASE T1.fec_committee_id WHEN 'C00003418' OR 'C00163022' OR 'C00027466' OR 'C00075820' OR 'C00000935' OR 'C00042366' OR 'C00010603' THEN 'national_party' ELSE 'other_party' END ELSE CASE WHEN (T2.cycle >= EXTRACT(YEAR FROM T2.multiqualify_date)) THEN 'multi_pac'ELSE 'non_multi_pac' END END AS contributor_type FROM fec_committees T2 JOIN fec_committee_contributions T1 ON T1.fec_committee_id = T2.fecid USE INDEX(fecid_3) WHERE T2.committee_type = 'X' OR T2.committee_type = 'Y' OR T2.committee_type = 'N' OR T2.committee_type = 'Q' OR T2.committee_type = 'F' GROUP BY T1.fec_committee_id ORDER BY NULL
SELECT T.fecid, T.name, T.cycle, CASE WHEN (T.committee_type = 'X' OR T.committee_type = 'Y') THEN CASE WHEN (T.fecid = 'C00003418' OR T.fecid = 'C00163022' OR T.fecid = 'C00027466' OR T.fecid = 'C00075820' OR T.fecid = 'C00000935' OR T.fecid = 'C00042366' OR T.fecid = 'C00010603') THEN 'national_party' ELSE 'other_party' END ELSE CASE WHEN (T.committee_type = 'H' OR T.committee_type = 'S' OR T.committee_type = 'P' OR T.committee_type = 'A' OR T.committee_type = 'B') THEN 'candidate' ELSE 'pac' END END AS contributor_type FROM fec_committees T WHERE T.committee_type = 'X' OR T.committee_type = 'Y' OR T.committee_type = 'H' OR T.committee_type = 'S' OR T.committee_type = 'P' OR T.committee_type = 'A' OR T.committee_type = 'B' OR T.committee_type = 'N' OR T.committee_type = 'Q' OR T.committee_type = 'F' OR T.committee_type = 'G' GROUP BY T.fecid, T.cycle ORDER BY NULL;
SELECT T1.fec_committee_id, T1.contributor_name, T2.contributor_type, T1.other_id, T1.recipient_name, T3.recipient_type, T1.cycle, T1.date, T1.amount, T4.contribution_limit, T1.amount/T4.contribution_limit AS maxed_out_score FROM fec_committee_contributions T1, contributor_types T2, recipient_types T3, contribution_limits T4 WHERE T1.fec_committee_id = T2.fec_committee_id AND T1.other_id = T3.other_id AND T2.contributor_type = T4.contributor_type AND T3.recipient_type = T4.recipient_type AND T1.cycle = T4.cycle AND T2.cycle = T4.cycle AND T3.cycle = T4.cycle GROUP BY T1.fec_committee_id, T1.other_id, T1.date, T1.amount ORDER BY NULL;
SELECT T1.fec_committee_id, T1.contributor_name, T2.contributor_type, T1.other_id, T1.recipient_name, T3.recipient_type, T1.cycle, T1.date, T1.amount FROM fec_committee_contributions T1, contributor_types T2, recipient_types T3 WHERE T1.fec_committee_id = T2.fec_committee_id AND T1.other_id = T3.other_id GROUP BY T1.fec_committee_id, T1.other_id, T1.date, T1.amount ORDER BY NULL;
SELECT DISTINCT T1.fec_committee_id, T1.contributor_name, T2.contributor_type, T1.other_id, T1.recipient_name, T3.recipient_type, T1.cycle, T1.date, T1.amount FROM fec_committee_contributions T1, contributor_types T2, recipient_types T3 WHERE T1.fec_committee_id = T2.fec_committee_id AND T1.other_id = T3.other_id LIMIT 10;
ALTER TABLE contribution_limits ADD INDEX (contributor_type, recipient_type, cycle, contribution_limit);
C00003418 | REPUBLICAN NATIONAL COMMITTEE
C00163022 | REPUBLICAN NATIONAL COMMITTEE
C00027466 | NATIONAL REPUBLICAN SENATORIAL COMMITTEE
C00075820 | NATIONAL REPUBLICAN CONGRESSIONAL COMMITTEE
-----
C00000935 | DEMOCRATIC CONGRESSIONAL CAMPAIGN COMMITTEE
C00042366 | DEMOCRATIC SENATORIAL CAMPAIGN COMMITTEE
C00010603 | DNC SERVICES CORPORATION/DEMOCRATIC NATIONAL COMMITTEE