Match the query
- 1B
- 2A
- 3C
- 4B
- 5B
- 6A
- 7B
- 8C
- 9A
- 10B
- 11B
Write out the query
1.
SELECT *
FROM homes
WHERE
owner_name = 'Carolina';
2.
SELECT *
FROM people
WHERE sex = 'M'
ORDER BY
age DESC
3.
SELECT SUM(value)
FROM homes;
4.
SELECT eyes,
COUNT(*) AS the_count
FROM people
GROUP BY eyes
ORDER BY the_count ASC
5.
SELECT homes.*
FROM homes
INNER JOIN
people ON
people.name = homes.owner_name
WHERE people.eyes = 'brown'
AND people.sex = 'M';
T1.
SELECT COUNT(*) AS tcount
FROM tweets
WHERE text LIKE '%vote%'
SELECT tag,
COUNT(*) AS hcount
FROM tw_hashtags
INNER JOIN
tweets ON
tweets.ID = tw_hashtags.tweet_ID
WHERE tweets.screen_name = 'realdonaldtrump'
AND STRFTIME('%H', time_tweeted) BETWEEN '00' AND '05'
GROUP BY tag
ORDER BY hcount DESC
LIMIT 5;
Police-officer involved shootings
P1.
SELECT "PERSON RACE",
"DEPUTY RACE",
COUNT(*) AS icount
FROM deputies
INNER JOIN people
ON
deputies."INCIDENT NUMBER" = people."INCIDENT NUMBER"
GROUP BY
"PERSON RACE", "DEPUTY RACE"
ORDER BY
icount DESC