Skip to content

adaapp/db-workshop-01-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Databases Workshop 1: Querying Slack

Work in pairs. Start by forking this repo, and making sure you both have access to the fork. Clone the repo to one of your laptops. Pair on this in driver navigator style, but swap around for each task.

For each task below, find a single sql query that returns the correct result. Add it do this document in the ```sql ``` blocks, plus any notes. Make sure your changes are commited and pushed when you finish.

Tasks:

1: Get the name of every channel created by user id 2

-- your SQL goes in here

2: Get the 5 most recent messages in channel id 5

3: Get the first 10 messages posted in channel id 11

4: Get the names and emails of every admin user

5: Get the name of every user who isn't an admin or a bot

6: Get all the messages posted in the channel with name 'resources'

Remember: You need to write this as a single sql query - you can't look up the channel ID manually first.

7: Get the names of every user in channel 'sd-cohort3-may18'

8: Get the name of every channel that you belong to

Use your email address as part of your WHERE - don't query by your user id.

9: Get the total number of messages created

10: Create a query that returns the text of each message, the name of the channel it was posted in, and the name of the poster, in chronological order

Hint: there should be the same number of results as there are messages - use this to manually check the results you're getting!

11: Find names of the 5 users who have sent the most messages

12: Find the names of every user who has never sent a message that didn't end with 'has joined the channel'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published