This repository was archived by the owner on Jul 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
update exercises for clarity #21
Open
zacjones93
wants to merge
7
commits into
master
Choose a base branch
from
zj/update-exercises
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
34fdc20
Add paragraph on where to find data
zacjones93 8810e76
Rename id column to user_handle
zacjones93 54739d6
Use uuid for ids
zacjones93 420ad7b
Add more context to exercise 02
zacjones93 b3b6aee
Add more context to exercise 05
zacjones93 359901d
Add user story to exercise 2 for filtering data
zacjones93 fcbf3df
Tweak exercise 07
zacjones93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ $ drop table users; | |
|
|
||
| ```sql | ||
| $ create table users ( | ||
| user_handle int Primary key, | ||
| user_handle uuid Primary key, | ||
| first_name text, | ||
| last_name text, | ||
| email text, | ||
|
|
@@ -27,7 +27,7 @@ insert into users values ('1', 'Agustin', 'Gillingham', '[email protected] | |
| Your goal is to guarantee that a payment is successfully processed. To do so, you will need to initiate a transaction that: | ||
| - checks if product is available | ||
| - inserts payment info into users table | ||
| - adds item to purchases table | ||
| - adds items to purchases table | ||
|
|
||
| If any of these actions fail, the transaction should be aborted. | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| ## 01 | ||
| ```sql | ||
| SELECT | ||
| u.user_handle, | ||
|
|
@@ -28,4 +29,13 @@ user_handle | sum | |
| 2 | 146 | ||
| 36 | 126 | ||
| 93 | 110 | ||
| ``` | ||
|
|
||
| ## 02 | ||
| ```sql | ||
| postgres=# select email, users.user_handle, age, gender, sum(quantity) as total from users join purchases on (users.user_handle = purchases.user_handle) where sku=18302880 group by users.user_handle; | ||
| email | user_handle | age | gender | total | ||
| ------------------------<del>-------------</del>-----<del>--------</del>--–— | ||
| [email protected] | 16 | 19 | Male | 12 | ||
| (1 row) | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| id,first_name,last_name,email,gender,age,language | ||
| user_handle,first_name,last_name,email,gender,age,language | ||
| 1,Ophelia,Claffey,[email protected],Female,40,Macedonian | ||
| 2,Marta,Brokenbrow,[email protected],Female,23,Somali | ||
| 3,Barney,Grenshields,[email protected],Male,66,Thai | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would the values change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it changed above to
uuidbut remained anint