Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
@pamelafox
pamelafox / card_games_results.sql
Created May 8, 2015 19:19
card_games_results.sql
/* Friendly Card Game Results:
During this past winter, a few friends got together every Wednesday night for a friendly game of cards. On some nights they'd play two games, but never the same game twice on the same night. The usual players were Spunky Sam, Marcimus, Winston, and Hopper. Sometimes, one of the friends couldn't make it, so there were only three players. But sometimes they'd call another friend to fill-in. In every game they played, the one with the hightest score was declared the winner. These are their results:
Created by: https://www.khanacademy.org/profile/brianduckworth
*/
CREATE TABLE card_games(id INTEGER PRIMARY KEY AUTOINCREMENT,
date_played TEXT,
game_name TEXT,
player_name TEXT,
score INTEGER);
@pamelafox
pamelafox / winstons_donut_logs.sql
Last active November 4, 2024 03:46
winstons_donut_logs.sql
/*
Winston's Donut logs
This table of logs shows how many donuts Winston eats at each year of his life,
plus any particular reason to explain his eating habits.
Collected by: https://www.khanacademy.org/profile/mhogwarts/
*/
CREATE TABLE winstons_donut_logs (
id TEXT PRIMARY KEY,
status TEXT,
years_old INTEGER,
@pamelafox
pamelafox / earned_badges.sql
Created May 8, 2015 18:37
earned_badges.sql
/*
Earned Badges
This table contains badges earned by a user, including the most recent date achieved, the type, the name, the # of energy points earned, and the activity earned from.
Collected by: https://www.khanacademy.org/profile/chopsor/
*/
CREATE TABLE badges (
date TEXT,
badge_type TEXT,
badge_name TEXT,
@pamelafox
pamelafox / furniture_store_sales.sql
Created May 8, 2015 18:31
furniture_store_sales.sql
/*
Sales from an online furniture store
Collected by: https://www.khanacademy.org/profile/charlesb2000/
*/
CREATE TABLE sales(
ID INTEGER NOT NULL PRIMARY KEY
, transaction_date TEXT
, product TEXT
, price INTEGER
, payment_type TEXT
@pamelafox
pamelafox / marvel_characters.sql
Last active February 4, 2025 08:18
marvel_characters.sql
/* Marvel Heroes and Villains
Based on the website http://marvel.wikia.com/Main_Page
with popularity data from http://observationdeck.io9.com/something-i-found-marvel-character-popularity-poll-cb-1568108064
and power grid data from http://marvel.wikia.com/Power_Grid#Power
Collected by: https://www.khanacademy.org/profile/Mentrasto/
*/
CREATE TABLE marvels (ID INTEGER PRIMARY KEY,
name TEXT,
popularity INTEGER,
@pamelafox
pamelafox / human_organs.sql
Created May 8, 2015 18:24
human_organs.sql
/*
Top 10 organs in the human body, by weight
Adapted from: https://propelsteps.wordpress.com/2014/10/12/know-top-10-largest-organs-of-the-human-body/
Collected by: https://www.khanacademy.org/profile/errorbuddy/
*/
CREATE TABLE organs (id INTEGER PRIMARY KEY,
name TEXT,
weight INTEGER,
important_functions TEXT,
@pamelafox
pamelafox / top_programs.sql
Created May 8, 2015 18:18
top_programs.sql
/*
16 of the top programs on Khan Academy.
Collected by: https://www.khanacademy.org/profile/TKA23/
*/
CREATE TABLE top_programs (
id INTEGER PRIMARY KEY,
name TEXT,
creator Text,
votes INTEGER,
spin_offs INTEGER);
@pamelafox
pamelafox / solar_system_objects.sql
Last active August 1, 2024 16:42
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */
@pamelafox
pamelafox / ka_avatars.sql
Created May 8, 2015 18:03
ka_avatars.sql
/*
Khan Academy Avatars:
This table contains all of Khan Academy's avatars, including their type and name, the requirements to unlock them, and their relative image URL.
Collected by:
https://www.khanacademy.org/profile/chopsor/
*/
CREATE TABLE avatars (
id INTEGER,
@pamelafox
pamelafox / countries_and_territories.sql
Last active April 13, 2025 10:45
countries_and_territories.sql
/*
Countries and dependent territories, 2020
Data adapted from
http://www.worldometers.info/world-population/population-by-country/
Does not include rows which had "N.A." values, so some territories are missing.
*/
CREATE TABLE countries(
name TEXT PRIMARY KEY,
population INTEGER,