Skip to content

Instantly share code, notes, and snippets.

@Chojiu15
Created September 7, 2021 14:15
Show Gist options
  • Save Chojiu15/82b033c93504e681dbbdfc1e392531d8 to your computer and use it in GitHub Desktop.
Save Chojiu15/82b033c93504e681dbbdfc1e392531d8 to your computer and use it in GitHub Desktop.
SQLexercises
EX 1
​Create a table named friends with three columns:
id that stores INTEGER
name that stores TEXT
birthday that stores DATE
Beneath your current code, add Jane Doe to friends.
Her birthday is May 30th, 1990.
Add two of your friends to the table.
Insert an id, name, and birthday for each of them
(name : Clara Doe / Jhon Doe)
​​
Jane Doe just got married! Her new last name is “Smith”.
Add a new column named email.
Jane Smith’s email is [email protected]
Wait, Clara Doe is not a real person.
Remove her from friends.​
SELECT * FROM friends;
EX2
​What is the largest population size for Gabon in this dataset?
What were the 10 lowest population countries in 2005?
What are all the distinct countries with a population of over 100 million in the year 2010?
How many countries in this dataset have the word “Islands” in their name?
What is the difference in population between 2000 and 2010 in Indonesia?
Note: it’s okay to figure out the difference by hand after pulling the correct data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment