-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSQL_search_statements_bio_info.txt
58 lines (51 loc) · 1.36 KB
/
SQL_search_statements_bio_info.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
/*Data for members
Note: I have separated the search for house and senate.
I have hard coded the names here but they should be replaced with the search names.*/
/*Search for name in House
Info: Brings back all the columns from the the members table.
*/
SELECT *
FROM house_members
WHERE last_name = "Adams" AND first_name = "Alma";
/*Search for name in House:
Note: I selected the columns I think would be useful for member bio info.
Perhaps we can have a table with just this info for their bio? */
SELECT
title,
first_name,
last_name,
date_of_birth,
gender,
party,
twitter_account,
facebook_account,
office,
phone,
state,
district
FROM house_members
WHERE last_name = "Adams" AND first_name = "Alma";
/*Search for name in Senate:
Info: Brings back all the columns from the the members table. */
SELECT *
FROM senate_members
WHERE last_name = "Baldwin" AND first_name = "Tammy";
/*Search for name in Senate:
Note: I selected the columns I think would be useful for member bio info.
The senate differs in the last column name, state_rank instead of distict.
Senior vs Junior senator. */
SELECT
title,
first_name,
last_name,
date_of_birth,
gender,
party,
twitter_account,
facebook_account,
office,
phone,
state,
state_rank
FROM senate_members
WHERE last_name = "Baldwin" AND first_name = "Tammy";