├── Analyzing Unicorn Companies ├── calculator.png └── notebook.ipynb ├── Analyzing Motorcycle Part Sales ├── motorcycle.jpg └── notebook.ipynb ├── When Was the Golden Age of Video Games ├── datasets │ ├── game_sales_data.csv │ ├── top_critic_scores.csv │ ├── top_user_scores_more_than_four_games.csv │ ├── top_critic_scores_more_than_four_games.csv │ ├── createdb.sql │ ├── game_reviews.csv │ └── game_sales.csv └── notebook.ipynb ├── Analyzing American Baby Name Trends └── datasets │ ├── createdb.sql │ └── createdblocal.sql ├── Analyze International Debt Statistics ├── datasets │ └── international_debt.sql └── notebook.ipynb ├── Analyzing NYC Public School Test Result Scores ├── datasets │ ├── createdb.sql │ └── schools_modified.csv └── notebook.ipynb ├── Optimizing Online Sports Retail Revenue └── datasets │ └── createdb.sql └── README.md /Analyzing Unicorn Companies/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qanhnn12/DataCamp-SQL-projects/HEAD/Analyzing Unicorn Companies/calculator.png -------------------------------------------------------------------------------- /Analyzing Motorcycle Part Sales/motorcycle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qanhnn12/DataCamp-SQL-projects/HEAD/Analyzing Motorcycle Part Sales/motorcycle.jpg -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/game_sales_data.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qanhnn12/DataCamp-SQL-projects/HEAD/When Was the Golden Age of Video Games/datasets/game_sales_data.csv -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/top_critic_scores.csv: -------------------------------------------------------------------------------- 1 | year,avg_critic_score 2 | 1990,9.80 3 | 1992,9.67 4 | 1998,9.32 5 | 2020,9.20 6 | 1993,9.10 7 | 1995,9.07 8 | 2004,9.03 9 | 1982,9.00 10 | 2002,8.99 11 | 1999,8.93 12 | -------------------------------------------------------------------------------- /Analyzing American Baby Name Trends/datasets/createdb.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE baby_names; 2 | 3 | CREATE TABLE baby_names ( 4 | year INT, 5 | first_name VARCHAR(64), 6 | sex VARCHAR(64), 7 | num INT 8 | ); 9 | 10 | \copy baby_names FROM 'usa_baby_names.csv' DELIMITER ',' CSV HEADER; -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/top_user_scores_more_than_four_games.csv: -------------------------------------------------------------------------------- 1 | year,num_games,avg_user_score 2 | 1997,8,9.50 3 | 1998,10,9.40 4 | 2010,23,9.24 5 | 2009,20,9.18 6 | 2008,20,9.03 7 | 1996,5,9.00 8 | 2005,13,8.95 9 | 2006,16,8.95 10 | 2000,8,8.80 11 | 2002,9,8.80 12 | -------------------------------------------------------------------------------- /Analyzing American Baby Name Trends/datasets/createdblocal.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE baby_names; 2 | 3 | CREATE TABLE baby_names ( 4 | year INT, 5 | first_name VARCHAR(64), 6 | sex VARCHAR(64), 7 | num INT 8 | ); 9 | 10 | \copy baby_names FROM 'datasets/usa_baby_names.csv' DELIMITER ',' CSV HEADER; -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/top_critic_scores_more_than_four_games.csv: -------------------------------------------------------------------------------- 1 | year,num_games,avg_critic_score 2 | 1998,10,9.32 3 | 2004,11,9.03 4 | 2002,9,8.99 5 | 1999,11,8.93 6 | 2001,13,8.82 7 | 2011,26,8.76 8 | 2016,13,8.67 9 | 2013,18,8.66 10 | 2008,20,8.63 11 | 2017,13,8.62 12 | -------------------------------------------------------------------------------- /Analyze International Debt Statistics/datasets/international_debt.sql: -------------------------------------------------------------------------------- 1 | -- Table: international_debt 2 | 3 | CREATE TABLE international_debt 4 | ( 5 | country_name character varying(50), 6 | country_code character varying(50), 7 | indicator_name text, 8 | indicator_code text, 9 | debt numeric 10 | ); 11 | 12 | -- Copy over data from CSV 13 | \copy international_debt FROM 'international_debt.csv' DELIMITER ',' CSV HEADER; -------------------------------------------------------------------------------- /Analyzing NYC Public School Test Result Scores/datasets/createdb.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE schools; 2 | 3 | CREATE TABLE schools 4 | ( 5 | school_name VARCHAR(100) PRIMARY KEY, 6 | borough VARCHAR(100), 7 | building_code VARCHAR(10), 8 | average_math INT, 9 | average_reading INT, 10 | average_writing INT, 11 | percent_tested FLOAT 12 | ); 13 | 14 | \copy schools FROM 'schools_modified.csv' DELIMITER ',' CSV HEADER; 15 | -------------------------------------------------------------------------------- /Optimizing Online Sports Retail Revenue/datasets/createdb.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE info; 2 | 3 | CREATE TABLE info 4 | ( 5 | product_name VARCHAR(100), 6 | product_id VARCHAR(11) PRIMARY KEY, 7 | description VARCHAR(700) 8 | ); 9 | 10 | DROP TABLE finance; 11 | 12 | CREATE TABLE finance 13 | ( 14 | product_id VARCHAR(11) PRIMARY KEY, 15 | listing_price FLOAT, 16 | sale_price FLOAT, 17 | discount FLOAT, 18 | revenue FLOAT 19 | ); 20 | 21 | DROP TABLE reviews; 22 | 23 | CREATE TABLE reviews 24 | ( 25 | product_id VARCHAR(11) PRIMARY KEY, 26 | rating FLOAT, 27 | reviews FLOAT 28 | ); 29 | 30 | DROP TABLE traffic; 31 | 32 | CREATE TABLE traffic 33 | ( 34 | product_id VARCHAR(11) PRIMARY KEY, 35 | last_visited TIMESTAMP 36 | ); 37 | 38 | DROP TABLE brands; 39 | 40 | CREATE TABLE brands 41 | ( 42 | product_id VARCHAR(11) PRIMARY KEY, 43 | brand VARCHAR(7) 44 | ); 45 | 46 | \copy info FROM 'info_v2.csv' DELIMITER ',' CSV HEADER; 47 | \copy finance FROM 'finance.csv' DELIMITER ',' CSV HEADER; 48 | \copy reviews FROM 'reviews_v2.csv' DELIMITER ',' CSV HEADER; 49 | \copy traffic FROM 'traffic_v3.csv' DELIMITER ',' CSV HEADER; 50 | \copy brands FROM 'brands_v2.csv' DELIMITER ',' CSV HEADER; 51 | -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/createdb.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE game_sales; 2 | 3 | CREATE TABLE game_sales ( 4 | game VARCHAR(100) PRIMARY KEY, 5 | platform VARCHAR(64), 6 | publisher VARCHAR(64), 7 | developer VARCHAR(64), 8 | games_sold NUMERIC(5, 2), 9 | year INT 10 | ); 11 | 12 | DROP TABLE reviews; 13 | 14 | CREATE TABLE reviews ( 15 | game VARCHAR(100) PRIMARY KEY, 16 | critic_score NUMERIC(4, 2), 17 | user_score NUMERIC(4, 2) 18 | ); 19 | 20 | DROP TABLE top_critic_years; 21 | 22 | CREATE TABLE top_critic_years ( 23 | year INT PRIMARY KEY, 24 | avg_critic_score NUMERIC(4, 2) 25 | ); 26 | 27 | DROP TABLE top_critic_years_more_than_four_games; 28 | 29 | CREATE TABLE top_critic_years_more_than_four_games ( 30 | year INT PRIMARY KEY, 31 | num_games INT, 32 | avg_critic_score NUMERIC(4, 2) 33 | ); 34 | 35 | DROP TABLE top_user_years_more_than_four_games; 36 | 37 | CREATE TABLE top_user_years_more_than_four_games ( 38 | year INT PRIMARY KEY, 39 | num_games INT, 40 | avg_user_score NUMERIC(4, 2) 41 | ); 42 | 43 | \copy game_sales FROM 'game_sales.csv' DELIMITER ',' CSV HEADER; 44 | \copy reviews FROM 'game_reviews.csv' DELIMITER ',' CSV HEADER; 45 | \copy top_critic_years FROM 'top_critic_scores.csv' DELIMITER ',' CSV HEADER; 46 | \copy top_critic_years_more_than_four_games FROM 'top_critic_scores_more_than_four_games.csv' DELIMITER ',' CSV HEADER; 47 | \copy top_user_years_more_than_four_games FROM 'top_user_scores_more_than_four_games.csv' DELIMITER ',' CSV HEADER; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SQL projects on DataCamp 2 | ## 📊 Guided projects 3 | 4 | ### 1. Analyze International Debt Statistics 5 | * Aggregate data with ```SUM()```, ```MAX()```, ```MIN()``` 6 | * Filter rows using ```WHERE```, ```GROUP BY``` 7 | * Use subquery in ```WHERE``` 8 | 9 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Analyze%20International%20Debt%20Statistics)! 10 | 11 | ### 2. Analyzing NYC Public School Test Result Scores 12 | * Count unique values with ```COUNT(DISTINCT)``` 13 | * Combine ```SUM()``` and ```COUNT()``` to calculate in each row 14 | 15 | 16 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Analyzing%20NYC%20Public%20School%20Test%20Result%20Scores)! 17 | 18 | ### 3. When Was the Golden Age of Video Games? 19 | * Use ```HAVING``` to filter on results of ```GROUP BY``` 20 | * ```JOIN``` and ```LEFT JOIN``` tables 21 | 22 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/When%20Was%20the%20Golden%20Age%20of%20Video%20Games)! 23 | 24 | ### 4. Analyzing American Baby Name Trends 25 | * Use```CASE``` to add a new column based on some conditions 26 | * Use window functions such as ```DENSE_RANK()```, ```SUM()``` 27 | * Simplify the code with ```CTE``` 28 | 29 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Analyzing%20American%20Baby%20Name%20Trends)! 30 | 31 | ### 5. Optimizing Online Sports Retail Revenue 32 | * ```CAST``` numeric data 33 | * Calculate the correlation and median 34 | * Work with dates, times, and strings 35 | 36 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Optimizing%20Online%20Sports%20Retail%20Revenue)! 37 | 38 | ## 📊 Unguided projects 39 | ### 1. Analyzing Unicorn Companies 40 | 41 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Analyzing%20Unicorn%20Companies)! 42 | 43 | ### 2. Analyzing Motorcycle Part Sales 44 | 45 | View my project [here](https://github.com/qanhnn12/DataCamp-SQL-projects/tree/main/Analyzing%20Motorcycle%20Part%20Sales)! 46 | -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/game_reviews.csv: -------------------------------------------------------------------------------- 1 | Name,Critic_Score,User_Score 2 | Wii Sports for Wii,7.7,8.0 3 | Super Mario Bros. for NES,10.0,8.2 4 | Counter-Strike: Global Offensive for PC,8.0,7.5 5 | Mario Kart Wii for Wii,8.2,9.1 6 | PLAYERUNKNOWN'S BATTLEGROUNDS for PC,8.6,4.7 7 | Minecraft for PC,10.0,7.8 8 | Wii Sports Resort for Wii,8.0,8.8 9 | Pokemon Red / Green / Blue Version for GB,9.4,8.8 10 | New Super Mario Bros. for DS,9.1,8.1 11 | New Super Mario Bros. Wii for Wii,8.6,9.2 12 | Tetris for GB,9.4,8.7 13 | Call of Duty: Modern Warfare for PS4,8.0,3.3 14 | Duck Hunt for NES,7.5,8.3 15 | Wii Play for Wii,5.9,6.5 16 | Mario Kart 8 Deluxe for NS,9.3,8.7 17 | Kinect Adventures! for X360,6.7, 18 | Nintendogs for DS,8.4,8.5 19 | Mario Kart DS for DS,9.1,9.4 20 | Pokemon Gold / Silver Version for GB,9.2,8.8 21 | Wii Fit for Wii,7.9, 22 | Wii Fit Plus for Wii,8.0, 23 | Super Mario World for SNES,8.5,9.3 24 | Grand Theft Auto V for PS3,9.4,8.3 25 | Grand Theft Auto V for PS4,9.7,8.4 26 | Brain Age: Train Your Brain in Minutes a Day for DS,8.1, 27 | Super Smash Bros. Ultimate for NS,9.4,9.7 28 | Mario Kart 7 for 3DS,8.2,8.3 29 | Pokemon Diamond / Pearl Version for DS,8.6, 30 | Super Mario Odyssey for NS,9.9,9.0 31 | The Legend of Zelda: Breath of the Wild for NS,9.9,10.0 32 | Pokemon Sword / Shield for NS,8.0,4.6 33 | Grand Theft Auto: San Andreas for PS2,9.5,9.1 34 | Super Mario Bros. 3 for NES,9.8,9.3 35 | Pokemon X/Y for 3DS,8.9,9.7 36 | Uncharted 4: A Thief's End for PS4,9.2,8.4 37 | Pokemon Ruby / Sapphire Version for GBA,8.8,8.6 38 | Pokemon Sun/Moon for 3DS,9.0,7.7 39 | Grand Theft Auto: Vice City for PS2,9.6,8.8 40 | Grand Theft Auto V for X360,10.0, 41 | Pokemon Black / White Version for DS,8.6,9.0 42 | Call of Duty: Black Ops 3 for PS4,8.1,4.9 43 | Counter-Strike: Source for PC,9.3, 44 | Sonic the Hedgehog for GEN,8.6,8.3 45 | Gran Turismo 3: A-Spec for PS2,9.3,8.9 46 | Brain Age 2: More Training in Minutes a Day for DS,8.0, 47 | Call of Duty: Modern Warfare 3 for X360,8.7, 48 | Call of Duty: Black Ops for X360,8.8, 49 | Pokemon Yellow: Special Pikachu Edition for GB,8.7,8.8 50 | Halo 3 for X360,9.6,9.5 51 | Pokemon Omega Ruby/Pokemon Alpha Sapphire for 3DS,8.3,7.4 52 | Terraria for PC,8.8,8.6 53 | Red Dead Redemption 2 for PS4,9.8,7.9 54 | Call of Duty: Black Ops II for X360,9.3, 55 | Call of Duty: Black Ops II for PS3,9.3, 56 | Call of Duty: Modern Warfare 2 for X360,9.5,9.0 57 | Animal Crossing: New Horizons for NS,9.0,5.4 58 | Call of Duty: WWII for PS4,8.0,4.3 59 | Call of Duty: Modern Warfare 3 for PS3,8.8, 60 | New Super Mario Bros. 2 for 3DS,7.5,7.3 61 | Super Smash Bros. Brawl for Wii,9.2,9.7 62 | Marvel's Spider-Man for PS4,9.1,8.7 63 | Grand Theft Auto III for PS2,9.5, 64 | Portal 2 for PC,9.7,9.0 65 | Minecraft for X360,8.5, 66 | Super Mario Galaxy for Wii,9.7,9.6 67 | Pokemon Heart Gold / Soul Silver Version for DS,8.6, 68 | Super Mario 3D Land for 3DS,8.9,8.4 69 | Call of Duty: Black Ops for PS3,8.7, 70 | Grand Theft Auto V for PC,9.6,7.7 71 | Animal Crossing: New Leaf for 3DS,8.6,8.8 72 | The Witcher 3: Wild Hunt for PC,9.3,9.4 73 | Pokemon FireRed / LeafGreen Version for GBA,8.3, 74 | World of Warcraft for PC,9.2,8.0 75 | Half-Life 2 for PC,9.7, 76 | Diablo III for PC,9.0,4.1 77 | "Pokemon: Let's Go, Pikachu/Eevee for NS",8.0,6.2 78 | Gran Turismo 5 for PS3,8.3, 79 | Super Mario 64 for N64,9.7,9.0 80 | FIFA 18 for PS4,8.3,3.4 81 | The Last of Us Remastered for PS4,9.5,9.1 82 | Gran Turismo 4 for PS2,8.7, 83 | Animal Crossing: Wild World for DS,8.5, 84 | Super Mario Land 2: 6 Golden Coins for GB,9.0,8.5 85 | Grand Theft Auto IV for X360,10.0, 86 | Super Mario 64 DS for DS,8.6, 87 | God of War (2018) for PS4,9.7,10.0 88 | StarCraft for PC,8.7, 89 | FIFA 17 for PS4,8.9,4.8 90 | Gran Turismo for PS,9.5, 91 | The Witcher 3: Wild Hunt for PS4,9.2,9.2 92 | Call of Duty: Modern Warfare 2 for PS3,9.5, 93 | Grand Theft Auto IV for PS3,10.0,9.0 94 | Super Mario All-Stars for SNES,9.2,9.5 95 | Call of Duty: Ghosts for X360,6.9, 96 | Just Dance 3 for Wii,7.5, 97 | Call of Duty: Ghosts for PS3,7.5, 98 | Splatoon 2 for NS,8.2,8.5 99 | Super Mario Party for NS,7.3,7.5 100 | Horizon: Zero Dawn for PS4,9.1,8.0 101 | RollerCoaster Tycoon 3 for PC,8.3, 102 | Halo: Reach for X360,9.3, 103 | Portal for PC,9.0, 104 | Halo 4 for X360,9.8, 105 | Final Fantasy VII for PS,9.6,9.5 106 | Mario Kart 64 for N64,8.5, 107 | Super Smash Bros. for 3DS for 3DS,8.4, 108 | Call of Duty 4: Modern Warfare for X360,9.6,9.0 109 | Gran Turismo 2 for PS,9.2, 110 | Wii Party for Wii,7.0, 111 | Call of Duty: Black Ops IIII for PS4,8.3,4.0 112 | Mario Party DS for DS,7.1, 113 | Uncharted 3: Drake's Deception for PS3,9.3,6.3 114 | Donkey Kong Country for SNES,9.0,8.8 115 | Half-Life for PC,9.5, 116 | FIFA 19 for PS4,8.3,1.7 117 | Rust for PC,6.1,6.2 118 | The Elder Scrolls V: Skyrim for X360,9.3, 119 | Mario Party 8 for Wii,6.5, 120 | Pokemon: Ultra Sun and Ultra Moon for 3DS,8.1, 121 | Super Mario Kart for SNES,10.0, 122 | Grand Theft Auto V for XOne,9.0,9.0 123 | Final Fantasy X for PS2,9.0,10.0 124 | Final Fantasy VIII for PS,9.4, 125 | Pokemon Black 2 and White 2 for DS,8.0,8.3 126 | Call of Duty: Infinite Warfare for PS4,7.7,3.8 127 | Fallout 4 for PS4,8.6,6.6 128 | Mario Kart 8 for WiiU,8.8,8.9 129 | Tekken 3 for PS,9.6, 130 | FIFA 16 for PS4,8.5,4.4 131 | The Last of Us for PS3,9.5, 132 | GoldenEye 007 for N64,9.8, 133 | Star Wars Battlefront (2015) for PS4,7.1, 134 | Halo 2 for XB,9.6, 135 | NBA 2K20 for PS4,7.8,1.2 136 | The Sims 3 for PC,8.5, 137 | Grand Theft Auto: Liberty City Stories for PSP,8.8, 138 | Pac-Man for 2600,9.0,7.4 139 | Pokemon Platinum Version for DS,8.3,8.9 140 | The Legend of Zelda: Ocarina of Time for N64,9.9,10.0 141 | God of War III for PS3,9.2,9.4 142 | Crash Bandicoot 2: Cortex Strikes Back for PS,8.6, 143 | Call of Duty: Advanced Warfare for PS4,8.5,5.7 144 | Call of Duty: World at War for X360,8.5,7.8 145 | Super Mario Bros. 2 for NES,8.5,8.1 146 | Super Mario Galaxy 2 for Wii,9.7,9.8 147 | Super Smash Bros. Melee for GC,9.2, 148 | Battlefield 3 for X360,8.5, 149 | The Legend of Zelda: Twilight Princess for Wii,9.5,9.6 150 | Battlefield 1 for PS4,9.1,7.9 151 | Battlefield 3 for PS3,8.5, 152 | Need for Speed Underground for PS2,8.6, 153 | The Binding of Isaac for PC,8.3,8.4 154 | FIFA 20 for PS4,7.9,1.1 155 | Crash Bandicoot 3: Warped for PS,9.3, 156 | Pokemon Emerald Version for GBA,7.7, 157 | Guild Wars 2 for PC,9.0,8.1 158 | Need for Speed Underground 2 for PS2,8.3, 159 | Mario Kart: Double Dash!! for GC,8.5, 160 | Medal of Honor: Frontline for PS2,9.0, 161 | Crash Bandicoot for PS,7.8, 162 | Uncharted 2: Among Thieves for PS3,9.5,9.6 163 | Call of Duty 4: Modern Warfare for PS3,9.5,9.6 164 | FIFA Soccer 12 for PS3,9.2, 165 | FIFA 14 for PS3,9.0, 166 | New Super Mario Bros. U Deluxe for NS,8.0,6.6 167 | Fallout 4 for PC,9.0,5.5 168 | Tomodachi Life for 3DS,7.8,7.6 169 | Red Dead Redemption for PS3,9.5, 170 | Donkey Kong Country Returns for Wii,8.6, 171 | The Legend of Zelda for NES,8.4,8.8 172 | Assassin's Creed III for PS3,8.8, 173 | Guild Wars for PC,8.7, 174 | Red Dead Redemption for X360,9.5,10.0 175 | The Elder Scrolls V: Skyrim for PS3,9.0, 176 | Final Fantasy XII for PS2,9.4,9.5 177 | Pokemon Crystal Version for GBC,8.7, 178 | Halo 3: ODST for X360,8.7, 179 | Minecraft for PS4,9.4, 180 | Luigi's Mansion 3 for NS,8.6,8.5 181 | FIFA 15 for PS4,8.1,5.7 182 | Kingdom Hearts for PS2,8.5, 183 | Myst for PC,8.9,8.0 184 | Driver for PS,8.5, 185 | Call of Duty: WWII for XOne,8.0,4.0 186 | Luigi's Mansion: Dark Moon for 3DS,8.6,8.5 187 | Big Brain Academy for DS,7.7, 188 | Minecraft for PS3,9.5, 189 | Metal Gear Solid 2: Sons of Liberty for PS2,9.5,7.0 190 | The Legend of Zelda: Ocarina of Time 3D for 3DS,9.3,9.0 191 | Metal Gear Solid 4: Guns of the Patriots for PS3,9.3,9.8 192 | Metal Gear Solid for PS,9.3, 193 | Cities: Skylines for PC,8.5,8.9 194 | Euro Truck Simulator 2 for PC,8.5,8.7 195 | Mario Kart: Super Circuit for GBA,9.3, 196 | Super Mario Sunshine for GC,9.2, 197 | Super Mario 3D World for WiiU,9.5,8.9 198 | Age of Empires II: HD Edition for PC,6.8,7.9 199 | New Super Mario Bros. U for WiiU,8.4,8.0 200 | Link's Crossbow Training for Wii,6.9, 201 | Red Dead Redemption 2 for XOne,9.7,7.4 202 | Destiny for PS4,7.6,6.1 203 | Tekken 2 for PS,9.1, 204 | Uncharted: The Nathan Drake Collection for PS4,8.6,8.5 205 | Super Mario World: Super Mario Advance 2 for GBA,9.4, 206 | LEGO Star Wars: The Complete Saga for Wii,8.0, 207 | Cooking Mama for DS,6.6, 208 | Super Mario Advance for GBA,8.2, 209 | Assassin's Creed II for PS3,9.0, 210 | Assassin's Creed for X360,8.2,8.0 211 | Super Smash Bros. for N64,8.4, 212 | Batman: Arkham City for PS3,9.6, 213 | Forza Motorsport 3 for X360,9.2,9.8 214 | Dragon Quest IX: Sentinels of the Starry Skies for DS,8.6, 215 | Final Fantasy IX for PS,9.2, 216 | Final Fantasy X-2 for PS2,8.3, 217 | Sid Meier's Civilization VI for PC,8.8,7.0 218 | Tomb Raider (2013) for PC,8.8, 219 | Super Mario Maker 2 for NS,8.8,8.5 220 | Pokemon Stadium for N64,7.5, 221 | Super Mario Advance 4: Super Mario Bros. 3 for GBA,9.2, 222 | Call of Duty: World at War for PS3,8.4, 223 | Crash Bandicoot: The Wrath of Cortex for PS2,6.9, 224 | Super Smash Bros. for Wii U for WiiU,9.2,8.9 225 | Final Fantasy XIII for PS3,8.0,9.2 226 | Gran Turismo 5 Prologue for PS3,8.3, 227 | Pokemon Pinball for GBC,8.7, 228 | Assassin's Creed III for X360,8.5, 229 | Assassin's Creed II for X360,9.1, 230 | The Forest for PC,8.3,7.3 231 | Donkey Kong 64 for N64,9.3, 232 | Just Dance 2 for Wii,7.3, 233 | Tomb Raider II for PS,7.6, 234 | Madden NFL 2004 for PS2,9.5, 235 | Call of Duty: Advanced Warfare for XOne,8.3,5.5 236 | Fallout: New Vegas for PC,8.3, 237 | Kingdom Hearts II for PS2,8.3, 238 | Nintendo Land for WiiU,7.8,7.9 239 | Super Mario Land 3: Wario Land for GB,7.9, 240 | Donkey Kong Country 2: Diddy's Kong Quest for SNES,9.3, 241 | Medal of Honor: Rising Sun for PS2,5.9, 242 | Battlefield 1 for XOne,9.3,7.6 243 | Microsoft Flight Simulator for PC,7.0, 244 | Guitar Hero II for PS2,9.2, 245 | Resident Evil 5 for PS3,8.6,8.8 246 | Fable III for X360,7.8, 247 | Mario & Sonic at the Olympic Games for DS,7.0, 248 | Grand Theft Auto: Vice City Stories for PSP,8.4, 249 | FIFA Soccer 11 for PS3,8.7, 250 | Final Fantasy XV for PS4,8.1,9.5 251 | Super Mario Bros. Deluxe for GB,9.7, 252 | Fallout 4 for XOne,8.4,6.4 253 | Tony Hawk's Pro Skater for PS,9.6, 254 | Warzone 2100 for PS,7.5, 255 | Spyro the Dragon for PS,8.7, 256 | Gears of War for X360,9.4,9.4 257 | Gears of War 2 for X360,9.4,9.5 258 | Halo 5: Guardians for XOne,8.6,6.4 259 | Halo: Combat Evolved for XB,9.5, 260 | Guitar Hero III: Legends of Rock for PS2,8.2, 261 | Uncharted: Drake's Fortune for PS3,8.7,8.6 262 | Resident Evil 2 for PS,9.3, 263 | Fallout 3 for X360,9.0,8.6 264 | Splatoon for WiiU,8.4,8.7 265 | Madden NFL 06 for PS2,9.1, 266 | Stardew Valley for PC,9.2,8.7 267 | Dragon Quest VIII: Journey of the Cursed King for PS2,8.6, 268 | Pokemon Mystery Dungeon: Explorers of Time / Darkness for DS,6.4, 269 | Diddy Kong Racing for N64,8.3, 270 | Crash Bandicoot N. Sane Trilogy for PS4,8.0,8.5 271 | Assassin's Creed for PS3,8.2,8.5 272 | Call of Duty: Infinite Warfare for XOne,7.8,3.6 273 | Crash Team Racing for PS,9.2, 274 | LEGO Star Wars: The Complete Saga for DS,7.8, 275 | The Legend of Zelda: Phantom Hourglass for DS,9.1, 276 | Batman: Arkham City for X360,9.5, 277 | Driver 2 for PS,7.0, 278 | The Simpsons: Hit & Run for PS2,7.7, 279 | World of Warcraft: Cataclysm for PC,9.0, 280 | Tony Hawk's Pro Skater 2 for PS,9.3, 281 | Gran Turismo for PSP,7.7,9.5 282 | The Lord of the Rings: The Two Towers for PS2,8.3, 283 | Tomb Raider for PS,8.9, 284 | God of War for PS2,9.3, 285 | The Legend of Zelda: A Link to the Past for SNES,10.0, 286 | Left 4 Dead for PC,8.6,8.5 287 | Guitar Hero III: Legends of Rock for Wii,8.6, 288 | Forza Motorsport 4 for X360,9.1, 289 | Nintendogs + cats for 3DS,7.2, 290 | "Pokemon: Let's Go, Pikachu! for NS",8.3,6.1 291 | BioShock Infinite for PC,9.5,8.6 292 | Mario & Luigi: Bowser's Inside Story for DS,9.1, 293 | FIFA 15 for PS3,6.9, 294 | Overwatch for PS4,8.8,6.4 295 | Mario & Sonic at the Olympic Winter Games for Wii,6.8, 296 | Madden NFL 2005 for PS2,9.5, 297 | Guitar Hero III: Legends of Rock for X360,8.7, 298 | Dead Island for PC,7.1,6.9 299 | Warcraft III: Reign of Chaos for PC,9.3, 300 | StarCraft II: Wings of Liberty for PC,9.3, 301 | LittleBigPlanet for PS3,9.4,9.2 302 | ARK: Survival Evolved for PC,7.0,5.2 303 | Professor Layton and the Curious Village for DS,8.7, 304 | Madden NFL 07 for PS2,8.5, 305 | Spider-Man: The Movie for PS2,8.2, 306 | The Elder Scrolls IV: Oblivion for X360,9.2, 307 | The Legend of Zelda: The Wind Waker for GC,9.6, 308 | Tony Hawk's Pro Skater 3 for PS2,9.1, 309 | Winning Eleven: Pro Evolution Soccer 2007 for PS2,8.8, 310 | The Legend of Zelda: Link's Awakening for NS,8.7,8.4 311 | Michael Jackson: The Experience for Wii,5.6, 312 | Tom Clancy's The Division for PS4,8.0,7.0 313 | Need for Speed: Most Wanted for PS2,8.6, 314 | Resistance: Fall of Man for PS3,8.5,9.1 315 | Call of Duty: Advanced Warfare for X360,9.1, 316 | Animal Crossing: City Folk for Wii,7.1,8.8 317 | Watch Dogs for PS4,8.0,6.4 318 | Starbound for PC,8.1,7.1 319 | Asteroids for 2600,7.6,7.8 320 | Dragon Quest VII for PS,8.0,3.0 321 | Monster Hunter Generations for 3DS,8.8,8.0 322 | The Witcher 3: Wild Hunt for XOne,9.1,9.2 323 | Batman: Arkham Asylum for PS3,9.0, 324 | Call of Duty: Advanced Warfare for PS3,9.1, 325 | Namco Museum for GBA,8.5, 326 | God of War II for PS2,9.3,9.8 327 | Daxter for PSP,8.6, 328 | Super Paper Mario for Wii,8.5, 329 | Assassin's Creed: Revelations for PS3,8.8, 330 | Metal Gear Solid 3: Snake Eater for PS2,9.0, 331 | Assassin's Creed: Revelations for X360,7.9, 332 | FIFA Soccer 06 for PS2,8.4, 333 | Counter-Strike for PC,8.9, 334 | Monster Hunter 4 Ultimate for 3DS,8.8,8.6 335 | Mortal Kombat 11 for PS4,8.2,3.6 336 | Street Fighter IV for PS3,9.3,9.0 337 | FIFA Soccer 12 for X360,9.2, 338 | Call of Duty: Ghosts for PS4,7.5,3.8 339 | Teenage Mutant Ninja Turtles for NES,5.9, 340 | Just Cause 2 for PC,8.2, 341 | Excitebike for NES,8.4, 342 | Frogger for PS,2.0, 343 | Star Wars Battlefront (2015) for XOne,6.9, 344 | FIFA 14 for X360,9.1, 345 | Destiny 2 for PS4,8.5,4.9 346 | Madden NFL 2003 for PS2,9.4, 347 | Super Mario World 2: Yoshi's Island for SNES,9.0, 348 | Batman: Arkham Knight for PS4,8.1,7.8 349 | FIFA 07 Soccer for PS2,8.4, 350 | The Sims 4 for PC,7.0,4.0 351 | Street Fighter II Turbo for SNES,9.0, 352 | Fallout: New Vegas for X360,8.2, 353 | The Legend of Zelda: A Link Between Worlds for 3DS,9.3,9.0 354 | Far Cry 4 for PS4,8.4,7.7 355 | Carnival Games for Wii,4.2, 356 | World Soccer Winning Eleven 9 for PS2,8.9, 357 | Assassin's Creed Origins for PS4,8.1,7.2 358 | Forza Motorsport 2 for X360,9.1, 359 | Tekken Tag Tournament for PS2,8.7, 360 | Super Mario Maker for WiiU,8.8,8.7 361 | Monster Hunter: World for PS4,9.3,9.0 362 | Fallout 3 for PS3,8.8, 363 | The Last of Us: Part II for PS4,9.4,5.6 364 | Star Fox 64 for N64,9.0, 365 | World of Warcraft: Wrath of the Lich King for PC,9.3,9.3 366 | Just Dance for Wii,5.4, 367 | Diablo II for PC,8.8, 368 | EyeToy Play for PS2,7.5, 369 | The Elder Scrolls V: Skyrim for PC,9.2,8.2 370 | Namco Museum: 50th Anniversary for PS2,5.0, 371 | NBA 2K16 for PS4,8.7,6.7 372 | Left 4 Dead 2 for X360,9.0, 373 | Far Cry 5 for PS4,7.9,6.8 374 | Assassin's Creed IV: Black Flag for PS3,8.7, 375 | Battlefield 4 for PS4,8.3,7.0 376 | EA Sports Active for Wii,8.3, 377 | Half-Life 2: Episode One for PC,8.7, 378 | Dragon Quest III for NES,,8.0 379 | Tony Hawk's Underground for PS2,8.7, 380 | Just Dance 2014 for Wii,7.4, 381 | Professor Layton and the Diabolical Box for DS,8.5, 382 | Sports Champions for PS3,7.6, 383 | World Soccer Winning Eleven 8 International for PS2,9.3, 384 | Resident Evil VII: Biohazard for PS4,8.6, 385 | Monster Hunter Freedom Unite for PSP,7.7,9.7 386 | Madden NFL 20 for PS4,7.6,1.5 387 | Gran Turismo Sport for PS4,7.5,6.0 388 | LEGO Indiana Jones: The Original Adventures for X360,7.5, 389 | The Sims: Unleashed for PC,7.3, 390 | Ratchet & Clank: Size Matters for PSP,8.5, 391 | Harry Potter and the Sorcerer's Stone for PS,8.0, 392 | Pokemon Trading Card Game for GB,8.3, 393 | FIFA 17 for XOne,8.8,5.1 394 | Spyro: Year of the Dragon for PS,9.1, 395 | FIFA Soccer 2005 for PS2,8.4, 396 | Diablo III: Reaper of Souls for PC,8.7,6.6 397 | The Legend of Zelda: Skyward Sword for Wii,9.4, 398 | Tony Hawk's Pro Skater 4 for PS2,9.6, 399 | MySims for DS,6.7, 400 | Midnight Club 3: DUB Edition for PSP,7.2, 401 | Banjo-Kazooie for N64,9.3,9.4 402 | -------------------------------------------------------------------------------- /Analyzing NYC Public School Test Result Scores/notebook.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"dc":{"key":"4"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 1. Inspecting the data\n

\"New

\n

Photo by Jannis Lucas on Unsplash.\n

\n

Every year, American high school students take SATs, which are standardized tests intended to measure literacy, numeracy, and writing skills. There are three sections - reading, math, and writing, each with a maximum score of 800 points. These tests are extremely important for students and colleges, as they play a pivotal role in the admissions process.

\n

Analyzing the performance of schools is important for a variety of stakeholders, including policy and education professionals, researchers, government, and even parents considering which school their children should attend.

\n

In this notebook, we will take a look at data on SATs across public schools in New York City. Our database contains a single table:

\n

schools

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypedescription
school_namevarcharName of school
boroughvarcharBorough that the school is located in
building_codevarcharCode for the building
average_mathintAverage math score for SATs
average_readingintAverage reading score for SATs
average_writingintAverage writing score for SATs
percent_testednumericPercentage of students completing SATs
\n

Let's familiarize ourselves with the data by taking a looking at the first few schools!

"},{"metadata":{"dc":{"key":"4"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\npostgresql:///schools\n \n-- Select all columns from the database\n-- Display only the first ten rows\nSELECT *\nFROM schools\nLIMIT 10;","execution_count":2,"outputs":[{"output_type":"stream","text":"10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":2,"data":{"text/plain":"[('New Explorations into Science, Technology and Math High School', 'Manhattan', 'M022', 657, 601, 601, None),\n ('Essex Street Academy', 'Manhattan', 'M445', 395, 411, 387, 78.9),\n ('Lower Manhattan Arts Academy', 'Manhattan', 'M445', 418, 428, 415, 65.1),\n ('High School for Dual Language and Asian Studies', 'Manhattan', 'M445', 613, 453, 463, 95.9),\n ('Henry Street School for International Studies', 'Manhattan', 'M056', 410, 406, 381, 59.7),\n ('Bard High School Early College', 'Manhattan', 'M097', 634, 641, 639, 70.8),\n ('Urban Assembly Academy of Government and Law', 'Manhattan', 'M445', 389, 395, 381, 80.8),\n ('Marta Valle High School', 'Manhattan', 'M025', 438, 413, 394, 35.6),\n ('University Neighborhood High School', 'Manhattan', 'M446', 437, 355, 352, 69.9),\n ('New Design High School', 'Manhattan', 'M445', 381, 396, 372, 73.7)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
school_nameboroughbuilding_codeaverage_mathaverage_readingaverage_writingpercent_tested
New Explorations into Science, Technology and Math High SchoolManhattanM022657601601None
Essex Street AcademyManhattanM44539541138778.9
Lower Manhattan Arts AcademyManhattanM44541842841565.1
High School for Dual Language and Asian StudiesManhattanM44561345346395.9
Henry Street School for International StudiesManhattanM05641040638159.7
Bard High School Early CollegeManhattanM09763464163970.8
Urban Assembly Academy of Government and LawManhattanM44538939538180.8
Marta Valle High SchoolManhattanM02543841339435.6
University Neighborhood High SchoolManhattanM44643735535269.9
New Design High SchoolManhattanM44538139637273.7
"},"metadata":{}}]},{"metadata":{"dc":{"key":"11"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 2. Finding missing values\n

It looks like the first school in our database had no data in the percent_tested column!

\n

Let's identify how many schools have missing data for this column, indicating schools that did not report the percentage of students tested.

\n

To understand whether this missing data problem is widespread in New York, we will also calculate the total number of schools in the database.

"},{"metadata":{"dc":{"key":"11"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Count rows with percent_tested missing and total number of schools\nSELECT \n COUNT(school_name) - COUNT(percent_tested) AS num_tested_missing,\n COUNT(school_name) AS num_schools\nFROM schools;","execution_count":4,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":4,"data":{"text/plain":"[(20, 375)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n
num_tested_missingnum_schools
20375
"},"metadata":{}}]},{"metadata":{"dc":{"key":"18"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 3. Schools by building code\n

There are 20 schools with missing data for percent_tested, which only makes up 5% of all rows in the database.

\n

Now let's turn our attention to how many schools there are. When we displayed the first ten rows of the database, several had the same value in the building_code column, suggesting there are multiple schools based in the same location. Let's find out how many unique school locations exist in our database.

"},{"metadata":{"dc":{"key":"18"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Count the number of unique building_code values\nSELECT COUNT(DISTINCT building_code) AS num_school_buildings\nFROM schools;","execution_count":6,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":6,"data":{"text/plain":"[(233,)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n
num_school_buildings
233
"},"metadata":{}}]},{"metadata":{"dc":{"key":"25"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 4. Best schools for math\n

Out of 375 schools, only 233 (62%) have a unique building_code!

\n

Now let's start our analysis of school performance. As each school reports individually, we will treat them this way rather than grouping them by building_code.

\n

First, let's find all schools with an average math score of at least 80% (out of 800).

"},{"metadata":{"dc":{"key":"25"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Select school and average_math\n-- Filter for average_math 640 or higher\n-- Display from largest to smallest average_math\n\nSELECT \n school_name,\n average_math\nFROM schools\nWHERE average_math >= 640\nORDER BY average_math DESC;","execution_count":8,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":8,"data":{"text/plain":"[('Stuyvesant High School', 754),\n ('Bronx High School of Science', 714),\n ('Staten Island Technical High School', 711),\n ('Queens High School for the Sciences at York College', 701),\n ('High School for Mathematics, Science, and Engineering at City College', 683),\n ('Brooklyn Technical High School', 682),\n ('Townsend Harris High School', 680),\n ('High School of American Studies at Lehman College', 669),\n ('New Explorations into Science, Technology and Math High School', 657),\n ('Eleanor Roosevelt High School', 641)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
school_nameaverage_math
Stuyvesant High School754
Bronx High School of Science714
Staten Island Technical High School711
Queens High School for the Sciences at York College701
High School for Mathematics, Science, and Engineering at City College683
Brooklyn Technical High School682
Townsend Harris High School680
High School of American Studies at Lehman College669
New Explorations into Science, Technology and Math High School657
Eleanor Roosevelt High School641
"},"metadata":{}}]},{"metadata":{"dc":{"key":"32"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 5. Lowest reading score\n

Wow, there are only ten public schools in New York City with an average math score of at least 640!

\n

Now let's look at the other end of the spectrum and find the single lowest score for reading. We will only select the score, not the school, to avoid naming and shaming!

"},{"metadata":{"dc":{"key":"32"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Find lowest average_reading\n\nSELECT MIN(average_reading) AS lowest_reading\nFROM schools;","execution_count":10,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":10,"data":{"text/plain":"[(302,)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n
lowest_reading
302
"},"metadata":{}}]},{"metadata":{"dc":{"key":"39"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 6. Best writing school\n

The lowest average score for reading across schools in New York City is less than 40% of the total available points!

\n

Now let's find the school with the highest average writing score.

"},{"metadata":{"dc":{"key":"39"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Find the top score for average_writing\n-- Group the results by school\n-- Sort by max_writing in descending order\n-- Reduce output to one school\n\nSELECT \n school_name,\n MAX(average_writing) AS max_writing\nFROM schools\nGROUP BY school_name\nORDER BY max_writing DESC\nLIMIT 1;","execution_count":12,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":12,"data":{"text/plain":"[('Stuyvesant High School', 693)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n
school_namemax_writing
Stuyvesant High School693
"},"metadata":{}}]},{"metadata":{"dc":{"key":"46"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 7. Top 10 schools\n

An average writing score of 693 is pretty impressive!

\n

This top writing score was at the same school that got the top math score, Stuyvesant High School. Stuyvesant is widely known as a perennial top school in New York.

\n

What other schools are also excellent across the board? Let's look at scores across reading, writing, and math to find out.

"},{"metadata":{"dc":{"key":"46"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Calculate average_sat\n-- Group by school_name\n-- Sort by average_sat in descending order\n-- Display the top ten results\n\nSELECT\n school_name,\n SUM(average_math) + SUM(average_reading) + SUM(average_writing) AS average_sat\nFROM schools\nGROUP BY school_name\nORDER BY average_sat DESC\nLIMIT 10;","execution_count":14,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":14,"data":{"text/plain":"[('Stuyvesant High School', 2144),\n ('Staten Island Technical High School', 2041),\n ('Bronx High School of Science', 2041),\n ('High School of American Studies at Lehman College', 2013),\n ('Townsend Harris High School', 1981),\n ('Queens High School for the Sciences at York College', 1947),\n ('Bard High School Early College', 1914),\n ('Brooklyn Technical High School', 1896),\n ('Eleanor Roosevelt High School', 1889),\n ('High School for Mathematics, Science, and Engineering at City College', 1889)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
school_nameaverage_sat
Stuyvesant High School2144
Staten Island Technical High School2041
Bronx High School of Science2041
High School of American Studies at Lehman College2013
Townsend Harris High School1981
Queens High School for the Sciences at York College1947
Bard High School Early College1914
Brooklyn Technical High School1896
Eleanor Roosevelt High School1889
High School for Mathematics, Science, and Engineering at City College1889
"},"metadata":{}}]},{"metadata":{"dc":{"key":"53"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 8. Ranking boroughs\n

There are four schools with average SAT scores of over 2000! Now let's analyze performance by New York City borough.

\n

We will build a query that calculates the number of schools and the average SAT score per borough!

"},{"metadata":{"dc":{"key":"53"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Select borough and a count of all schools, aliased as num_schools\n-- Calculate the sum of average_math, average_reading, and average_writing, divided by a count of all schools, aliased as average_borough_sat\n-- Organize results by borough\n-- Display by average_borough_sat in descending order\n\nSELECT \n borough,\n COUNT(school_name) AS num_schools,\n (SUM(average_math) + SUM(average_reading) + SUM(average_writing))/COUNT(school_name) AS average_borough_sat\nFROM schools\nGROUP BY borough\nORDER BY average_borough_sat DESC;","execution_count":16,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n5 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":16,"data":{"text/plain":"[('Staten Island', 10, 1439),\n ('Queens', 69, 1345),\n ('Manhattan', 89, 1340),\n ('Brooklyn', 109, 1230),\n ('Bronx', 98, 1202)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
boroughnum_schoolsaverage_borough_sat
Staten Island101439
Queens691345
Manhattan891340
Brooklyn1091230
Bronx981202
"},"metadata":{}}]},{"metadata":{"dc":{"key":"60"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 9. Brooklyn numbers\n

It appears that schools in Staten Island, on average, produce higher scores across all three categories. However, there are only 10 schools in Staten Island, compared to an average of 91 schools in the other four boroughs!

\n

For our final query of the database, let's focus on Brooklyn, which has 109 schools. We wish to find the top five schools for math performance.

"},{"metadata":{"dc":{"key":"60"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Select school and average_math\n-- Filter for schools in Brooklyn\n-- Aggregate on school_name\n-- Display results from highest average_math and restrict output to five rows\n\nSELECT \n school_name,\n average_math\nFROM schools\nWHERE borough = 'Brooklyn'\nORDER BY average_math DESC\nLIMIT 5;","execution_count":18,"outputs":[{"output_type":"stream","text":" * postgresql:///schools\n5 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":18,"data":{"text/plain":"[('Brooklyn Technical High School', 682),\n ('Brooklyn Latin School', 625),\n ('Leon M. Goldstein High School for the Sciences', 563),\n ('Millennium Brooklyn High School', 553),\n ('Midwood High School', 550)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
school_nameaverage_math
Brooklyn Technical High School682
Brooklyn Latin School625
Leon M. Goldstein High School for the Sciences563
Millennium Brooklyn High School553
Midwood High School550
"},"metadata":{}}]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.7","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":2} 2 | -------------------------------------------------------------------------------- /Analyzing Motorcycle Part Sales/notebook.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"source":"
\"Image
\n\nYou're working for a company that sells motorcycle parts, and they've asked with some help in analyzing their sales data!\n\nThey operate three warehouses in the area, selling both retail and wholesale. They offer a variety of parts and accept credit card, cash, and bank transfer as payment methods. However, each payment type incurs a different fee.\n\nThe board of directors want to gain a better understanding of wholesale revenue by product line, and how this varies month-to-month and across warehouses. You have been tasked with calculating net revenue for each product line, grouping results by month and warehouse. The results should be filtered so that only `\"Wholesale\"` orders are included.\n\nThey have provided you with access to their database, which contains the following table called `sales`:\n\n| Column | Data type | Description |\n|--------|-----------|-------------|\n| `order_number` | `VARCHAR` | Unique order number. |\n| `date` | `DATE` | Date of the order, from June to August 2021. |\n| `warehouse` | `VARCHAR` | The warehouse that the order was made from— `North`, `Central`, or `West`. |\n| `client_type` | `VARCHAR` | Whether the order was `Retail` or `Wholesale`. |\n| `product_line` | `VARCHAR` | Type of product ordered. |\n| `quantity` | `INT` | Number of products ordered. | \n| `unit_price` | `FLOAT` | Price per product (dollars). |\n| `total` | `FLOAT` | Total price of the order (dollars). |\n| `payment` | `VARCHAR` | Payment method—`Credit card`, `Transfer`, or `Cash`. |\n| `payment_fee` | `FLOAT` | Percentage of `total` charged as a result of the `payment` method. |\n\n\nYour query output should be presented in the following format:\n\n| `product_line` | `month` | `warehouse` |\t`net_revenue` |\n|----------------|-----------|----------------------------|--------------|\n| product_one | --- | --- | --- |\n| product_one | --- | --- | --- |\n| product_one | --- | --- | --- |\n| product_one | --- | --- | --- |\n| product_one | --- | --- | --- |\n| product_one | --- | --- | --- |\n| product_two | --- | --- | --- |\n| ... | ... | ... | ... |\n\n","metadata":{},"id":"13335817","cell_type":"markdown"},{"source":"**1. Explore the data**","metadata":{},"cell_type":"markdown","id":"f237c35c-4a96-46b5-b1bb-46c5ffe409d2"},{"source":"SELECT *\nFROM sales\nLIMIT 5","metadata":{"customType":"sql","dataFrameVariableName":"df","initial":false,"integrationId":"89e17161-a224-4a8a-846b-0adc0fe7a4b1","queuedAt":1667575034271,"executionStartedAt":1667575034533,"executionStoppedAt":1667575035860,"lastSuccessfullyExecutedCode":"SELECT *\nFROM sales\nLIMIT 5"},"cell_type":"code","id":"b95b9486-1ef7-44f4-9b45-7eac642bbf6a","execution_count":11,"outputs":[{"output_type":"execute_result","execution_count":11,"data":{"application/com.datacamp.data-table.v1+json":{"table":{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"order_number","type":"string"},{"name":"date","type":"datetime","tz":"UTC"},{"name":"warehouse","type":"string"},{"name":"client_type","type":"string"},{"name":"product_line","type":"string"},{"name":"quantity","type":"integer"},{"name":"unit_price","type":"number"},{"name":"total","type":"number"},{"name":"payment","type":"string"},{"name":"payment_fee","type":"number"}],"primaryKey":["index"],"pandas_version":"1.4.0"},"data":[{"index":0,"order_number":"N1","date":"2021-06-01T00:00:00.000Z","warehouse":"North","client_type":"Retail","product_line":"Breaking system","quantity":9,"unit_price":19.29,"total":173.61,"payment":"Cash","payment_fee":0},{"index":1,"order_number":"N2","date":"2021-06-01T00:00:00.000Z","warehouse":"North","client_type":"Retail","product_line":"Suspension & traction","quantity":8,"unit_price":32.93,"total":263.45,"payment":"Credit card","payment_fee":0.03},{"index":2,"order_number":"N3","date":"2021-06-01T00:00:00.000Z","warehouse":"North","client_type":"Wholesale","product_line":"Frame & body","quantity":16,"unit_price":37.84,"total":605.44,"payment":"Transfer","payment_fee":0.01},{"index":3,"order_number":"N4","date":"2021-06-01T00:00:00.000Z","warehouse":"North","client_type":"Wholesale","product_line":"Suspension & traction","quantity":40,"unit_price":37.37,"total":1494.8,"payment":"Transfer","payment_fee":0.01},{"index":4,"order_number":"N5","date":"2021-06-01T00:00:00.000Z","warehouse":"North","client_type":"Retail","product_line":"Frame & body","quantity":6,"unit_price":45.44,"total":272.61,"payment":"Credit card","payment_fee":0.03}]},"total_rows":5,"truncation_type":null},"text/plain":" order_number date warehouse client_type \\\n0 N1 2021-06-01 00:00:00+00:00 North Retail \n1 N2 2021-06-01 00:00:00+00:00 North Retail \n2 N3 2021-06-01 00:00:00+00:00 North Wholesale \n3 N4 2021-06-01 00:00:00+00:00 North Wholesale \n4 N5 2021-06-01 00:00:00+00:00 North Retail \n\n product_line quantity unit_price total payment \\\n0 Breaking system 9 19.29 173.61 Cash \n1 Suspension & traction 8 32.93 263.45 Credit card \n2 Frame & body 16 37.84 605.44 Transfer \n3 Suspension & traction 40 37.37 1494.80 Transfer \n4 Frame & body 6 45.44 272.61 Credit card \n\n payment_fee \n0 0.00 \n1 0.03 \n2 0.01 \n3 0.01 \n4 0.03 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
order_numberdatewarehouseclient_typeproduct_linequantityunit_pricetotalpaymentpayment_fee
0N12021-06-01 00:00:00+00:00NorthRetailBreaking system919.29173.61Cash0.00
1N22021-06-01 00:00:00+00:00NorthRetailSuspension & traction832.93263.45Credit card0.03
2N32021-06-01 00:00:00+00:00NorthWholesaleFrame & body1637.84605.44Transfer0.01
3N42021-06-01 00:00:00+00:00NorthWholesaleSuspension & traction4037.371494.80Transfer0.01
4N52021-06-01 00:00:00+00:00NorthRetailFrame & body645.44272.61Credit card0.03
\n
"},"metadata":{}}]},{"source":"**2. Solution**","metadata":{},"cell_type":"markdown","id":"5149488b-85fb-4ee7-a539-b6842ea8dd30"},{"source":"SELECT \n\tproduct_line,\n CASE WHEN DATE_PART('month', date) = 6 THEN 'June'\n WHEN DATE_PART('month', date) = 7 THEN 'July'\n WHEN DATE_PART('month', date) = 8 THEN 'August'\n END as month,\n warehouse,\n ROUND(CAST(SUM(total * (1 - payment_fee)) AS NUMERIC), 2) AS net_revenue\nFROM sales\nWHERE client_type = 'Wholesale'\nGROUP BY product_line, warehouse, month\nORDER BY product_line, month, net_revenue DESC","metadata":{"customType":"sql","dataFrameVariableName":"df","initial":false,"integrationId":"89e17161-a224-4a8a-846b-0adc0fe7a4b1","queuedAt":1667575034280,"executionStartedAt":1667575035881,"executionStoppedAt":1667575036919,"lastSuccessfullyExecutedCode":"SELECT \n\tproduct_line,\n CASE WHEN DATE_PART('month', date) = 6 THEN 'June'\n WHEN DATE_PART('month', date) = 7 THEN 'July'\n WHEN DATE_PART('month', date) = 8 THEN 'August'\n END as month,\n warehouse,\n ROUND(CAST(SUM(total * (1 - payment_fee)) AS NUMERIC), 2) AS net_revenue\nFROM sales\nWHERE client_type = 'Wholesale'\nGROUP BY product_line, warehouse, month\nORDER BY product_line, month, net_revenue DESC"},"id":"ff58f388","cell_type":"code","execution_count":12,"outputs":[{"output_type":"execute_result","execution_count":12,"data":{"application/com.datacamp.data-table.v1+json":{"table":{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"product_line","type":"string"},{"name":"month","type":"string"},{"name":"warehouse","type":"string"},{"name":"net_revenue","type":"number"}],"primaryKey":["index"],"pandas_version":"1.4.0"},"data":[{"index":0,"product_line":"Breaking system","month":"August","warehouse":"Central","net_revenue":3009.1},{"index":1,"product_line":"Breaking system","month":"August","warehouse":"West","net_revenue":2475.71},{"index":2,"product_line":"Breaking system","month":"August","warehouse":"North","net_revenue":1753.19},{"index":3,"product_line":"Breaking system","month":"July","warehouse":"Central","net_revenue":3740.94},{"index":4,"product_line":"Breaking system","month":"July","warehouse":"West","net_revenue":3030.39},{"index":5,"product_line":"Breaking system","month":"July","warehouse":"North","net_revenue":2568.55},{"index":6,"product_line":"Breaking system","month":"June","warehouse":"Central","net_revenue":3648.14},{"index":7,"product_line":"Breaking system","month":"June","warehouse":"North","net_revenue":1472.93},{"index":8,"product_line":"Breaking system","month":"June","warehouse":"West","net_revenue":1200.64},{"index":9,"product_line":"Electrical system","month":"August","warehouse":"North","net_revenue":4673.99},{"index":10,"product_line":"Electrical system","month":"August","warehouse":"Central","net_revenue":3095.22},{"index":11,"product_line":"Electrical system","month":"August","warehouse":"West","net_revenue":1229.45},{"index":12,"product_line":"Electrical system","month":"July","warehouse":"Central","net_revenue":5521.94},{"index":13,"product_line":"Electrical system","month":"July","warehouse":"North","net_revenue":1693.06},{"index":14,"product_line":"Electrical system","month":"July","warehouse":"West","net_revenue":444.98},{"index":15,"product_line":"Electrical system","month":"June","warehouse":"Central","net_revenue":2875.93},{"index":16,"product_line":"Electrical system","month":"June","warehouse":"North","net_revenue":2002.3},{"index":17,"product_line":"Engine","month":"August","warehouse":"Central","net_revenue":9433.48},{"index":18,"product_line":"Engine","month":"August","warehouse":"North","net_revenue":2300.96},{"index":19,"product_line":"Engine","month":"July","warehouse":"Central","net_revenue":1808.77},{"index":20,"product_line":"Engine","month":"July","warehouse":"North","net_revenue":997.08},{"index":21,"product_line":"Engine","month":"June","warehouse":"Central","net_revenue":6483.4},{"index":22,"product_line":"Frame & body","month":"August","warehouse":"Central","net_revenue":8571.5},{"index":23,"product_line":"Frame & body","month":"August","warehouse":"North","net_revenue":7819.95},{"index":24,"product_line":"Frame & body","month":"August","warehouse":"West","net_revenue":821.4},{"index":25,"product_line":"Frame & body","month":"July","warehouse":"North","net_revenue":6093.11},{"index":26,"product_line":"Frame & body","month":"July","warehouse":"Central","net_revenue":3103.82},{"index":27,"product_line":"Frame & body","month":"June","warehouse":"Central","net_revenue":5060.29},{"index":28,"product_line":"Frame & body","month":"June","warehouse":"North","net_revenue":4861.08},{"index":29,"product_line":"Frame & body","month":"June","warehouse":"West","net_revenue":2751.96},{"index":30,"product_line":"Miscellaneous","month":"August","warehouse":"North","net_revenue":1823.03},{"index":31,"product_line":"Miscellaneous","month":"August","warehouse":"Central","net_revenue":1722.4},{"index":32,"product_line":"Miscellaneous","month":"August","warehouse":"West","net_revenue":805.31},{"index":33,"product_line":"Miscellaneous","month":"July","warehouse":"Central","net_revenue":3087.31},{"index":34,"product_line":"Miscellaneous","month":"July","warehouse":"North","net_revenue":2380.63},{"index":35,"product_line":"Miscellaneous","month":"July","warehouse":"West","net_revenue":1145.26},{"index":36,"product_line":"Miscellaneous","month":"June","warehouse":"West","net_revenue":2258.2},{"index":37,"product_line":"Miscellaneous","month":"June","warehouse":"Central","net_revenue":1859.34},{"index":38,"product_line":"Miscellaneous","month":"June","warehouse":"North","net_revenue":508.86},{"index":39,"product_line":"Suspension & traction","month":"August","warehouse":"Central","net_revenue":5362.59},{"index":40,"product_line":"Suspension & traction","month":"August","warehouse":"North","net_revenue":4874.51},{"index":41,"product_line":"Suspension & traction","month":"August","warehouse":"West","net_revenue":1069.99},{"index":42,"product_line":"Suspension & traction","month":"July","warehouse":"Central","net_revenue":6392.23},{"index":43,"product_line":"Suspension & traction","month":"July","warehouse":"North","net_revenue":3677.21},{"index":44,"product_line":"Suspension & traction","month":"July","warehouse":"West","net_revenue":2909.98},{"index":45,"product_line":"Suspension & traction","month":"June","warehouse":"North","net_revenue":7985.17},{"index":46,"product_line":"Suspension & traction","month":"June","warehouse":"Central","net_revenue":3291.8},{"index":47,"product_line":"Suspension & traction","month":"June","warehouse":"West","net_revenue":2348.83}]},"total_rows":48,"truncation_type":null},"text/plain":" product_line month warehouse net_revenue\n0 Breaking system August Central 3009.10\n1 Breaking system August West 2475.71\n2 Breaking system August North 1753.19\n3 Breaking system July Central 3740.94\n4 Breaking system July West 3030.39\n5 Breaking system July North 2568.55\n6 Breaking system June Central 3648.14\n7 Breaking system June North 1472.93\n8 Breaking system June West 1200.64\n9 Electrical system August North 4673.99\n10 Electrical system August Central 3095.22\n11 Electrical system August West 1229.45\n12 Electrical system July Central 5521.94\n13 Electrical system July North 1693.06\n14 Electrical system July West 444.98\n15 Electrical system June Central 2875.93\n16 Electrical system June North 2002.30\n17 Engine August Central 9433.48\n18 Engine August North 2300.96\n19 Engine July Central 1808.77\n20 Engine July North 997.08\n21 Engine June Central 6483.40\n22 Frame & body August Central 8571.50\n23 Frame & body August North 7819.95\n24 Frame & body August West 821.40\n25 Frame & body July North 6093.11\n26 Frame & body July Central 3103.82\n27 Frame & body June Central 5060.29\n28 Frame & body June North 4861.08\n29 Frame & body June West 2751.96\n30 Miscellaneous August North 1823.03\n31 Miscellaneous August Central 1722.40\n32 Miscellaneous August West 805.31\n33 Miscellaneous July Central 3087.31\n34 Miscellaneous July North 2380.63\n35 Miscellaneous July West 1145.26\n36 Miscellaneous June West 2258.20\n37 Miscellaneous June Central 1859.34\n38 Miscellaneous June North 508.86\n39 Suspension & traction August Central 5362.59\n40 Suspension & traction August North 4874.51\n41 Suspension & traction August West 1069.99\n42 Suspension & traction July Central 6392.23\n43 Suspension & traction July North 3677.21\n44 Suspension & traction July West 2909.98\n45 Suspension & traction June North 7985.17\n46 Suspension & traction June Central 3291.80\n47 Suspension & traction June West 2348.83","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
product_linemonthwarehousenet_revenue
0Breaking systemAugustCentral3009.10
1Breaking systemAugustWest2475.71
2Breaking systemAugustNorth1753.19
3Breaking systemJulyCentral3740.94
4Breaking systemJulyWest3030.39
5Breaking systemJulyNorth2568.55
6Breaking systemJuneCentral3648.14
7Breaking systemJuneNorth1472.93
8Breaking systemJuneWest1200.64
9Electrical systemAugustNorth4673.99
10Electrical systemAugustCentral3095.22
11Electrical systemAugustWest1229.45
12Electrical systemJulyCentral5521.94
13Electrical systemJulyNorth1693.06
14Electrical systemJulyWest444.98
15Electrical systemJuneCentral2875.93
16Electrical systemJuneNorth2002.30
17EngineAugustCentral9433.48
18EngineAugustNorth2300.96
19EngineJulyCentral1808.77
20EngineJulyNorth997.08
21EngineJuneCentral6483.40
22Frame & bodyAugustCentral8571.50
23Frame & bodyAugustNorth7819.95
24Frame & bodyAugustWest821.40
25Frame & bodyJulyNorth6093.11
26Frame & bodyJulyCentral3103.82
27Frame & bodyJuneCentral5060.29
28Frame & bodyJuneNorth4861.08
29Frame & bodyJuneWest2751.96
30MiscellaneousAugustNorth1823.03
31MiscellaneousAugustCentral1722.40
32MiscellaneousAugustWest805.31
33MiscellaneousJulyCentral3087.31
34MiscellaneousJulyNorth2380.63
35MiscellaneousJulyWest1145.26
36MiscellaneousJuneWest2258.20
37MiscellaneousJuneCentral1859.34
38MiscellaneousJuneNorth508.86
39Suspension & tractionAugustCentral5362.59
40Suspension & tractionAugustNorth4874.51
41Suspension & tractionAugustWest1069.99
42Suspension & tractionJulyCentral6392.23
43Suspension & tractionJulyNorth3677.21
44Suspension & tractionJulyWest2909.98
45Suspension & tractionJuneNorth7985.17
46Suspension & tractionJuneCentral3291.80
47Suspension & tractionJuneWest2348.83
\n
"},"metadata":{}}]}],"metadata":{"celltoolbar":"Raw Cell Format","kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.8.10","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"toc":{"base_numbering":1,"nav_menu":{},"number_sections":true,"sideBar":true,"skip_h1_title":true,"title_cell":"Table of Contents","title_sidebar":"Contents","toc_cell":false,"toc_position":{},"toc_section_display":true,"toc_window_display":true},"vscode":{"interpreter":{"hash":"4c28dce1b92814dac96c640b6c1f64aef8100cfec6687e74ab3caef459440498"}},"editor":"DataCamp Workspace"},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Analyze International Debt Statistics/notebook.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"dc":{"key":"4"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 1. The World Bank's international debt data\n

It's not that we humans only take debts to manage our necessities. A country may also take debt to manage its economy. For example, infrastructure spending is one costly ingredient required for a country's citizens to lead comfortable lives. The World Bank is the organization that provides debt to countries.

\n

In this notebook, we are going to analyze international debt data collected by The World Bank. The dataset contains information about the amount of debt (in USD) owed by developing countries across several categories. We are going to find the answers to questions like:

\n\n

\n

The first line of code connects us to the international_debt database where the table international_debt is residing. Let's first SELECT all of the columns from the international_debt table. Also, we'll limit the output to the first ten rows to keep the output clean.

"},{"metadata":{"dc":{"key":"4"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\npostgresql:///international_debt\n \nSELECT *\nFROM international_debt\nLIMIT 10;","execution_count":50,"outputs":[{"output_type":"stream","text":"10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":50,"data":{"text/plain":"[('Afghanistan', 'AFG', 'Disbursements on external debt, long-term (DIS, current US$)', 'DT.DIS.DLXF.CD', Decimal('72894453.700000003')),\n ('Afghanistan', 'AFG', 'Interest payments on external debt, long-term (INT, current US$)', 'DT.INT.DLXF.CD', Decimal('53239440.100000001')),\n ('Afghanistan', 'AFG', 'PPG, bilateral (AMT, current US$)', 'DT.AMT.BLAT.CD', Decimal('61739336.899999999')),\n ('Afghanistan', 'AFG', 'PPG, bilateral (DIS, current US$)', 'DT.DIS.BLAT.CD', Decimal('49114729.399999999')),\n ('Afghanistan', 'AFG', 'PPG, bilateral (INT, current US$)', 'DT.INT.BLAT.CD', Decimal('39903620.100000001')),\n ('Afghanistan', 'AFG', 'PPG, multilateral (AMT, current US$)', 'DT.AMT.MLAT.CD', Decimal('39107845')),\n ('Afghanistan', 'AFG', 'PPG, multilateral (DIS, current US$)', 'DT.DIS.MLAT.CD', Decimal('23779724.300000001')),\n ('Afghanistan', 'AFG', 'PPG, multilateral (INT, current US$)', 'DT.INT.MLAT.CD', Decimal('13335820')),\n ('Afghanistan', 'AFG', 'PPG, official creditors (AMT, current US$)', 'DT.AMT.OFFT.CD', Decimal('100847181.900000006')),\n ('Afghanistan', 'AFG', 'PPG, official creditors (DIS, current US$)', 'DT.DIS.OFFT.CD', Decimal('72894453.700000003'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
country_namecountry_codeindicator_nameindicator_codedebt
AfghanistanAFGDisbursements on external debt, long-term (DIS, current US$)DT.DIS.DLXF.CD72894453.700000003
AfghanistanAFGInterest payments on external debt, long-term (INT, current US$)DT.INT.DLXF.CD53239440.100000001
AfghanistanAFGPPG, bilateral (AMT, current US$)DT.AMT.BLAT.CD61739336.899999999
AfghanistanAFGPPG, bilateral (DIS, current US$)DT.DIS.BLAT.CD49114729.399999999
AfghanistanAFGPPG, bilateral (INT, current US$)DT.INT.BLAT.CD39903620.100000001
AfghanistanAFGPPG, multilateral (AMT, current US$)DT.AMT.MLAT.CD39107845
AfghanistanAFGPPG, multilateral (DIS, current US$)DT.DIS.MLAT.CD23779724.300000001
AfghanistanAFGPPG, multilateral (INT, current US$)DT.INT.MLAT.CD13335820
AfghanistanAFGPPG, official creditors (AMT, current US$)DT.AMT.OFFT.CD100847181.900000006
AfghanistanAFGPPG, official creditors (DIS, current US$)DT.DIS.OFFT.CD72894453.700000003
"},"metadata":{}}]},{"metadata":{"dc":{"key":"12"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 2. Finding the number of distinct countries\n

From the first ten rows, we can see the amount of debt owed by Afghanistan in the different debt indicators. But we do not know the number of different countries we have on the table. There are repetitions in the country names because a country is most likely to have debt in more than one debt indicator.

\n

Without a count of unique countries, we will not be able to perform our statistical analyses holistically. In this section, we are going to extract the number of unique countries present in the table.

"},{"metadata":{"dc":{"key":"12"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n COUNT(DISTINCT(country_name)) AS total_distinct_countries\nFROM international_debt;","execution_count":52,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":52,"data":{"text/plain":"[(124,)]","text/html":"\n \n \n \n \n \n \n
total_distinct_countries
124
"},"metadata":{}}]},{"metadata":{"dc":{"key":"20"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 3. Finding out the distinct debt indicators\n

We can see there are a total of 124 countries present on the table. As we saw in the first section, there is a column called indicator_name that briefly specifies the purpose of taking the debt. Just beside that column, there is another column called indicator_code which symbolizes the category of these debts. Knowing about these various debt indicators will help us to understand the areas in which a country can possibly be indebted to.

"},{"metadata":{"dc":{"key":"20"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT DISTINCT indicator_code AS distinct_debt_indicators\nFROM international_debt\nORDER BY distinct_debt_indicators;","execution_count":54,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n25 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":54,"data":{"text/plain":"[('DT.AMT.BLAT.CD',),\n ('DT.AMT.DLXF.CD',),\n ('DT.AMT.DPNG.CD',),\n ('DT.AMT.MLAT.CD',),\n ('DT.AMT.OFFT.CD',),\n ('DT.AMT.PBND.CD',),\n ('DT.AMT.PCBK.CD',),\n ('DT.AMT.PROP.CD',),\n ('DT.AMT.PRVT.CD',),\n ('DT.DIS.BLAT.CD',),\n ('DT.DIS.DLXF.CD',),\n ('DT.DIS.MLAT.CD',),\n ('DT.DIS.OFFT.CD',),\n ('DT.DIS.PCBK.CD',),\n ('DT.DIS.PROP.CD',),\n ('DT.DIS.PRVT.CD',),\n ('DT.INT.BLAT.CD',),\n ('DT.INT.DLXF.CD',),\n ('DT.INT.DPNG.CD',),\n ('DT.INT.MLAT.CD',),\n ('DT.INT.OFFT.CD',),\n ('DT.INT.PBND.CD',),\n ('DT.INT.PCBK.CD',),\n ('DT.INT.PROP.CD',),\n ('DT.INT.PRVT.CD',)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
distinct_debt_indicators
DT.AMT.BLAT.CD
DT.AMT.DLXF.CD
DT.AMT.DPNG.CD
DT.AMT.MLAT.CD
DT.AMT.OFFT.CD
DT.AMT.PBND.CD
DT.AMT.PCBK.CD
DT.AMT.PROP.CD
DT.AMT.PRVT.CD
DT.DIS.BLAT.CD
DT.DIS.DLXF.CD
DT.DIS.MLAT.CD
DT.DIS.OFFT.CD
DT.DIS.PCBK.CD
DT.DIS.PROP.CD
DT.DIS.PRVT.CD
DT.INT.BLAT.CD
DT.INT.DLXF.CD
DT.INT.DPNG.CD
DT.INT.MLAT.CD
DT.INT.OFFT.CD
DT.INT.PBND.CD
DT.INT.PCBK.CD
DT.INT.PROP.CD
DT.INT.PRVT.CD
"},"metadata":{}}]},{"metadata":{"dc":{"key":"28"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 4. Totaling the amount of debt owed by the countries\n

As mentioned earlier, the financial debt of a particular country represents its economic state. But if we were to project this on an overall global scale, how will we approach it?

\n

Let's switch gears from the debt indicators now and find out the total amount of debt (in USD) that is owed by the different countries. This will give us a sense of how the overall economy of the entire world is holding up.

"},{"metadata":{"dc":{"key":"28"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n ROUND(SUM(debt)/1000000, 2) AS total_debt\nFROM international_debt; ","execution_count":56,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":56,"data":{"text/plain":"[(Decimal('3079734.49'),)]","text/html":"\n \n \n \n \n \n \n
total_debt
3079734.49
"},"metadata":{}}]},{"metadata":{"dc":{"key":"36"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 5. Country with the highest debt\n

\"Human beings cannot comprehend very large or very small numbers. It would be useful for us to acknowledge that fact.\" - Daniel Kahneman. That is more than 3 million million USD, an amount which is really hard for us to fathom.

\n

Now that we have the exact total of the amounts of debt owed by several countries, let's now find out the country that owns the highest amount of debt along with the amount. Note that this debt is the sum of different debts owed by a country across several categories. This will help to understand more about the country in terms of its socio-economic scenarios. We can also find out the category in which the country owns its highest debt. But we will leave that for now.

"},{"metadata":{"dc":{"key":"36"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n country_name, \n SUM(debt) AS total_debt\nFROM international_debt\nGROUP BY country_name\nORDER BY total_debt DESC \nLIMIT 1;","execution_count":58,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":58,"data":{"text/plain":"[('China', Decimal('285793494734.200001568'))]","text/html":"\n \n \n \n \n \n \n \n \n
country_nametotal_debt
China285793494734.200001568
"},"metadata":{}}]},{"metadata":{"dc":{"key":"44"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 6. Average amount of debt across indicators\n

So, it was China. A more in-depth breakdown of China's debts can be found here.

\n

We now have a brief overview of the dataset and a few of its summary statistics. We already have an idea of the different debt indicators in which the countries owe their debts. We can dig even further to find out on an average how much debt a country owes? This will give us a better sense of the distribution of the amount of debt across different indicators.

"},{"metadata":{"dc":{"key":"44"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n indicator_code AS debt_indicator,\n indicator_name,\n AVG(debt) AS average_debt\nFROM international_debt\nGROUP BY debt_indicator, indicator_name\nORDER BY average_debt DESC\nLIMIT 10;","execution_count":60,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":60,"data":{"text/plain":"[('DT.AMT.DLXF.CD', 'Principal repayments on external debt, long-term (AMT, current US$)', Decimal('5904868401.499193612')),\n ('DT.AMT.DPNG.CD', 'Principal repayments on external debt, private nonguaranteed (PNG) (AMT, current US$)', Decimal('5161194333.812658349')),\n ('DT.DIS.DLXF.CD', 'Disbursements on external debt, long-term (DIS, current US$)', Decimal('2152041216.890243888')),\n ('DT.DIS.OFFT.CD', 'PPG, official creditors (DIS, current US$)', Decimal('1958983452.859836046')),\n ('DT.AMT.PRVT.CD', 'PPG, private creditors (AMT, current US$)', Decimal('1803694101.963265321')),\n ('DT.INT.DLXF.CD', 'Interest payments on external debt, long-term (INT, current US$)', Decimal('1644024067.650806481')),\n ('DT.DIS.BLAT.CD', 'PPG, bilateral (DIS, current US$)', Decimal('1223139290.398230108')),\n ('DT.INT.DPNG.CD', 'Interest payments on external debt, private nonguaranteed (PNG) (INT, current US$)', Decimal('1220410844.421518983')),\n ('DT.AMT.OFFT.CD', 'PPG, official creditors (AMT, current US$)', Decimal('1191187963.083064523')),\n ('DT.AMT.PBND.CD', 'PPG, bonds (AMT, current US$)', Decimal('1082623947.653623188'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
debt_indicatorindicator_nameaverage_debt
DT.AMT.DLXF.CDPrincipal repayments on external debt, long-term (AMT, current US$)5904868401.499193612
DT.AMT.DPNG.CDPrincipal repayments on external debt, private nonguaranteed (PNG) (AMT, current US$)5161194333.812658349
DT.DIS.DLXF.CDDisbursements on external debt, long-term (DIS, current US$)2152041216.890243888
DT.DIS.OFFT.CDPPG, official creditors (DIS, current US$)1958983452.859836046
DT.AMT.PRVT.CDPPG, private creditors (AMT, current US$)1803694101.963265321
DT.INT.DLXF.CDInterest payments on external debt, long-term (INT, current US$)1644024067.650806481
DT.DIS.BLAT.CDPPG, bilateral (DIS, current US$)1223139290.398230108
DT.INT.DPNG.CDInterest payments on external debt, private nonguaranteed (PNG) (INT, current US$)1220410844.421518983
DT.AMT.OFFT.CDPPG, official creditors (AMT, current US$)1191187963.083064523
DT.AMT.PBND.CDPPG, bonds (AMT, current US$)1082623947.653623188
"},"metadata":{}}]},{"metadata":{"dc":{"key":"52"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 7. The highest amount of principal repayments\n

We can see that the indicator DT.AMT.DLXF.CD tops the chart of average debt. This category includes repayment of long term debts. Countries take on long-term debt to acquire immediate capital. More information about this category can be found here.

\n

An interesting observation in the above finding is that there is a huge difference in the amounts of the indicators after the second one. This indicates that the first two indicators might be the most severe categories in which the countries owe their debts.

\n

We can investigate this a bit more so as to find out which country owes the highest amount of debt in the category of long term debts (DT.AMT.DLXF.CD). Since not all the countries suffer from the same kind of economic disturbances, this finding will allow us to understand that particular country's economic condition a bit more specifically.

"},{"metadata":{"dc":{"key":"52"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n country_name, \n indicator_name\nFROM international_debt\nWHERE debt = (SELECT \n MAX(debt)\n FROM international_debt\n WHERE indicator_code = 'DT.AMT.DLXF.CD');","execution_count":62,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":62,"data":{"text/plain":"[('China', 'Principal repayments on external debt, long-term (AMT, current US$)')]","text/html":"\n \n \n \n \n \n \n \n \n
country_nameindicator_name
ChinaPrincipal repayments on external debt, long-term (AMT, current US$)
"},"metadata":{}}]},{"metadata":{"dc":{"key":"60"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 8. The most common debt indicator\n

China has the highest amount of debt in the long-term debt (DT.AMT.DLXF.CD) category. This is verified by The World Bank. It is often a good idea to verify our analyses like this since it validates that our investigations are correct.

\n

We saw that long-term debt is the topmost category when it comes to the average amount of debt. But is it the most common indicator in which the countries owe their debt? Let's find that out.

"},{"metadata":{"dc":{"key":"60"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n indicator_code,\n COUNT(indicator_code) AS indicator_count\nFROM international_debt\nGROUP BY indicator_code\nORDER BY indicator_count DESC, indicator_code DESC\nLIMIT 20;","execution_count":64,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n20 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":64,"data":{"text/plain":"[('DT.INT.OFFT.CD', 124),\n ('DT.INT.MLAT.CD', 124),\n ('DT.INT.DLXF.CD', 124),\n ('DT.AMT.OFFT.CD', 124),\n ('DT.AMT.MLAT.CD', 124),\n ('DT.AMT.DLXF.CD', 124),\n ('DT.DIS.DLXF.CD', 123),\n ('DT.INT.BLAT.CD', 122),\n ('DT.DIS.OFFT.CD', 122),\n ('DT.AMT.BLAT.CD', 122),\n ('DT.DIS.MLAT.CD', 120),\n ('DT.DIS.BLAT.CD', 113),\n ('DT.INT.PRVT.CD', 98),\n ('DT.AMT.PRVT.CD', 98),\n ('DT.INT.PCBK.CD', 84),\n ('DT.AMT.PCBK.CD', 84),\n ('DT.INT.DPNG.CD', 79),\n ('DT.AMT.DPNG.CD', 79),\n ('DT.INT.PBND.CD', 69),\n ('DT.AMT.PBND.CD', 69)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
indicator_codeindicator_count
DT.INT.OFFT.CD124
DT.INT.MLAT.CD124
DT.INT.DLXF.CD124
DT.AMT.OFFT.CD124
DT.AMT.MLAT.CD124
DT.AMT.DLXF.CD124
DT.DIS.DLXF.CD123
DT.INT.BLAT.CD122
DT.DIS.OFFT.CD122
DT.AMT.BLAT.CD122
DT.DIS.MLAT.CD120
DT.DIS.BLAT.CD113
DT.INT.PRVT.CD98
DT.AMT.PRVT.CD98
DT.INT.PCBK.CD84
DT.AMT.PCBK.CD84
DT.INT.DPNG.CD79
DT.AMT.DPNG.CD79
DT.INT.PBND.CD69
DT.AMT.PBND.CD69
"},"metadata":{}}]},{"metadata":{"dc":{"key":"68"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 9. Other viable debt issues and conclusion\n

There are a total of six debt indicators in which all the countries listed in our dataset have taken debt. The indicator DT.AMT.DLXF.CD is also there in the list. So, this gives us a clue that all these countries are suffering from a common economic issue. But that is not the end of the story, but just a part of the story.

\n

Let's change tracks from debt_indicators now and focus on the amount of debt again. Let's find out the maximum amount of debt that each country has. With this, we will be in a position to identify the other plausible economic issues a country might be going through.

\n

In this notebook, we took a look at debt owed by countries across the globe. We extracted a few summary statistics from the data and unraveled some interesting facts and figures. We also validated our findings to make sure the investigations are correct.

"},{"metadata":{"dc":{"key":"68"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\nSELECT \n country_name,\n MAX(debt) AS maximum_debt\nFROM international_debt\nGROUP BY country_name\nORDER BY maximum_debt DESC\nLIMIT 10;","execution_count":66,"outputs":[{"output_type":"stream","text":" * postgresql:///international_debt\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":66,"data":{"text/plain":"[('China', Decimal('96218620835.699996948')),\n ('Brazil', Decimal('90041840304.100006104')),\n ('Russian Federation', Decimal('66589761833.5')),\n ('Turkey', Decimal('51555031005.800003052')),\n ('South Asia', Decimal('48756295898.199996948')),\n ('Least developed countries: UN classification', Decimal('40160766261.599998474')),\n ('IDA only', Decimal('34531188113.199996948')),\n ('India', Decimal('31923507000.799999237')),\n ('Indonesia', Decimal('30916112653.799999237')),\n ('Kazakhstan', Decimal('27482093686.400001526'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
country_namemaximum_debt
China96218620835.699996948
Brazil90041840304.100006104
Russian Federation66589761833.5
Turkey51555031005.800003052
South Asia48756295898.199996948
Least developed countries: UN classification40160766261.599998474
IDA only34531188113.199996948
India31923507000.799999237
Indonesia30916112653.799999237
Kazakhstan27482093686.400001526
"},"metadata":{}}]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.7","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":2} 2 | -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/notebook.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"dc":{"key":"7"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 1. The ten best-selling video games\n

\"A

\n

Photo by Dan Schleusser on Unsplash.

\n

Video games are big business: the global gaming market is projected to be worth more than $300 billion by 2027 according to Mordor Intelligence. With so much money at stake, the major game publishers are hugely incentivized to create the next big hit. But are games getting better, or has the golden age of video games already passed?

\n

In this project, we'll explore the top 400 best-selling video games created between 1977 and 2020. We'll compare a dataset on game sales with critic and user reviews to determine whether or not video games have improved as the gaming market has grown.

\n

Our database contains two tables. We've limited each table to 400 rows for this project, but you can find the complete dataset with over 13,000 games on Kaggle.

\n

game_sales

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
gamevarcharName of the video game
platformvarcharGaming platform
publishervarcharGame publisher
developervarcharGame developer
games_soldfloatNumber of copies sold (millions)
yearintRelease year
\n

reviews

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
gamevarcharName of the video game
critic_scorefloatCritic score according to Metacritic
user_scorefloatUser score according to Metacritic
\n

Let's begin by looking at some of the top selling video games of all time!

"},{"metadata":{"dc":{"key":"7"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\npostgresql:///games\n\n-- Select all information for the top ten best-selling games\n-- Order the results from best-selling game down to tenth best-selling\nSELECT * \nFROM game_sales\nORDER BY games_sold DESC\nLIMIT 10;","execution_count":2,"outputs":[{"output_type":"stream","text":"10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":2,"data":{"text/plain":"[('Wii Sports for Wii', 'Wii', 'Nintendo', 'Nintendo EAD', Decimal('82.90'), 2006),\n ('Super Mario Bros. for NES', 'NES', 'Nintendo', 'Nintendo EAD', Decimal('40.24'), 1985),\n ('Counter-Strike: Global Offensive for PC', 'PC', 'Valve', 'Valve Corporation', Decimal('40.00'), 2012),\n ('Mario Kart Wii for Wii', 'Wii', 'Nintendo', 'Nintendo EAD', Decimal('37.32'), 2008),\n (\"PLAYERUNKNOWN'S BATTLEGROUNDS for PC\", 'PC', 'PUBG Corporation', 'PUBG Corporation', Decimal('36.60'), 2017),\n ('Minecraft for PC', 'PC', 'Mojang', 'Mojang AB', Decimal('33.15'), 2010),\n ('Wii Sports Resort for Wii', 'Wii', 'Nintendo', 'Nintendo EAD', Decimal('33.13'), 2009),\n ('Pokemon Red / Green / Blue Version for GB', 'GB', 'Nintendo', 'Game Freak', Decimal('31.38'), 1998),\n ('New Super Mario Bros. for DS', 'DS', 'Nintendo', 'Nintendo EAD', Decimal('30.80'), 2006),\n ('New Super Mario Bros. Wii for Wii', 'Wii', 'Nintendo', 'Nintendo EAD', Decimal('30.30'), 2009)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
gameplatformpublisherdevelopergames_soldyear
Wii Sports for WiiWiiNintendoNintendo EAD82.902006
Super Mario Bros. for NESNESNintendoNintendo EAD40.241985
Counter-Strike: Global Offensive for PCPCValveValve Corporation40.002012
Mario Kart Wii for WiiWiiNintendoNintendo EAD37.322008
PLAYERUNKNOWN'S BATTLEGROUNDS for PCPCPUBG CorporationPUBG Corporation36.602017
Minecraft for PCPCMojangMojang AB33.152010
Wii Sports Resort for WiiWiiNintendoNintendo EAD33.132009
Pokemon Red / Green / Blue Version for GBGBNintendoGame Freak31.381998
New Super Mario Bros. for DSDSNintendoNintendo EAD30.802006
New Super Mario Bros. Wii for WiiWiiNintendoNintendo EAD30.302009
"},"metadata":{}}]},{"metadata":{"dc":{"key":"14"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 2. Missing review scores\n

Wow, the best-selling video games were released between 1985 to 2017! That's quite a range; we'll have to use data from the reviews table to gain more insight on the best years for video games.

\n

First, it's important to explore the limitations of our database. One big shortcoming is that there is not any reviews data for some of the games on the game_sales table.

"},{"metadata":{"dc":{"key":"14"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Join games_sales and reviews\n-- Select a count of the number of games where both critic_score and user_score are null\n\nSELECT COUNT(g.game)\nFROM game_sales g\nLEFT JOIN reviews r\nON g.game = r.game\nWHERE critic_score IS NULL\nAND user_score IS NULL;","execution_count":4,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n1 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":4,"data":{"text/plain":"[(31,)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n
count
31
"},"metadata":{}}]},{"metadata":{"dc":{"key":"21"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 3. Years that video game critics loved\n

It looks like a little less than ten percent of the games on the game_sales table don't have any reviews data. That's a small enough percentage that we can continue our exploration, but the missing reviews data is a good thing to keep in mind as we move on to evaluating results from more sophisticated queries.

\n

There are lots of ways to measure the best years for video games! Let's start with what the critics think.

"},{"metadata":{"dc":{"key":"21"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql\n\n-- Select release year and average critic score for each year, rounded and aliased\n-- Join the game_sales and reviews tables\n-- Group by release year\n-- Order the data from highest to lowest avg_critic_score and limit to 10 results\n\nSELECT \n year, \n ROUND(AVG(critic_score), 2) AS avg_critic_score\nFROM game_sales g\nLEFT JOIN reviews r\nON g.game = r.game\nGROUP BY year\nORDER BY avg_critic_score DESC\nLIMIT 10;","execution_count":6,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":6,"data":{"text/plain":"[(1990, Decimal('9.80')),\n (1992, Decimal('9.67')),\n (1998, Decimal('9.32')),\n (2020, Decimal('9.20')),\n (1993, Decimal('9.10')),\n (1995, Decimal('9.07')),\n (2004, Decimal('9.03')),\n (1982, Decimal('9.00')),\n (2002, Decimal('8.99')),\n (1999, Decimal('8.93'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
yearavg_critic_score
19909.80
19929.67
19989.32
20209.20
19939.10
19959.07
20049.03
19829.00
20028.99
19998.93
"},"metadata":{}}]},{"metadata":{"dc":{"key":"28"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 4. Was 1982 really that great?\n

The range of great years according to critic reviews goes from 1982 until 2020: we are no closer to finding the golden age of video games!

\n

Hang on, though. Some of those avg_critic_score values look like suspiciously round numbers for averages. The value for 1982 looks especially fishy. Maybe there weren't a lot of video games in our dataset that were released in certain years.

\n

Let's update our query and find out whether 1982 really was such a great year for video games.

"},{"metadata":{"dc":{"key":"28"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Paste your query from the previous task; update it to add a count of games released in each year called num_games\n-- Update the query so that it only returns years that have more than four reviewed games\n\nSELECT \n year, \n COUNT(r.game) AS num_games,\n ROUND(AVG(critic_score), 2) AS avg_critic_score\nFROM game_sales g\nLEFT JOIN reviews r\nON g.game = r.game\nGROUP BY year\nHAVING COUNT(r.game) > 4\nORDER BY avg_critic_score DESC\nLIMIT 10;","execution_count":8,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":8,"data":{"text/plain":"[(1998, 10, Decimal('9.32')),\n (2004, 11, Decimal('9.03')),\n (2002, 9, Decimal('8.99')),\n (1999, 11, Decimal('8.93')),\n (2001, 13, Decimal('8.82')),\n (2011, 26, Decimal('8.76')),\n (2016, 13, Decimal('8.67')),\n (2013, 18, Decimal('8.66')),\n (2008, 20, Decimal('8.63')),\n (2017, 13, Decimal('8.62'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
yearnum_gamesavg_critic_score
1998109.32
2004119.03
200298.99
1999118.93
2001138.82
2011268.76
2016138.67
2013188.66
2008208.63
2017138.62
"},"metadata":{}}]},{"metadata":{"dc":{"key":"35"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 5. Years that dropped off the critics' favorites list\n

That looks better! The num_games column convinces us that our new list of the critics' top games reflects years that had quite a few well-reviewed games rather than just one or two hits. But which years dropped off the list due to having four or fewer reviewed games? Let's identify them so that someday we can track down more game reviews for those years and determine whether they might rightfully be considered as excellent years for video game releases!

\n

It's time to brush off your set theory skills. To get started, we've created tables with the results of our previous two queries:

\n

top_critic_years

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
yearintYear of video game release
avg_critic_scorefloatAverage of all critic scores for games released in that year
\n

top_critic_years_more_than_four_games

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
yearintYear of video game release
num_gamesintCount of the number of video games released in that year
avg_critic_scorefloatAverage of all critic scores for games released in that year
"},{"metadata":{"dc":{"key":"35"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Select the year and avg_critic_score for those years that dropped off the list of critic favorites \n-- Order the results from highest to lowest avg_critic_score\n\nSELECT \n t1.year,\n t1.avg_critic_score\nFROM top_critic_years t1\nWHERE t1.avg_critic_score NOT IN(\n SELECT t2.avg_critic_score\n FROM top_critic_years_more_than_four_games t2\n WHERE t1.year = t2.year)\nORDER BY t1.avg_critic_score DESC;","execution_count":10,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n6 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":10,"data":{"text/plain":"[(1990, Decimal('9.80')),\n (1992, Decimal('9.67')),\n (2020, Decimal('9.20')),\n (1993, Decimal('9.10')),\n (1995, Decimal('9.07')),\n (1982, Decimal('9.00'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
yearavg_critic_score
19909.80
19929.67
20209.20
19939.10
19959.07
19829.00
"},"metadata":{}}]},{"metadata":{"dc":{"key":"42"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 6. Years video game players loved\n

Based on our work in the task above, it looks like the early 1990s might merit consideration as the golden age of video games based on critic_score alone, but we'd need to gather more games and reviews data to do further analysis.

\n

Let's move on to looking at the opinions of another important group of people: players! To begin, let's create a query very similar to the one we used in Task Four, except this one will look at user_score averages by year rather than critic_score averages.

"},{"metadata":{"dc":{"key":"42"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Select year, an average of user_score, and a count of games released in a given year, aliased and rounded\n-- Include only years with more than four reviewed games; group data by year\n-- Order data by avg_user_score, and limit to ten results\n\nSELECT \n year, \n ROUND(AVG(user_score), 2) AS avg_user_score,\n COUNT(r.game) AS num_games\nFROM game_sales g\nLEFT JOIN reviews r\nON g.game = r.game\nGROUP BY year\nHAVING COUNT(r.game) > 4\nORDER BY avg_user_score DESC\nLIMIT 10;","execution_count":12,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n10 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":12,"data":{"text/plain":"[(1997, Decimal('9.50'), 8),\n (1998, Decimal('9.40'), 10),\n (2010, Decimal('9.24'), 23),\n (2009, Decimal('9.18'), 20),\n (2008, Decimal('9.03'), 20),\n (1996, Decimal('9.00'), 5),\n (2006, Decimal('8.95'), 16),\n (2005, Decimal('8.95'), 13),\n (1999, Decimal('8.80'), 11),\n (2000, Decimal('8.80'), 8)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
yearavg_user_scorenum_games
19979.508
19989.4010
20109.2423
20099.1820
20089.0320
19969.005
20068.9516
20058.9513
19998.8011
20008.808
"},"metadata":{}}]},{"metadata":{"dc":{"key":"49"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 7. Years that both players and critics loved\n

Alright, we've got a list of the top ten years according to both critic reviews and user reviews. Are there any years that showed up on both tables? If so, those years would certainly be excellent ones!

\n

Recall that we have access to the top_critic_years_more_than_four_games table, which stores the results of our top critic years query from Task 4:

\n

top_critic_years_more_than_four_games

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
yearintYear of video game release
num_gamesintCount of the number of video games released in that year
avg_critic_scorefloatAverage of all critic scores for games released in that year
\n

We've also saved the results of our top user years query from the previous task into a table:

\n

top_user_years_more_than_four_games

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
columntypemeaning
yearintYear of video game release
num_gamesintCount of the number of video games released in that year
avg_user_scorefloatAverage of all user scores for games released in that year
"},{"metadata":{"dc":{"key":"49"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Select the year results that appear on both tables\nSELECT t1.year\nFROM top_critic_years_more_than_four_games t1\nJOIN top_user_years_more_than_four_games t2\nON t1.year = t2.year\n","execution_count":14,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n3 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":14,"data":{"text/plain":"[(1998,), (2002,), (2008,)]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
year
1998
2002
2008
"},"metadata":{}}]},{"metadata":{"dc":{"key":"56"},"deletable":false,"editable":false,"run_control":{"frozen":true},"tags":["context"]},"cell_type":"markdown","source":"## 8. Sales in the best video game years\n

Looks like we've got three years that both users and critics agreed were in the top ten! There are many other ways of measuring what the best years for video games are, but let's stick with these years for now. We know that critics and players liked these years, but what about video game makers? Were sales good? Let's find out.

\n

This time, we haven't saved the results from the previous task in a table for you. Instead, we'll use the query from the previous task as a subquery in this one! This is a great skill to have, as we don't always have write permissions on the database we are querying.

"},{"metadata":{"dc":{"key":"56"},"tags":["sample_code"],"trusted":true},"cell_type":"code","source":"%%sql \n\n-- Select year and sum of games_sold, aliased as total_games_sold; order results by total_games_sold descending\n-- Filter game_sales based on whether each year is in the list returned in the previous task\n\nSELECT \n g.year,\n SUM(games_sold) AS total_games_sold\nFROM game_sales g\nWHERE g.year IN (\n SELECT t1.year\n FROM top_critic_years_more_than_four_games t1\n JOIN top_user_years_more_than_four_games t2\n ON t1.year = t2.year\n )\nGROUP BY g.year\nORDER BY total_games_sold DESC\n","execution_count":16,"outputs":[{"output_type":"stream","text":" * postgresql:///games\n3 rows affected.\n","name":"stdout"},{"output_type":"execute_result","execution_count":16,"data":{"text/plain":"[(2008, Decimal('175.07')),\n (1998, Decimal('101.52')),\n (2002, Decimal('58.67'))]","text/html":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
yeartotal_games_sold
2008175.07
1998101.52
200258.67
"},"metadata":{}}]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.7","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":2} 2 | -------------------------------------------------------------------------------- /Analyzing NYC Public School Test Result Scores/datasets/schools_modified.csv: -------------------------------------------------------------------------------- 1 | school_name,borough,building_code,average_math,average_reading,average_writing,percent_tested 2 | "New Explorations into Science, Technology and Math High School",Manhattan,M022,657,601,601, 3 | Essex Street Academy,Manhattan,M445,395,411,387,78.9 4 | Lower Manhattan Arts Academy,Manhattan,M445,418,428,415,65.1 5 | High School for Dual Language and Asian Studies,Manhattan,M445,613,453,463,95.9 6 | Henry Street School for International Studies,Manhattan,M056,410,406,381,59.7 7 | Bard High School Early College,Manhattan,M097,634,641,639,70.8 8 | Urban Assembly Academy of Government and Law,Manhattan,M445,389,395,381,80.8 9 | Marta Valle High School,Manhattan,M025,438,413,394,35.6 10 | University Neighborhood High School,Manhattan,M446,437,355,352,69.9 11 | New Design High School,Manhattan,M445,381,396,372,73.7 12 | Pace High School,Manhattan,M131,430,435,427,87.8 13 | High School for Health Professions and Human Services,Manhattan,M475,452,445,430,86.9 14 | High School for Language and Diplomacy,Manhattan,M460,446,433,411,70.2 15 | International High School at Union Square,Manhattan,M460,403,330,316,53.2 16 | Institute for Collaborative Education,Manhattan,M475,501,550,541,78.6 17 | Gramercy Arts High School,Manhattan,M460,446,459,455,79.6 18 | Urban Assembly New York Harbor School,Manhattan,M877,446,453,428,78.8 19 | Richard R. Green High School of Teaching,Manhattan,M282,411,415,409,60.0 20 | Millennium High School,Manhattan,M824,577,560,567,94.0 21 | Urban Assembly School of Business for Young Women,Manhattan,M282,418,420,417, 22 | High School of Economics and Finance,Manhattan,M833,469,442,447,66.8 23 | Leadership and Public Service High School,Manhattan,M894,390,396,392,54.9 24 | East Side Community School,Manhattan,M060,454,428,445,85.2 25 | Baruch College Campus High School,Manhattan,M874,592,526,531,94.3 26 | School of the Future High School,Manhattan,M660,534,533,522,89.9 27 | Manhattan Village Academy,Manhattan,M873,522,479,510,98.8 28 | NYC Lab School for Collaborative Studies,Manhattan,M070,595,550,555,79.8 29 | Hudson High School of Learning Technologies,Manhattan,M440,378,407,388,71.8 30 | Manhattan Business Academy,Manhattan,M440,410,407,399,69.7 31 | Landmark High School,Manhattan,M440,386,386,386,30.6 32 | High School of Fashion Industries,Manhattan,M600,433,442,427,80.6 33 | NYC Museum School,Manhattan,M070,560,530,522,90.0 34 | Chelsea Career and Technical Education High School,Manhattan,M615,439,418,400,80.4 35 | NYC iSchool,Manhattan,M615,518,515,503,96.0 36 | Manhattan Academy for Arts and Language,Manhattan,M620,350,334,321,46.1 37 | Unity Center for Urban Technologies,Manhattan,M620,375,385,387,62.8 38 | Business of Sports School,Manhattan,M625,395,386,371,67.5 39 | Facing History School,Manhattan,M535,366,356,371,57.3 40 | High School of Hospitality Management,Manhattan,M535,451,433,424, 41 | Urban Assembly School of Design and Construction,Manhattan,M535,445,417,403,60.6 42 | High School for Environmental Studies,Manhattan,M834,469,454,444,74.0 43 | Art and Design High School,Manhattan,M488,455,475,458,70.1 44 | Manhattan Bridges High School,Manhattan,M535,409,360,347,84.4 45 | Urban Assembly Gateway School for Technology,Manhattan,M625,445,432,415,78.4 46 | Food and Finance High School,Manhattan,M535,428,435,421,52.0 47 | Eleanor Roosevelt High School,Manhattan,M855,641,617,631,86.0 48 | "High School for Arts, Imagination, and Inquiry",Manhattan,M490,375,389,380,58.8 49 | Urban Assembly School for Media Studies,Manhattan,M490,392,419,396,49.5 50 | Beacon High School,Manhattan,M837,583,586,595,82.8 51 | Fiorello H. LaGuardia High School of Music and Art and Performing Arts,Manhattan,M485,592,592,597,88.5 52 | High School of Arts and Technology,Manhattan,M490,421,428,406,44.4 53 | Manhattan / Hunter Science High School,Manhattan,M490,581,531,535,97.2 54 | "High School for Law, Advocacy, and Community Justice",Manhattan,M490,415,417,402,60.5 55 | Urban Assembly School for Green Careers,Manhattan,M470,393,371,378,60.0 56 | Frank McCourt High School,Manhattan,M470,489,491,500,89.1 57 | Global Learning Collaborative,Manhattan,M470,406,407,413,59.4 58 | Wadleigh Secondary School for the Performing and Visual Arts,Manhattan,M088,381,401,392,52.6 59 | Frederick Douglass Academy II Secondary School,Manhattan,M088,390,384,373, 60 | Columbia Secondary School,Manhattan,M125,583,561,546,88.2 61 | Academy for Social Action (College Board),Manhattan,M043,357,349,365,54.0 62 | Urban Assembly School for the Performing Arts,Manhattan,M043,379,399,388,76.7 63 | Heritage School,Manhattan,M107,385,380,370,56.8 64 | Central Park East High School,Manhattan,M013,483,468,439,97.9 65 | Park East High School,Manhattan,M495,429,433,435,89.6 66 | Young Women's Leadership School,Manhattan,M895,478,465,472,100.0 67 | Manhattan Center for Science and Mathematics,Manhattan,M435,556,505,495,87.6 68 | Mott Hall High School,Manhattan,M136,416,445,440,36.9 69 | Thurgood Marshall Academy for Learning and Social Change,Manhattan,M970,402,394,400,84.7 70 | "High School for Mathematics, Science, and Engineering at City College",Manhattan,M812,683,610,596,92.6 71 | A. Philip Randolph Campus High School,Manhattan,M540,459,453,447,74.0 72 | Gregorio Luperon High School for Science and Mathematics,Manhattan,M876,383,355,352,71.0 73 | Community Health Academy of the Heights,Manhattan,M814,387,389,385,55.3 74 | Washington Heights Expeditionary Learning School,Manhattan,M143,443,423,434,87.0 75 | Coalition School for Social Change,Manhattan,M045,344,368,367,40.5 76 | Repertory Company High School for Theatre Arts,Manhattan,M896,425,451,458,89.5 77 | Professional Performing Arts High School,Manhattan,M017,496,520,516,72.2 78 | Jacqueline Kennedy Onassis High School,Manhattan,M486,418,422,415, 79 | Murry Bergtraum High School for Business Careers,Manhattan,M520,418,415,398,44.3 80 | Frederick Douglass Academy,Manhattan,M010,463,452,450,65.1 81 | High School for Media and Communications,Manhattan,M465,378,381,383,33.0 82 | College Academy,Manhattan,M465,367,377,363,41.9 83 | High School for Law and Public Service,Manhattan,M465,401,394,381,44.1 84 | City College Academy of the Arts,Manhattan,M218,495,445,450,95.3 85 | High School for Health Careers and Sciences,Manhattan,M465,374,385,389,56.2 86 | Manhattan International High School,Manhattan,M480,438,358,382,58.6 87 | Talent Unlimited High School,Manhattan,M480,485,498,496,89.3 88 | Vanguard High School,Manhattan,M480,431,409,396,63.8 89 | Life Sciences Secondary School,Manhattan,M645,435,440,425,63.0 90 | Stuyvesant High School,Manhattan,M477,754,697,693,97.4 91 | Ralph R. McKee Career and Technical Education High School,Staten Island,R600,420,429,409,38.0 92 | Michael J. Petrides School,Staten Island,R880,483,473,470,79.2 93 | Curtis High School,Staten Island,R450,453,458,444,64.2 94 | Port Richmond High School,Staten Island,R445,432,427,425,44.6 95 | Staten Island Technical High School,Staten Island,R440,711,660,670,99.7 96 | New Dorp High School,Staten Island,R435,454,446,444,63.7 97 | Tottenville High School,Staten Island,R455,494,476,476, 98 | Susan E. Wagner High School,Staten Island,R460,496,490,487,66.3 99 | Gaynor McCown Expeditionary Learning School,Staten Island,R043,442,458,454,55.8 100 | CSI High School for International Studies,Staten Island,R043,477,468,464,83.5 101 | New Explorers High School,Bronx,X790,390,398,376,30.4 102 | "Bronx School for Law, Government, and Justice",Bronx,X460,403,409,415,63.8 103 | Urban Assembly School for Careers in Sports,Bronx,X790,402,405,395,55.5 104 | Bronx Leadership Academy II High School,Bronx,X790,384,355,361,61.3 105 | Urban Assembly Bronx Academy of Letters,Bronx,X183,398,400,405,57.8 106 | Health Opportunities High School,Bronx,X884,374,386,382,57.9 107 | Community School for Social Justice,Bronx,X884,380,382,362,38.4 108 | Alfred E. Smith Career and Technical Education High School,Bronx,X600,390,373,371,29.8 109 | Academy for Language and Technology,Bronx,X082,371,334,348,78.9 110 | South Bronx Preparatory (College Board),Bronx,X149,419,414,394,76.9 111 | International Community High School,Bronx,X139,345,338,312,58.2 112 | Hostos-Lincoln Academy of Science,Bronx,X162,463,451,435,80.0 113 | University Heights Secondary School,Bronx,X470,420,446,424,87.8 114 | Mott Haven Village Preparatory High School,Bronx,X470,377,373,369,44.9 115 | High School for Violin and Dance,Bronx,X400,363,401,396,31.3 116 | Bronx International High School,Bronx,X400,355,330,320, 117 | Bronx Career and College Preparatory High School,Bronx,X158,370,379,381,40.7 118 | Bronx Center for Science and Mathematics,Bronx,X002,513,468,485,73.9 119 | Bronx Early College Academy for Teaching and Learning,Bronx,X166,424,413,409,93.3 120 | Eximius College Preparatory Academy (College Board),Bronx,X002,400,391,397,78.2 121 | Bronx Latin,Bronx,X158,394,381,363,81.0 122 | School for Excellence,Bronx,X400,377,385,383,38.4 123 | Morris Academy for Collaborative Studies,Bronx,X400,407,389,386,44.8 124 | Frederick Douglass Academy III Secondary School,Bronx,X148,387,386,386,50.5 125 | Urban Assembly School for Applied Math and Science,Bronx,X970,445,418,422,87.8 126 | Bronx Collegiate Academy,Bronx,X410,395,401,382,45.5 127 | Mott Hall Bronx High School,Bronx,X970,417,399,398,46.2 128 | Bronx Leadership Academy High School,Bronx,X876,375,372,374,49.1 129 | Validus Preparatory Academy: An Expeditionary Learning School,Bronx,X970,382,375,384,59.2 130 | Bronx High School for Medical Science,Bronx,X410,431,421,426,83.9 131 | Eagle Academy for Young Men,Bronx,X465,398,410,397,65.7 132 | Bronx High School of Business,Bronx,X410,365,360,346,33.3 133 | DreamYard Preparatory School,Bronx,X410,385,385,388,51.1 134 | Theatre Arts Production Company School,Bronx,X137,402,421,410,77.7 135 | West Bronx Academy for the Future,Bronx,X435,404,383,378, 136 | Bronx High School for Law and Community Service,Bronx,X435,401,402,386,64.8 137 | Belmont Preparatory High School,Bronx,X435,413,408,402,55.3 138 | Fordham High School for the Arts,Bronx,X435,398,404,412,56.2 139 | Knowledge and Power Preparatory Academy International High School (KAPPA),Bronx,X435,408,417,404,66.7 140 | Fordham Leadership Academy for Business and Technology,Bronx,X435,355,373,368,44.3 141 | Metropolitan High School,Bronx,X099,387,388,386,65.9 142 | Holcombe L. Rucker School of Community Research,Bronx,X039,376,372,369,59.0 143 | Banana Kelly High School,Bronx,X039,378,391,378,25.7 144 | Bronx Studio School for Writers and Artists,Bronx,X392,417,412,403,71.6 145 | Peace and Diversity Academy,Bronx,X099,366,362,365,27.1 146 | East Bronx Academy for the Future,Bronx,X973,418,406,408,41.1 147 | Bronx Envision Academy,Bronx,X098,364,385,366,76.5 148 | Fannie Lou Hamer Freedom High School,Bronx,X878,345,347,339,75.0 149 | Explorations Academy,Bronx,X098,377,372,365,43.0 150 | Urban Assembly School for Wildlife Conservation,Bronx,X067,393,397,379,71.1 151 | Wings Academy,Bronx,X879,379,372,373,49.2 152 | Renaissance High School for Musical Theater and Technology,Bronx,X405,390,411,393,52.3 153 | Herbert H. Lehman High School,Bronx,X405,426,419,407,28.9 154 | Bronx High School for the Visual Arts,Bronx,X839,408,428,404, 155 | In-Tech Academy,Bronx,X368,426,419,404,85.9 156 | Bronx School of Law and Finance,Bronx,X475,384,394,366,48.3 157 | Bronx Engineering and Technology Academy,Bronx,X475,394,406,391,59.6 158 | Bronx Theatre High School,Bronx,X475,382,384,390,66.7 159 | Marble Hill High School for International Studies,Bronx,X475,451,417,423,92.9 160 | "Marie Curie School for Medicine, Nursing, and Health Professions",Bronx,X143,423,420,425,68.6 161 | Riverdale/Kingsbridge Academy,Bronx,X141,496,485,476,69.4 162 | New World High School,Bronx,X362,407,363,358,93.0 163 | Bronxwood Preparatory Academy,Bronx,X362,392,408,392,43.3 164 | Academy for Scholarship and Entrepreneurship (College Board),Bronx,X362,392,408,400,63.4 165 | High School for Contemporary Arts,Bronx,X425,367,381,361,41.0 166 | Bronx Aerospace High School,Bronx,X425,403,410,393,50.5 167 | Bronx Academy of Health Careers,Bronx,X425,386,380,391,59.4 168 | High School of Computers and Technology,Bronx,X425,396,399,377,65.6 169 | Bronx Lab School,Bronx,X425,407,416,401,77.4 170 | Bronx High School for Writing and Communication Arts,Bronx,X425,380,437,425,38.1 171 | High School for Teaching and the Professions,Bronx,X430,372,361,369,46.5 172 | Bronx High School of Science,Bronx,X445,714,660,667,97.0 173 | Kingsbridge International High School,Bronx,X430,366,311,310, 174 | Discovery High School,Bronx,X430,432,396,395,39.9 175 | Celia Cruz Bronx High School of Music,Bronx,X430,417,434,425,75.6 176 | High School of American Studies at Lehman College,Bronx,X905,669,672,672,91.8 177 | DeWitt Clinton High School,Bronx,X440,445,436,433,31.8 178 | International School for Liberal Arts,Bronx,X430,390,387,379,19.2 179 | Astor Collegiate Academy,Bronx,X415,422,417,409,57.9 180 | Pelham Preparatory Academy,Bronx,X415,420,433,425,77.0 181 | High School of Language and Innovation,Bronx,X415,356,340,320,72.7 182 | Collegiate Institute for Math and Science,Bronx,X415,488,461,458,79.8 183 | Bronxdale High School,Bronx,X415,418,432,436,72.5 184 | Pan American International High School at Monroe,Bronx,X420,317,315,292,65.6 185 | Cinema School,Bronx,X423,430,449,448,88.3 186 | Monroe Academy for Visual Arts and Design,Bronx,X420,361,354,351,46.8 187 | Mott Hall V,Bronx,X423,430,422,414,77.5 188 | Metropolitan Soundview High School,Bronx,X420,444,428,422,52.0 189 | High School of World Cultures,Bronx,X420,356,359,347,38.2 190 | Millennium Art Academy,Bronx,X450,396,413,395,39.2 191 | Bronx Guild,Bronx,X450,365,393,357,41.3 192 | "Archimedes Academy for Math, Science, and Technology Applications",Bronx,X174,418,430,403, 193 | Pablo Neruda Academy,Bronx,X450,394,384,383,44.2 194 | Women's Academy of Excellence,Bronx,X174,386,390,389,45.2 195 | Felisa Rincon de Gautier Institute for Law and Public Policy,Bronx,X972,389,408,413,31.3 196 | Antonia Pantoja Preparatory Academy (College Board),Bronx,X450,435,415,423,44.9 197 | Bronx Health Sciences High School,Bronx,X455,407,421,427,87.1 198 | Harry S. Truman High School,Bronx,X455,400,401,391,41.5 199 | Queens Vocational and Technical High School,Queens,Q600,467,436,432,53.4 200 | High School of Applied Communication,Queens,Q735,435,437,441,70.9 201 | Middle College High School at LaGuardia Community College,Queens,Q520,377,389,377,48.7 202 | Academy for Careers in Television and Film,Queens,Q404,444,458,444,95.0 203 | Aviation Career and Technical Education High School,Queens,Q610,511,464,456,78.6 204 | Academy of American Studies,Queens,Q451,495,482,479,84.8 205 | Newcomers High School,Queens,Q450,490,374,381,47.1 206 | Bard High School Early College Queens,Queens,Q735,631,598,610,94.1 207 | International High School at LaGuardia Community College,Queens,Q520,425,367,365,71.7 208 | Information Technology High School,Queens,Q725,443,420,411,58.8 209 | Robert F. Wagner Jr. Secondary School for Arts and Technology,Queens,Q891,478,445,445,71.1 210 | Academy of Finance and Enterprise,Queens,Q735,489,456,459,92.7 211 | Young Women's Leadership School in Astoria,Queens,Q739,483,464,477, 212 | William Cullen Bryant High School,Queens,Q445,466,424,426,56.9 213 | Long Island City High School,Queens,Q452,430,423,412,51.6 214 | Frank Sinatra School of the Arts High School,Queens,Q570,536,543,543,89.5 215 | Baccalaureate School for Global Education,Queens,Q798,633,620,628,98.5 216 | "Science Skills Center High School for Science, Technology, and the Creative Arts",Brooklyn,K805,399,397,386,65.9 217 | Brooklyn International High School,Brooklyn,K805,432,334,333,92.7 218 | School for International Studies,Brooklyn,K293,417,406,394,65.1 219 | Brooklyn School for Global Studies,Brooklyn,K293,393,381,402,61.8 220 | "City Polytechnic High School of Engineering, Architecture, and Technology",Brooklyn,K580,503,477,427,18.5 221 | Urban Assembly Institute of Math and Science for Young Women,Brooklyn,K313,397,415,407,82.4 222 | Urban Assembly School for Law and Justice,Brooklyn,K313,446,443,430,87.6 223 | Cobble Hill School of American Studies,Brooklyn,K804,416,420,402,55.3 224 | George Westinghouse Career and Technical Education High School,Brooklyn,K580,394,422,400,45.3 225 | Urban Assembly High School of Music and Art,Brooklyn,K805,372,372,361,55.1 226 | Cultural Academy for the Arts and Sciences,Brooklyn,K415,382,395,384,57.3 227 | Kurt Hahn Expeditionary Learning School,Brooklyn,K415,378,394,388,72.6 228 | School for Human Rights,Brooklyn,K470,398,411,400,60.8 229 | It Takes a Village Academy,Brooklyn,K415,364,374,361,62.2 230 | High School for Public Service: Heroes of Tomorrow,Brooklyn,K470,468,454,464, 231 | Arts and Media Preparatory Academy,Brooklyn,K232,370,383,374,64.2 232 | School for Democracy and Leadership,Brooklyn,K470,386,385,390,53.5 233 | Urban Assembly School for Criminal Justice,Brooklyn,K223,428,413,417,83.6 234 | Franklin Delano Roosevelt High School,Brooklyn,K505,504,411,407,54.0 235 | "Brooklyn Community High School of Communication, Arts, and Media",Brooklyn,K117,358,386,380,51.7 236 | Dr. Susan S. McKinney Secondary School of the Arts,Brooklyn,K265,332,346,350,55.1 237 | Benjamin Banneker Academy,Brooklyn,K914,479,484,472,85.5 238 | Juan Morel Campos Secondary School,Brooklyn,K071,366,356,353,56.3 239 | Brooklyn Latin School,Brooklyn,K049,625,588,591,97.5 240 | Green School: An Academy for Environmental Careers,Brooklyn,K049,384,398,399,41.1 241 | Lyons Community School,Brooklyn,K049,374,376,357,56.3 242 | World Academy for Total Community Health High School,Brooklyn,K435,380,389,384,40.9 243 | FDNY High School for Fire and Life Safety,Brooklyn,K435,365,369,357,47.7 244 | W. H. Maxwell Career and Technical Education High School,Brooklyn,K660,326,333,350,38.5 245 | High School for Civil Rights,Brooklyn,K435,391,373,376,26.4 246 | Performing Arts and Technology High School,Brooklyn,K435,375,393,394,39.8 247 | East New York Family Academy,Brooklyn,K819,464,451,421,66.7 248 | Brooklyn Lab School,Brooklyn,K420,383,376,370,46.8 249 | Multicultural High School,Brooklyn,K420,319,323,284, 250 | "School for Classics: An Academy of Thinkers, Writers, and Performers",Brooklyn,K218,387,391,383,52.8 251 | Transit Tech Career and Technical Education High School,Brooklyn,K615,387,387,384,37.2 252 | Cypress Hills Collegiate Preparatory School,Brooklyn,K420,365,370,362,53.8 253 | Academy for Young Writers,Brooklyn,K422,382,413,391,81.2 254 | Academy of Innovative Technology,Brooklyn,K420,395,376,359,57.4 255 | Fort Hamilton High School,Brooklyn,K490,513,456,451,68.7 256 | Midwood High School,Brooklyn,K405,550,514,516,85.7 257 | PROGRESS High School for Professional Careers,Brooklyn,K450,380,377,384,44.9 258 | "High School for Enterprise, Business, and Technology",Brooklyn,K450,463,446,425,54.5 259 | Brooklyn Preparatory High School,Brooklyn,K650,391,406,391,74.5 260 | El Puente Academy for Peace and Justice,Brooklyn,K778,344,380,379,62.5 261 | School for Legal Studies,Brooklyn,K450,393,390,394,34.8 262 | Williamsburg Preparatory School,Brooklyn,K650,443,440,430,87.8 263 | Williamsburg High School for Architecture and Design,Brooklyn,K650,415,424,407,60.1 264 | Frederick Douglass Academy VII High School,Brooklyn,K175,400,407,394,65.4 265 | Teachers Preparatory High School,Brooklyn,K175,394,399,412,56.6 266 | Pathways in Technology Early College High School,Brooklyn,K625,446,442,410,69.4 267 | Academy for Health Careers,Brooklyn,K625,406,405,396,48.1 268 | Boys and Girls High School,Brooklyn,K455,399,392,394, 269 | High School of Sports Management,Brooklyn,K400,367,374,361,56.2 270 | Brooklyn Studio Secondary School,Brooklyn,K721,458,434,434,67.8 271 | International High School at Lafayette,Brooklyn,K400,424,343,337,84.3 272 | Expeditionary Learning School for Community Leaders,Brooklyn,K400,420,396,396,75.0 273 | New Utrecht High School,Brooklyn,K445,488,422,417,63.2 274 | Life Academy High School for Film and Music,Brooklyn,K400,369,379,378,70.2 275 | Kingsborough Early College School,Brooklyn,K400,474,462,449,65.8 276 | Secondary School for Journalism,Brooklyn,K460,408,435,415,58.8 277 | Millennium Brooklyn High School,Brooklyn,K460,553,551,539,79.6 278 | Park Slope Collegiate,Brooklyn,K460,405,377,395,59.6 279 | Secondary School for Law,Brooklyn,K460,420,424,414,74.7 280 | Bedford Academy High School,Brooklyn,K994,505,464,456,96.2 281 | Brooklyn High School of the Arts,Brooklyn,K655,439,441,436,80.6 282 | Brooklyn Technical High School,Brooklyn,K430,682,608,606,95.5 283 | Brooklyn College Academy,Brooklyn,K917,502,495,493,98.1 284 | High School of Telecommunication Arts and Technology,Brooklyn,K485,475,440,445,81.6 285 | EBC High School for Public Service in Bushwick,Brooklyn,K913,389,374,378,50.0 286 | Brooklyn High School for Law and Technology,Brooklyn,K987,395,401,383,62.7 287 | Brooklyn Academy of Global Finance,Brooklyn,K057,395,382,391, 288 | Bushwick Leaders High School for Academic Excellence,Brooklyn,K865,393,368,382,46.8 289 | Automotive High School,Brooklyn,K610,367,381,328,31.6 290 | Frances Perkins Academy,Brooklyn,K610,399,413,400,46.3 291 | John Dewey High School,Brooklyn,K540,512,418,396,62.7 292 | Rachel Carson High School for Coastal Studies,Brooklyn,K303,436,430,421,68.4 293 | Brooklyn School for Music and Theatre,Brooklyn,K440,382,393,377,72.2 294 | Brooklyn Academy of Science and the Environment,Brooklyn,K440,419,411,416,58.5 295 | Medgar Evers College Preparatory School,Brooklyn,K590,525,500,481,89.0 296 | Clara Barton High School,Brooklyn,K600,408,424,407,55.0 297 | International High School at Prospect Heights,Brooklyn,K440,344,302,300,81.7 298 | High School for Global Citizenship,Brooklyn,K440,377,386,375,61.9 299 | "Science, Technology, and Research Early College High School at Erasmus",Brooklyn,K465,496,491,484,91.5 300 | Academy for College Preparation and Career Exploration (College Board),Brooklyn,K465,386,397,393,57.3 301 | High School for Youth and Community Development at Erasmus,Brooklyn,K465,360,382,359,63.2 302 | High School for Service and Learning at Erasmus,Brooklyn,K465,377,382,356,45.5 303 | Academy of Hospitality and Tourism,Brooklyn,K465,374,385,375,62.0 304 | James Madison High School,Brooklyn,K425,492,450,444,69.0 305 | Edward R. Murrow High School,Brooklyn,K525,500,479,472,75.2 306 | Brooklyn Secondary School for Collaborative Studies,Brooklyn,K142,401,411,404, 307 | Sunset Park High School,Brooklyn,K564,398,380,381,61.6 308 | Brooklyn Collegiate (College Board),Brooklyn,K055,394,395,399,64.4 309 | Gotham Professional Arts Academy,Brooklyn,K040,377,396,386,50.7 310 | Leon M. Goldstein High School for the Sciences,Brooklyn,K535,563,534,543,94.0 311 | Abraham Lincoln High School,Brooklyn,K410,441,422,422,54.9 312 | William E. Grady Career and Technical Education High School,Brooklyn,K620,416,423,387,31.4 313 | Urban Action Academy,Brooklyn,K500,362,396,393,44.9 314 | Brooklyn Generation School,Brooklyn,K515,392,406,403,50.0 315 | High School for Medical Professions,Brooklyn,K500,404,427,424,60.2 316 | High School for Innovation in Advertising and Media,Brooklyn,K500,390,410,397,59.1 317 | Victory Collegiate High School,Brooklyn,K515,386,408,402,72.7 318 | Brooklyn Theatre Arts High School,Brooklyn,K515,379,393,373,69.1 319 | Academy for Conservation and the Environment,Brooklyn,K515,381,397,390,50.8 320 | All City Leadership Secondary School,Brooklyn,K554,467,446,448,85.0 321 | Bushwick School for Social Justice,Brooklyn,K480,365,357,357,50.0 322 | Academy for Environmental Leadership,Brooklyn,K480,365,366,348,71.3 323 | Academy of Urban Planning,Brooklyn,K480,392,374,379,41.9 324 | ACORN Community High School,Brooklyn,K909,379,395,385,61.3 325 | Flushing High School,Queens,Q460,444,407,405, 326 | East-West School of International Studies,Queens,Q237,521,457,451,89.4 327 | Flushing International High School,Queens,Q189,481,323,323,67.7 328 | World Journalism Preparatory (College Board),Queens,Q025,484,491,487,89.2 329 | Bayside High School,Queens,Q405,523,479,485,76.7 330 | Benjamin N. Cardozo High School,Queens,Q415,563,505,510,75.6 331 | Francis Lewis High School,Queens,Q430,562,483,485,80.7 332 | Queens School of Inquiry,Queens,Q168,516,493,486,88.2 333 | Robert F. Kennedy Community High School,Queens,Q707,460,426,423,67.3 334 | John Bowne High School,Queens,Q425,467,422,425,62.1 335 | Townsend Harris High School,Queens,Q515,680,640,661,97.1 336 | High School for Arts and Business,Queens,Q456,413,405,393,76.7 337 | Civic Leadership Academy,Queens,Q744,435,424,418,68.9 338 | Maspeth High School,Queens,Q585,476,471,480,90.0 339 | Pan American International High School,Queens,Q744,340,320,318,31.9 340 | Newtown High School,Queens,Q455,434,401,389,39.1 341 | Forest Hills High School,Queens,Q440,517,485,483,72.8 342 | Queens Metropolitan High School,Queens,Q686,460,448,449,76.4 343 | Grover Cleveland High School,Queens,Q485,452,422,416,38.9 344 | Humanities and Arts Magnet High School,Queens,Q490,384,409,401, 345 | "Mathematics, Science Research, and Technology Magnet High School",Queens,Q490,380,418,388,54.9 346 | Pathways College Preparatory School (College Board),Queens,Q192,405,427,409,72.4 347 | Excelsior Preparatory High School,Queens,Q420,384,407,400,70.1 348 | Preparatory Academy for Writers (College Board),Queens,Q420,398,410,393,69.5 349 | Queens Preparatory Academy,Queens,Q420,423,422,403,83.7 350 | George Washington Carver High School for the Sciences,Queens,Q420,439,428,419,63.5 351 | "High School for Construction Trades, Engineering, and Architecture",Queens,Q650,489,457,451,78.9 352 | John Adams High School,Queens,Q480,418,401,395,38.4 353 | Robert H. Goddard High School of Communication Arts and Technology,Queens,Q202,426,435,424,85.1 354 | Richmond Hill High School,Queens,Q475,413,406,399,37.9 355 | Cambria Heights Academy,Queens,Q799,418,424,411,58.5 356 | "Queens High School of Teaching, Liberal Arts, and the Sciences",Queens,Q566,453,434,439,72.4 357 | Martin Van Buren High School,Queens,Q435,397,396,391,40.0 358 | Queens Gateway to Health Sciences Secondary School,Queens,Q695,524,511,514,92.5 359 | Jamaica Gateway to the Sciences,Queens,Q470,487,460,463,78.6 360 | High School for Community Leadership,Queens,Q470,415,392,386,72.3 361 | Young Women's Leadership School in Queens,Queens,Q680,415,420,433,90.4 362 | Queens Collegiate (College Board),Queens,Q470,455,439,441,74.8 363 | Hillcrest High School,Queens,Q505,448,432,426, 364 | Thomas A. Edison Career and Technical Education High School,Queens,Q620,514,473,470,80.0 365 | Hillside Arts and Letters Academy,Queens,Q470,409,399,404,62.6 366 | York Early College Academy,Queens,Q008,496,481,473,92.9 367 | Queens High School for the Sciences at York College,Queens,Q774,701,621,625,97.9 368 | High School for Law Enforcement and Public Safety,Queens,Q690,410,431,409,56.6 369 | August Martin High School,Queens,Q400,366,372,364,26.3 370 | Frederick Douglass Academy VI High School,Queens,Q465,410,418,407,30.1 371 | Academy of Medical Technology (College Board),Queens,Q465,422,424,415,67.6 372 | "Queens High School for Information, Research, and Technology",Queens,Q465,372,362,352,44.6 373 | Rockaway Park High School for Environmental Sustainability,Queens,Q410,357,381,376,38.5 374 | Channel View School for Research,Queens,Q410,427,430,423,76.6 375 | Rockaway Collegiate High School,Queens,Q410,399,403,405,46.5 376 | Scholars' Academy,Queens,Q180,588,560,568,99.2 377 | -------------------------------------------------------------------------------- /Analyzing Unicorn Companies/notebook.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"source":"![Hand with calculator](calculator.png \"Calculator\")\n\nDid you know that the average return from investing in stocks is 10% per year! But who wants to be average?! \n\nYou have been asked to support an investment firm by analyzing trends in high-growth companies. They are interested in understanding which industries are producing the highest valuations and the rate at which new high-value companies are emerging. Providing them with this information gives them a competitive insight as to industry trends and how they should structure their portfolio looking forward.\n\nYou have been given access to their `unicorns` database, which contains the following tables:\n\n`dates`\n\n| Column | Description |\n|------------- |--------------------------------------------- |\n| company_id | A unique ID for the company. |\n| date_joined | The date that the company became a unicorn. |\n| year_founded | The year that the company was founded. |\n\n`funding`\n\n| Column | Description |\n|----------------- |--------------------------------------------- |\n| company_id | A unique ID for the company. |\n| valuation | Company value in US dollars. |\n| funding | The amount of funding raised in US dollars. |\n| select_investors | A list of key investors in the company. |\n\n`industries`\n\n| Column | Description |\n|------------- |--------------------------------------------- |\n| company_id | A unique ID for the company. |\n| industry | The industry that the company operates in. |\n\n`companies`\n\n| Column | Description |\n|------------- |-------------------------------------------------- |\n| company_id | A unique ID for the company. |\n| company | The name of the company. |\n| city | The city where the company is headquartered. |\n| country | The country where the company is headquartered. |\n| continent | The continent where the company is headquartered. |\n","metadata":{},"id":"1fe66cd5-4e11-4046-9e68-016430b84ecd","cell_type":"markdown"},{"source":"**1. Find the 3 best-performing industries based on the number of new unicorns created over three years (2019, 2020, and 2021) combined.**","metadata":{},"id":"cff298d0-66c0-4c8b-8016-becbd3852b86","cell_type":"markdown"},{"source":"SELECT \n i.industry,\n COUNT(i.*) AS count_new_unicorns\nFROM industries i\nJOIN dates d ON i.company_id = d.company_id\nWHERE DATE_PART('year', d.date_joined) IN ('2019', '2020', '2021')\nGROUP BY i.industry\nORDER BY count_new_unicorns DESC\nLIMIT 3","metadata":{"customType":"sql","dataFrameVariableName":"df","initial":false,"integrationId":"89e17161-a224-4a8a-846b-0adc0fe7a4b1","queuedAt":1667572241569,"executionStartedAt":1667572241845,"executionStoppedAt":1667572243030,"lastSuccessfullyExecutedCode":"SELECT \n i.industry,\n COUNT(i.*) AS count_new_unicorns\nFROM industries i\nJOIN dates d ON i.company_id = d.company_id\nWHERE DATE_PART('year', d.date_joined) IN ('2019', '2020', '2021')\nGROUP BY i.industry\nORDER BY count_new_unicorns DESC\nLIMIT 3"},"id":"a534c175-bbb3-4584-9ee3-ed488900dfbe","cell_type":"code","execution_count":84,"outputs":[{"output_type":"execute_result","execution_count":84,"data":{"application/com.datacamp.data-table.v1+json":{"table":{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"industry","type":"string"},{"name":"count_new_unicorns","type":"integer"}],"primaryKey":["index"],"pandas_version":"1.4.0"},"data":[{"index":0,"industry":"Fintech","count_new_unicorns":173},{"index":1,"industry":"Internet software & services","count_new_unicorns":152},{"index":2,"industry":"E-commerce & direct-to-consumer","count_new_unicorns":75}]},"total_rows":3,"truncation_type":null},"text/plain":" industry count_new_unicorns\n0 Fintech 173\n1 Internet software & services 152\n2 E-commerce & direct-to-consumer 75","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
industrycount_new_unicorns
0Fintech173
1Internet software & services152
2E-commerce & direct-to-consumer75
\n
"},"metadata":{}}]},{"source":"**2. Calculate the number of unicorns and the average valuation, grouped by year and industry.**","metadata":{},"id":"0c67eedc-797c-4367-bcc5-82b48bd2852a","cell_type":"markdown"},{"source":"SELECT i.industry,\n\t\tDATE_PART('year', d.date_joined) AS year,\n \tCOUNT(i.*) AS num_unicorns,\n \tAVG(f.valuation) AS average_valuation\nFROM industries i\nJOIN dates d ON i.company_id = d.company_id\nJOIN funding f ON d.company_id = f.company_id\nGROUP BY i.industry, year","metadata":{"customType":"sql","dataFrameVariableName":"df","initial":false,"integrationId":"89e17161-a224-4a8a-846b-0adc0fe7a4b1","queuedAt":1667572241579,"executionStartedAt":1667572243049,"executionStoppedAt":1667572244348,"lastSuccessfullyExecutedCode":"SELECT i.industry,\n\t\tDATE_PART('year', d.date_joined) AS year,\n \tCOUNT(i.*) AS num_unicorns,\n \tAVG(f.valuation) AS average_valuation\nFROM industries i\nJOIN dates d ON i.company_id = d.company_id\nJOIN funding f ON d.company_id = f.company_id\nGROUP BY i.industry, year"},"cell_type":"code","id":"6363bfba-0a65-4674-af08-152b6641ace9","execution_count":85,"outputs":[{"output_type":"execute_result","execution_count":85,"data":{"application/com.datacamp.data-table.v1+json":{"table":{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"industry","type":"string"},{"name":"year","type":"integer"},{"name":"num_unicorns","type":"integer"},{"name":"average_valuation","type":"number"}],"primaryKey":["index"],"pandas_version":"1.4.0"},"data":[{"index":0,"industry":"Mobile & telecommunications","year":2017,"num_unicorns":5,"average_valuation":2800000000},{"index":1,"industry":"Internet software & services","year":2015,"num_unicorns":4,"average_valuation":1250000000},{"index":2,"industry":"Fintech","year":2018,"num_unicorns":10,"average_valuation":8600000000},{"index":3,"industry":"Mobile & telecommunications","year":2019,"num_unicorns":4,"average_valuation":2000000000},{"index":4,"industry":"Artificial intelligence","year":2012,"num_unicorns":1,"average_valuation":2000000000},{"index":5,"industry":"Fintech","year":2015,"num_unicorns":2,"average_valuation":5500000000},{"index":6,"industry":"Hardware","year":2020,"num_unicorns":1,"average_valuation":2000000000},{"index":7,"industry":"Data management & analytics","year":2019,"num_unicorns":4,"average_valuation":11500000000},{"index":8,"industry":"Supply chain, logistics, & delivery","year":2018,"num_unicorns":11,"average_valuation":3454545454.5454545},{"index":9,"industry":"Travel","year":2017,"num_unicorns":2,"average_valuation":2000000000},{"index":10,"industry":"Supply chain, logistics, & delivery","year":2019,"num_unicorns":8,"average_valuation":3000000000},{"index":11,"industry":"Hardware","year":2015,"num_unicorns":4,"average_valuation":4250000000},{"index":12,"industry":"Artificial intelligence","year":2016,"num_unicorns":1,"average_valuation":1000000000},{"index":13,"industry":"Artificial intelligence","year":2018,"num_unicorns":13,"average_valuation":3000000000},{"index":14,"industry":"Auto & transportation","year":2014,"num_unicorns":1,"average_valuation":7000000000},{"index":15,"industry":"Consumer & retail","year":2018,"num_unicorns":6,"average_valuation":2333333333.333333},{"index":16,"industry":"Auto & transportation","year":2022,"num_unicorns":2,"average_valuation":3000000000},{"index":17,"industry":"Other","year":2018,"num_unicorns":3,"average_valuation":11666666666.666666},{"index":18,"industry":"Other","year":2016,"num_unicorns":2,"average_valuation":2000000000},{"index":19,"industry":"Health","year":2022,"num_unicorns":7,"average_valuation":1857142857.1428568},{"index":20,"industry":"Travel","year":2021,"num_unicorns":3,"average_valuation":2666666666.6666665},{"index":21,"industry":"Artificial intelligence","year":2020,"num_unicorns":3,"average_valuation":4000000000},{"index":22,"industry":"Data management & analytics","year":2013,"num_unicorns":1,"average_valuation":2000000000},{"index":23,"industry":"Edtech","year":2020,"num_unicorns":4,"average_valuation":2750000000},{"index":24,"industry":"Other","year":2012,"num_unicorns":1,"average_valuation":100000000000},{"index":25,"industry":"Artificial intelligence","year":2017,"num_unicorns":4,"average_valuation":47500000000},{"index":26,"industry":"Supply chain, logistics, & delivery","year":2022,"num_unicorns":8,"average_valuation":1875000000},{"index":27,"industry":"Cybersecurity","year":2015,"num_unicorns":2,"average_valuation":6000000000},{"index":28,"industry":"Internet software & services","year":2011,"num_unicorns":1,"average_valuation":6000000000},{"index":29,"industry":"Hardware","year":2016,"num_unicorns":2,"average_valuation":8000000000},{"index":30,"industry":"Cybersecurity","year":2021,"num_unicorns":27,"average_valuation":2518518518.5185184},{"index":31,"industry":"Edtech","year":2021,"num_unicorns":12,"average_valuation":2000000000},{"index":32,"industry":"Health","year":2018,"num_unicorns":7,"average_valuation":6142857142.857143},{"index":33,"industry":"Internet software & services","year":2016,"num_unicorns":1,"average_valuation":1000000000},{"index":34,"industry":"E-commerce & direct-to-consumer","year":2012,"num_unicorns":1,"average_valuation":27000000000},{"index":35,"industry":"E-commerce & direct-to-consumer","year":2018,"num_unicorns":4,"average_valuation":27250000000},{"index":36,"industry":"Fintech","year":2011,"num_unicorns":1,"average_valuation":46000000000},{"index":37,"industry":"E-commerce & direct-to-consumer","year":2020,"num_unicorns":16,"average_valuation":4000000000},{"index":38,"industry":"Internet software & services","year":2021,"num_unicorns":119,"average_valuation":2151260504.2016807},{"index":39,"industry":"Travel","year":2015,"num_unicorns":1,"average_valuation":2000000000},{"index":40,"industry":"Health","year":2019,"num_unicorns":3,"average_valuation":3333333333.333333},{"index":41,"industry":"Mobile & telecommunications","year":2020,"num_unicorns":8,"average_valuation":3125000000},{"index":42,"industry":"Consumer & retail","year":2019,"num_unicorns":3,"average_valuation":3666666666.6666665},{"index":43,"industry":"Other","year":2019,"num_unicorns":9,"average_valuation":2888888888.888889},{"index":44,"industry":"Mobile & telecommunications","year":2021,"num_unicorns":6,"average_valuation":1833333333.3333333},{"index":45,"industry":"Mobile & telecommunications","year":2016,"num_unicorns":1,"average_valuation":7000000000},{"index":46,"industry":"Supply chain, logistics, & delivery","year":2017,"num_unicorns":1,"average_valuation":1000000000},{"index":47,"industry":"Consumer & retail","year":2016,"num_unicorns":3,"average_valuation":1333333333.3333333},{"index":48,"industry":"Edtech","year":2015,"num_unicorns":2,"average_valuation":1000000000},{"index":49,"industry":"Hardware","year":2021,"num_unicorns":14,"average_valuation":2000000000},{"index":50,"industry":"Internet software & services","year":2017,"num_unicorns":4,"average_valuation":3750000000},{"index":51,"industry":"Health","year":2016,"num_unicorns":1,"average_valuation":2000000000},{"index":52,"industry":"Other","year":2021,"num_unicorns":21,"average_valuation":1714285714.2857141},{"index":53,"industry":"Other","year":2022,"num_unicorns":5,"average_valuation":1800000000},{"index":54,"industry":"E-commerce & direct-to-consumer","year":2014,"num_unicorns":4,"average_valuation":1750000000},{"index":55,"industry":"Data management & analytics","year":2022,"num_unicorns":4,"average_valuation":1000000000},{"index":56,"industry":"Internet software & services","year":2018,"num_unicorns":14,"average_valuation":7928571428.571427},{"index":57,"industry":"E-commerce & direct-to-consumer","year":2021,"num_unicorns":47,"average_valuation":2468085106.382979},{"index":58,"industry":"E-commerce & direct-to-consumer","year":2016,"num_unicorns":6,"average_valuation":6666666666.666666},{"index":59,"industry":"Artificial intelligence","year":2015,"num_unicorns":2,"average_valuation":1500000000},{"index":60,"industry":"Travel","year":2018,"num_unicorns":4,"average_valuation":4750000000},{"index":61,"industry":"Other","year":2020,"num_unicorns":11,"average_valuation":3000000000},{"index":62,"industry":"Edtech","year":2019,"num_unicorns":1,"average_valuation":1000000000},{"index":63,"industry":"Health","year":2014,"num_unicorns":1,"average_valuation":4000000000},{"index":64,"industry":"Auto & transportation","year":2018,"num_unicorns":11,"average_valuation":2454545454.5454545},{"index":65,"industry":"Fintech","year":2014,"num_unicorns":1,"average_valuation":95000000000},{"index":66,"industry":"Cybersecurity","year":2022,"num_unicorns":8,"average_valuation":1000000000},{"index":67,"industry":"Edtech","year":2016,"num_unicorns":2,"average_valuation":4000000000},{"index":68,"industry":"E-commerce & direct-to-consumer","year":2015,"num_unicorns":9,"average_valuation":1555555555.5555556},{"index":69,"industry":"Auto & transportation","year":2020,"num_unicorns":5,"average_valuation":3000000000},{"index":70,"industry":"Health","year":2020,"num_unicorns":9,"average_valuation":3111111111.111111},{"index":71,"industry":"Auto & transportation","year":2019,"num_unicorns":6,"average_valuation":4166666666.6666665},{"index":72,"industry":"Cybersecurity","year":2018,"num_unicorns":1,"average_valuation":8000000000},{"index":73,"industry":"Mobile & telecommunications","year":2018,"num_unicorns":5,"average_valuation":1800000000},{"index":74,"industry":"Fintech","year":2022,"num_unicorns":31,"average_valuation":1709677419.3548388},{"index":75,"industry":"E-commerce & direct-to-consumer","year":2019,"num_unicorns":12,"average_valuation":2583333333.333333},{"index":76,"industry":"Edtech","year":2018,"num_unicorns":2,"average_valuation":5500000000},{"index":77,"industry":"Mobile & telecommunications","year":2014,"num_unicorns":3,"average_valuation":2333333333.333333},{"index":78,"industry":"Fintech","year":2020,"num_unicorns":15,"average_valuation":4333333333.333333},{"index":79,"industry":"Artificial intelligence","year":2019,"num_unicorns":14,"average_valuation":4500000000},{"index":80,"industry":"Mobile & telecommunications","year":2015,"num_unicorns":4,"average_valuation":1500000000},{"index":81,"industry":"Supply chain, logistics, & delivery","year":2014,"num_unicorns":1,"average_valuation":39000000000},{"index":82,"industry":"Mobile & telecommunications","year":2022,"num_unicorns":2,"average_valuation":1000000000},{"index":83,"industry":"Hardware","year":2022,"num_unicorns":2,"average_valuation":2500000000},{"index":84,"industry":"Health","year":2015,"num_unicorns":2,"average_valuation":4000000000},{"index":85,"industry":"Internet software & services","year":2022,"num_unicorns":28,"average_valuation":2000000000},{"index":86,"industry":"Auto & transportation","year":2015,"num_unicorns":1,"average_valuation":2000000000},{"index":87,"industry":"Artificial intelligence","year":2022,"num_unicorns":10,"average_valuation":1600000000},{"index":88,"industry":"Other","year":2017,"num_unicorns":4,"average_valuation":1750000000},{"index":89,"industry":"Cybersecurity","year":2020,"num_unicorns":7,"average_valuation":3285714285.7142854},{"index":90,"industry":"Auto & transportation","year":2016,"num_unicorns":1,"average_valuation":2000000000},{"index":91,"industry":"Data management & analytics","year":2021,"num_unicorns":21,"average_valuation":2142857142.8571427},{"index":92,"industry":"Consumer & retail","year":2021,"num_unicorns":7,"average_valuation":2571428571.4285717},{"index":93,"industry":"Internet software & services","year":2020,"num_unicorns":20,"average_valuation":4350000000},{"index":94,"industry":"Hardware","year":2018,"num_unicorns":9,"average_valuation":2666666666.6666665},{"index":95,"industry":"Consumer & retail","year":2012,"num_unicorns":1,"average_valuation":2000000000},{"index":96,"industry":"Fintech","year":2021,"num_unicorns":138,"average_valuation":2753623188.405797},{"index":97,"industry":"Data management & analytics","year":2020,"num_unicorns":6,"average_valuation":3000000000},{"index":98,"industry":"Fintech","year":2017,"num_unicorns":6,"average_valuation":1666666666.6666665},{"index":99,"industry":"Data management & analytics","year":2018,"num_unicorns":3,"average_valuation":5333333333.333333},{"index":100,"industry":"Internet software & services","year":2019,"num_unicorns":13,"average_valuation":4230769230.7692313},{"index":101,"industry":"Hardware","year":2014,"num_unicorns":2,"average_valuation":3500000000},{"index":102,"industry":"Travel","year":2019,"num_unicorns":3,"average_valuation":4000000000},{"index":103,"industry":"Edtech","year":2017,"num_unicorns":4,"average_valuation":10500000000},{"index":104,"industry":"E-commerce & direct-to-consumer","year":2017,"num_unicorns":4,"average_valuation":1500000000},{"index":105,"industry":"Supply chain, logistics, & delivery","year":2021,"num_unicorns":25,"average_valuation":2200000000},{"index":106,"industry":"Auto & transportation","year":2021,"num_unicorns":4,"average_valuation":3750000000},{"index":107,"industry":"Health","year":2017,"num_unicorns":4,"average_valuation":3000000000},{"index":108,"industry":"Health","year":2021,"num_unicorns":40,"average_valuation":1950000000},{"index":109,"industry":"Supply chain, logistics, & delivery","year":2020,"num_unicorns":2,"average_valuation":2000000000},{"index":110,"industry":"Data management & analytics","year":2017,"num_unicorns":2,"average_valuation":2500000000},{"index":111,"industry":"Cybersecurity","year":2013,"num_unicorns":1,"average_valuation":1000000000},{"index":112,"industry":"Edtech","year":2022,"num_unicorns":1,"average_valuation":1000000000},{"index":113,"industry":"Artificial intelligence","year":2021,"num_unicorns":36,"average_valuation":1416666666.6666665},{"index":114,"industry":"Supply chain, logistics, & delivery","year":2016,"num_unicorns":1,"average_valuation":1000000000},{"index":115,"industry":"E-commerce & direct-to-consumer","year":2007,"num_unicorns":1,"average_valuation":1000000000},{"index":116,"industry":"Internet software & services","year":2013,"num_unicorns":1,"average_valuation":3000000000},{"index":117,"industry":"Consumer & retail","year":2020,"num_unicorns":1,"average_valuation":15000000000},{"index":118,"industry":"Cybersecurity","year":2019,"num_unicorns":4,"average_valuation":2250000000},{"index":119,"industry":"E-commerce & direct-to-consumer","year":2022,"num_unicorns":7,"average_valuation":1571428571.4285715},{"index":120,"industry":"Other","year":2015,"num_unicorns":2,"average_valuation":1000000000},{"index":121,"industry":"Consumer & retail","year":2017,"num_unicorns":4,"average_valuation":10500000000},{"index":122,"industry":"Fintech","year":2019,"num_unicorns":20,"average_valuation":6800000000},{"index":123,"industry":"Travel","year":2022,"num_unicorns":1,"average_valuation":1000000000}]},"total_rows":124,"truncation_type":null},"text/plain":" industry year num_unicorns average_valuation\n0 Mobile & telecommunications 2017 5 2.800000e+09\n1 Internet software & services 2015 4 1.250000e+09\n2 Fintech 2018 10 8.600000e+09\n3 Mobile & telecommunications 2019 4 2.000000e+09\n4 Artificial intelligence 2012 1 2.000000e+09\n.. ... ... ... ...\n119 E-commerce & direct-to-consumer 2022 7 1.571429e+09\n120 Other 2015 2 1.000000e+09\n121 Consumer & retail 2017 4 1.050000e+10\n122 Fintech 2019 20 6.800000e+09\n123 Travel 2022 1 1.000000e+09\n\n[124 rows x 4 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
industryyearnum_unicornsaverage_valuation
0Mobile & telecommunications201752.800000e+09
1Internet software & services201541.250000e+09
2Fintech2018108.600000e+09
3Mobile & telecommunications201942.000000e+09
4Artificial intelligence201212.000000e+09
...............
119E-commerce & direct-to-consumer202271.571429e+09
120Other201521.000000e+09
121Consumer & retail201741.050000e+10
122Fintech2019206.800000e+09
123Travel202211.000000e+09
\n

124 rows × 4 columns

\n
"},"metadata":{}}]},{"source":"**3. Create 2 CTEs for 2 two tables above and run**","metadata":{},"cell_type":"markdown","id":"eefbd02d-b701-42be-8251-1b8237f49a3b"},{"source":"WITH top_industries AS (\n\tSELECT \n \ti.industry, \n COUNT(i.*)\n FROM industries AS i\n JOIN dates AS d\n ON i.company_id = d.company_id\n WHERE DATE_PART('year', d.date_joined) IN ('2019', '2020', '2021')\n GROUP BY industry\n ORDER BY count DESC\n LIMIT 3\n),\n\nyearly_ranks AS \n(\n SELECT \n \tCOUNT(i.*) AS num_unicorns,\n i.industry,\n DATE_PART('year', d.date_joined) AS year,\n AVG(f.valuation) AS average_valuation\n FROM industries AS i\n JOIN dates AS d\n ON i.company_id = d.company_id\n JOIN funding AS f\n ON d.company_id = f.company_id\n GROUP BY industry, year\n)\n\nSELECT \n\tindustry,\n year,\n num_unicorns,\n ROUND(AVG(average_valuation / 1000000000), 2) AS average_valuation_billions\nFROM yearly_ranks\nWHERE year in ('2019', '2020', '2021')\n\tAND industry in (SELECT industry FROM top_industries)\nGROUP BY industry, num_unicorns, year, average_valuation\nORDER BY industry, year DESC","metadata":{"customType":"sql","dataFrameVariableName":"df","initial":false,"integrationId":"89e17161-a224-4a8a-846b-0adc0fe7a4b1","queuedAt":1667572241581,"executionStartedAt":1667572244370,"executionStoppedAt":1667572245287,"lastSuccessfullyExecutedCode":"WITH top_industries AS (\n\tSELECT \n \ti.industry, \n COUNT(i.*)\n FROM industries AS i\n JOIN dates AS d\n ON i.company_id = d.company_id\n WHERE DATE_PART('year', d.date_joined) IN ('2019', '2020', '2021')\n GROUP BY industry\n ORDER BY count DESC\n LIMIT 3\n),\n\nyearly_ranks AS \n(\n SELECT \n \tCOUNT(i.*) AS num_unicorns,\n i.industry,\n DATE_PART('year', d.date_joined) AS year,\n AVG(f.valuation) AS average_valuation\n FROM industries AS i\n JOIN dates AS d\n ON i.company_id = d.company_id\n JOIN funding AS f\n ON d.company_id = f.company_id\n GROUP BY industry, year\n)\n\nSELECT \n\tindustry,\n year,\n num_unicorns,\n ROUND(AVG(average_valuation / 1000000000), 2) AS average_valuation_billions\nFROM yearly_ranks\nWHERE year in ('2019', '2020', '2021')\n\tAND industry in (SELECT industry FROM top_industries)\nGROUP BY industry, num_unicorns, year, average_valuation\nORDER BY industry, year DESC"},"cell_type":"code","id":"94800f38-764f-49fd-a955-a74d855a685d","execution_count":86,"outputs":[{"output_type":"execute_result","execution_count":86,"data":{"application/com.datacamp.data-table.v1+json":{"table":{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"industry","type":"string"},{"name":"year","type":"integer"},{"name":"num_unicorns","type":"integer"},{"name":"average_valuation_billions","type":"number"}],"primaryKey":["index"],"pandas_version":"1.4.0"},"data":[{"index":0,"industry":"E-commerce & direct-to-consumer","year":2021,"num_unicorns":47,"average_valuation_billions":2.47},{"index":1,"industry":"E-commerce & direct-to-consumer","year":2020,"num_unicorns":16,"average_valuation_billions":4},{"index":2,"industry":"E-commerce & direct-to-consumer","year":2019,"num_unicorns":12,"average_valuation_billions":2.58},{"index":3,"industry":"Fintech","year":2021,"num_unicorns":138,"average_valuation_billions":2.75},{"index":4,"industry":"Fintech","year":2020,"num_unicorns":15,"average_valuation_billions":4.33},{"index":5,"industry":"Fintech","year":2019,"num_unicorns":20,"average_valuation_billions":6.8},{"index":6,"industry":"Internet software & services","year":2021,"num_unicorns":119,"average_valuation_billions":2.15},{"index":7,"industry":"Internet software & services","year":2020,"num_unicorns":20,"average_valuation_billions":4.35},{"index":8,"industry":"Internet software & services","year":2019,"num_unicorns":13,"average_valuation_billions":4.23}]},"total_rows":9,"truncation_type":null},"text/plain":" industry year num_unicorns \\\n0 E-commerce & direct-to-consumer 2021 47 \n1 E-commerce & direct-to-consumer 2020 16 \n2 E-commerce & direct-to-consumer 2019 12 \n3 Fintech 2021 138 \n4 Fintech 2020 15 \n5 Fintech 2019 20 \n6 Internet software & services 2021 119 \n7 Internet software & services 2020 20 \n8 Internet software & services 2019 13 \n\n average_valuation_billions \n0 2.47 \n1 4.00 \n2 2.58 \n3 2.75 \n4 4.33 \n5 6.80 \n6 2.15 \n7 4.35 \n8 4.23 ","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
industryyearnum_unicornsaverage_valuation_billions
0E-commerce & direct-to-consumer2021472.47
1E-commerce & direct-to-consumer2020164.00
2E-commerce & direct-to-consumer2019122.58
3Fintech20211382.75
4Fintech2020154.33
5Fintech2019206.80
6Internet software & services20211192.15
7Internet software & services2020204.35
8Internet software & services2019134.23
\n
"},"metadata":{}}]}],"metadata":{"colab":{"name":"Welcome to DataCamp Workspaces.ipynb","provenance":[]},"editor":"DataCamp Workspace","kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.8.10"}},"nbformat":4,"nbformat_minor":5} 2 | -------------------------------------------------------------------------------- /When Was the Golden Age of Video Games/datasets/game_sales.csv: -------------------------------------------------------------------------------- 1 | Name,Platform,Publisher,Developer,Total_Shipped,Year 2 | 7 Days to Die for PC,PC,The Fun Pimps,The Fun Pimps,4.18,2013 3 | ARK: Survival Evolved for PC,PC,Studio Wildcard,Studio Wildcard,4.5,2015 4 | Age of Empires II: HD Edition for PC,PC,Microsoft Studios,Hidden Path Entertainment,5.82,2013 5 | Animal Crossing: City Folk for Wii,Wii,Nintendo,Nintendo EAD,4.32,2008 6 | Animal Crossing: New Horizons for NS,NS,Nintendo,Nintendo,13.41,2020 7 | Animal Crossing: New Leaf for 3DS,3DS,Nintendo,Nintendo EAD,12.55,2013 8 | Animal Crossing: Wild World for DS,DS,Nintendo,Nintendo EAD,11.75,2005 9 | Arma 2: Operation Arrowhead for PC,PC,Meridian4,Bohemia Interactive,4.51,2010 10 | Arma III for PC,PC,Bohemia Interactive,Bohemia Interactive,4.0,2013 11 | Assassin's Creed II for PS3,PS3,Ubisoft,Ubisoft Montreal,5.57,2009 12 | Assassin's Creed II for X360,X360,Ubisoft,Ubisoft Montreal,5.3,2009 13 | Assassin's Creed III for PS3,PS3,Ubisoft,Ubisoft Montreal,6.5,2012 14 | Assassin's Creed III for X360,X360,Ubisoft,Ubisoft Montreal,5.31,2012 15 | Assassin's Creed Origins for PS4,PS4,Ubisoft,Ubisoft Montreal,4.06,2017 16 | Assassin's Creed for PS3,PS3,Ubisoft,Ubisoft Montreal,4.83,2007 17 | Assassin's Creed for X360,X360,Ubisoft,Ubisoft Montreal,5.55,2007 18 | Assassin's Creed: Revelations for PS3,PS3,Ubisoft,Ubisoft Montreal,4.23,2011 19 | Assassin's Creed: Revelations for X360,X360,Ubisoft,Ubisoft Montreal,4.22,2011 20 | Assassin's Creed: Unity for PS4,PS4,Ubisoft,Ubisoft Montreal,4.14,2014 21 | Asteroids for 2600,2600,Atari,Atari,4.31,1981 22 | Batman: Arkham Asylum for PS3,PS3,Eidos Interactive,Rocksteady Studios,4.28,2009 23 | Batman: Arkham City for PS3,PS3,Warner Bros. Interactive,Rocksteady Studios,5.54,2011 24 | Batman: Arkham City for X360,X360,Warner Bros. Interactive,Rocksteady Studios,4.75,2011 25 | Batman: Arkham Knight for PS4,PS4,Warner Bros. Interactive,Rocksteady Studios,4.11,2015 26 | Battlefield 1 for PS4,PS4,Electronic Arts,EA DICE,7.26,2016 27 | Battlefield 1 for XOne,XOne,Electronic Arts,EA DICE,5.13,2016 28 | Battlefield 3 for PS3,PS3,Electronic Arts,Dice,7.21,2011 29 | Battlefield 3 for X360,X360,Electronic Arts,Dice,7.35,2011 30 | Big Brain Academy for DS,DS,Nintendo,Nintendo EAD,6.15,2006 31 | BioShock Infinite for PC,PC,2K Games,Irrational Games,4.56,2013 32 | Brain Age 2: More Training in Minutes a Day for DS,DS,Nintendo,Nintendo SDD,14.88,2007 33 | Brain Age: Train Your Brain in Minutes a Day for DS,DS,Nintendo,Nintendo SDD,19.01,2006 34 | Call of Duty 4: Modern Warfare for PS3,PS3,Activision,Infinity Ward,6.72,2007 35 | Call of Duty 4: Modern Warfare for X360,X360,Activision,Infinity Ward,9.41,2007 36 | Call of Duty: Advanced Warfare for PS3,PS3,Activision,High Moon Studios,4.27,2014 37 | Call of Duty: Advanced Warfare for PS4,PS4,Activision,Sledgehammer Games,7.53,2014 38 | Call of Duty: Advanced Warfare for X360,X360,Activision,High Moon Studios,4.34,2014 39 | Call of Duty: Advanced Warfare for XOne,XOne,Activision,Sledgehammer Games,5.22,2014 40 | Call of Duty: Black Ops 3 for PS4,PS4,Activision,Treyarch,15.09,2015 41 | Call of Duty: Black Ops 3 for XOne,XOne,Activision,Treyarch,7.37,2015 42 | Call of Duty: Black Ops II for PS3,PS3,Activision,Treyarch,13.8,2012 43 | Call of Duty: Black Ops II for X360,X360,Activision,Treyarch,13.86,2012 44 | Call of Duty: Black Ops IIII for PS4,PS4,Activision,Treyarch,9.32,2018 45 | Call of Duty: Black Ops IIII for XOne,XOne,Activision,Treyarch,4.85,2018 46 | Call of Duty: Black Ops for PS3,PS3,Activision,Treyarch,12.67,2010 47 | Call of Duty: Black Ops for X360,X360,Activision,Treyarch,14.74,2010 48 | Call of Duty: Ghosts for PS3,PS3,Activision,Infinity Ward,10.13,2013 49 | Call of Duty: Ghosts for PS4,PS4,Activision,Infinity Ward,4.17,2013 50 | Call of Duty: Ghosts for X360,X360,Activision,Infinity Ward,10.41,2013 51 | Call of Duty: Infinite Warfare for PS4,PS4,Activision,Infinity Ward,8.48,2016 52 | Call of Duty: Infinite Warfare for XOne,XOne,Activision,Infinity Ward,4.79,2016 53 | Call of Duty: Modern Warfare 2 for PS3,PS3,Activision,Infinity Ward,10.61,2009 54 | Call of Duty: Modern Warfare 2 for X360,X360,Activision,Infinity Ward,13.53,2009 55 | Call of Duty: Modern Warfare 3 for PS3,PS3,Activision,Infinity Ward,13.35,2011 56 | Call of Duty: Modern Warfare 3 for X360,X360,Activision,Infinity Ward,14.82,2011 57 | Call of Duty: Modern Warfare for PS4,PS4,Activision,Infinity Ward,30.13,2019 58 | Call of Duty: WWII for PS4,PS4,Activision,Sledgehammer Games,13.4,2017 59 | Call of Duty: WWII for XOne,XOne,Activision,Sledgehammer Games,6.23,2017 60 | Call of Duty: World at War for PS3,PS3,Activision,Treyarch,5.43,2008 61 | Call of Duty: World at War for X360,X360,Activision,Treyarch,7.5,2008 62 | Carnival Games for Wii,Wii,Global Star Software,Cat Daddy Games,4.06,2007 63 | Cities: Skylines for PC,PC,Paradox Interactive,Colossal Order,6.0,2015 64 | Cooking Mama for DS,DS,Majesco,Office Create,5.66,2006 65 | Counter-Strike for PC,PC,Sierra Studios,Unknown,4.2,2000 66 | Counter-Strike: Global Offensive for PC,PC,Valve,Valve Corporation,40.0,2012 67 | Counter-Strike: Source for PC,PC,VU Games,Valve Software,15.0,2004 68 | Crash Bandicoot 2: Cortex Strikes Back for PS,PS,Sony Computer Entertainment,Naughty Dog,7.58,1997 69 | Crash Bandicoot 3: Warped for PS,PS,Sony Computer Entertainment,Naughty Dog,7.13,1998 70 | Crash Bandicoot N. Sane Trilogy for PS4,PS4,Activision,Vicarious Visions,4.83,2017 71 | Crash Bandicoot for PS,PS,Sony Computer Entertainment,Naughty Dog,6.82,1996 72 | Crash Bandicoot: The Wrath of Cortex for PS2,PS2,Universal Interactive,Traveller's Tales,5.42,2001 73 | Crash Team Racing for PS,PS,Sony Computer Entertainment,Naughty Dog,4.79,1999 74 | Daxter for PSP,PSP,Sony Computer Entertainment,Ready at Dawn,4.23,2006 75 | Dead Island for PC,PC,Deep Silver,Techland,4.52,2011 76 | Destiny 2 for PS4,PS4,Activision,Bungie,4.14,2017 77 | Destiny for PS4,PS4,Activision,Bungie,5.76,2014 78 | Diablo II for PC,PC,Blizzard Entertainment,Blizzard North,4.0,2000 79 | Diablo III for PC,PC,Blizzard Entertainment,Blizzard Entertainment,12.0,2012 80 | Diddy Kong Racing for N64,N64,Nintendo,Rare Ltd.,4.88,1997 81 | Disney's Aladdin for GEN,GEN,Sega,Virgin Interactive,4.0,1993 82 | Donkey Kong 64 for N64,N64,Nintendo,Rare Ltd.,5.27,1999 83 | Donkey Kong Country 2: Diddy's Kong Quest for SNES,SNES,Nintendo,Rare Ltd.,5.15,1995 84 | Donkey Kong Country Returns for Wii,Wii,Nintendo,Retro Studios,6.53,2010 85 | Donkey Kong Country for SNES,SNES,Nintendo,Rare Ltd.,9.3,1994 86 | Dr. Mario for GB,GB,Nintendo,Nintendo R&D1,5.34,1990 87 | Dr. Mario for NES,NES,Nintendo,Nintendo R&D1,4.85,1990 88 | Dragon Quest IX: Sentinels of the Starry Skies for DS,DS,Nintendo,Level 5,5.5,2010 89 | Dragon Quest VII for PS,PS,Enix,Heart Beat,4.3,2001 90 | Dragon Quest VIII: Journey of the Cursed King for PS2,PS2,Square Enix,Level 5 / Armor Project,4.9,2005 91 | Driver 2 for PS,PS,Atari,Reflections Interactive,4.73,2000 92 | Driver for PS,PS,GT Interactive,Reflections Interactive,6.27,1999 93 | Duck Hunt for NES,NES,Nintendo,Nintendo R&D1,28.31,1985 94 | Euro Truck Simulator 2 for PC,PC,SCS Software,SCS Software,5.98,2013 95 | Excitebike for NES,NES,Nintendo,Nintendo R&D1,4.16,1985 96 | EyeToy Play for PS2,PS2,Sony Computer Entertainment,SCEE London Studio,4.0,2003 97 | FIFA 07 Soccer for PS2,PS2,EA Sports,Team Fusion,4.11,2006 98 | FIFA 13 for PS3,PS3,EA Sports,EA Canada,8.01,2012 99 | FIFA 13 for X360,X360,EA Sports,EA Canada,5.11,2012 100 | FIFA 14 for PS3,PS3,EA Sports,EA Canada,6.61,2013 101 | FIFA 14 for X360,X360,EA Sports,EA Canada,4.15,2013 102 | FIFA 15 for PS3,PS3,EA Sports,EA Canada,4.56,2014 103 | FIFA 15 for PS4,PS4,EA Sports,EA Canada,6.32,2014 104 | FIFA 16 for PS4,PS4,EA Sports,EA Canada,8.22,2015 105 | FIFA 17 for PS4,PS4,Electronic Arts,EA Canada,10.94,2016 106 | FIFA 18 for PS4,PS4,EA Sports,EA Vancouver,11.8,2017 107 | FIFA 19 for PS4,PS4,Electronic Arts,EA Sports,9.15,2018 108 | FIFA 20 for PS4,PS4,Electronic Arts,EA Sports,7.15,2019 109 | FIFA Soccer 06 for PS2,PS2,EA Sports,EA Canada,4.21,2005 110 | FIFA Soccer 11 for PS3,PS3,EA Sports,EA Canada,5.08,2010 111 | FIFA Soccer 12 for PS3,PS3,EA Sports,EA Canada,6.65,2011 112 | FIFA Soccer 12 for X360,X360,EA Sports,EA Canada,4.18,2011 113 | Fable III for X360,X360,Microsoft Game Studios,Lionhead Studios,5.1,2010 114 | Fallout 3 for PS3,PS3,Bethesda Softworks,Bethesda Game Studios,4.0,2008 115 | Fallout 3 for X360,X360,Bethesda Softworks,Bethesda Game Studios,4.96,2008 116 | Fallout 4 for PC,PC,Bethesda Softworks,Bethesda Game Studios,6.6,2015 117 | Fallout 4 for PS4,PS4,Bethesda Softworks,Bethesda Game Studios,8.48,2015 118 | Fallout 4 for XOne,XOne,Bethesda Softworks,Bethesda Game Studios,5.03,2015 119 | Fallout: New Vegas for PC,PC,Bethesda Softworks,Obsidian Entertainment,5.22,2010 120 | Fallout: New Vegas for X360,X360,Bethesda Softworks,Obsidian Entertainment,4.08,2010 121 | Far Cry 4 for PS4,PS4,Ubisoft,Ubisoft Montreal,4.06,2014 122 | Final Fantasy IX for PS,PS,Square,SquareSoft,5.5,2000 123 | Final Fantasy VII for PS,PS,Sony Computer Entertainment,SquareSoft,9.9,1997 124 | Final Fantasy VIII for PS,PS,Square EA,SquareSoft,8.6,1999 125 | Final Fantasy X for PS2,PS2,Square,SquareSoft,8.6,2001 126 | Final Fantasy X-2 for PS2,PS2,Square Enix,Square Enix,5.5,2003 127 | Final Fantasy XII for PS2,PS2,Square Enix,Square Enix,6.4,2006 128 | Final Fantasy XIII for PS3,PS3,Square Enix,Square Enix,5.35,2010 129 | Final Fantasy XV for PS4,PS4,Square Enix,Square Enix,5.07,2016 130 | Forza Motorsport 2 for X360,X360,Microsoft Game Studios,Turn 10 Studios,4.05,2007 131 | Forza Motorsport 3 for X360,X360,Microsoft Game Studios,Turn 10 Studios,5.5,2009 132 | Forza Motorsport 4 for X360,X360,Microsoft Studios,Turn 10 Studio,4.6,2011 133 | Frogger for PS,PS,Hasbro Interactive,Millenium Interactive,4.16,1997 134 | Garry's Mod for PC,PC,Valve,Facepunch Studios,16.9,2006 135 | Gears of War 2 for X360,X360,Microsoft Game Studios,Epic Games,5.0,2008 136 | Gears of War for X360,X360,Microsoft Game Studios,Epic Games,5.0,2006 137 | God of War (2018) for PS4,PS4,Sony Interactive Entertainment,SIE Santa Monica Studio,11.0,2018 138 | God of War II for PS2,PS2,Sony Computer Entertainment,SCEA Santa Monica Studio,4.24,2007 139 | God of War III for PS3,PS3,Sony Computer Entertainment,SCEA Santa Monica Studio,7.6,2010 140 | God of War for PS2,PS2,Sony Computer Entertainment,SCEA Santa Monica Studio,4.62,2005 141 | GoldenEye 007 for N64,N64,Nintendo,Rare Ltd.,8.09,1997 142 | Golf for NES,NES,Nintendo,Nintendo,4.01,1985 143 | Gran Turismo 2 for PS,PS,Sony Computer Entertainment,Polyphony Digital,9.37,1999 144 | Gran Turismo 3: A-Spec for PS2,PS2,Sony Computer Entertainment,Polyphony Digital,14.89,2001 145 | Gran Turismo 4 for PS2,PS2,Sony Computer Entertainment,Polyphony Digital,11.76,2005 146 | Gran Turismo 5 Prologue for PS3,PS3,Sony Computer Entertainment,Polyphony Digital,5.35,2008 147 | Gran Turismo 5 for PS3,PS3,Sony Computer Entertainment,Polyphony Digital,11.95,2010 148 | Gran Turismo 6 for PS3,PS3,Sony Computer Entertainment America,Polyphony Digital,5.22,2013 149 | Gran Turismo for PS,PS,Sony Computer Entertainment,Polyphony Digital,10.85,1998 150 | Gran Turismo for PSP,PSP,Sony Computer Entertainment,Polyphony Digital,4.67,2009 151 | Grand Theft Auto III for PS2,PS2,Rockstar Games,DMA Design,13.1,2001 152 | Grand Theft Auto IV for PS3,PS3,Rockstar Games,Rockstar North,10.57,2008 153 | Grand Theft Auto IV for X360,X360,Rockstar Games,Rockstar North,11.09,2008 154 | Grand Theft Auto V for PC,PC,Rockstar Games,Rockstar North,12.6,2015 155 | Grand Theft Auto V for PS3,PS3,Rockstar Games,Rockstar North,20.32,2013 156 | Grand Theft Auto V for PS4,PS4,Rockstar Games,Rockstar North,19.39,2014 157 | Grand Theft Auto V for X360,X360,Rockstar Games,Rockstar North,15.86,2013 158 | Grand Theft Auto V for XOne,XOne,Rockstar Games,Rockstar North,8.72,2014 159 | Grand Theft Auto: Liberty City Stories for PSP,PSP,Rockstar Games,Rockstar Leeds,7.72,2005 160 | Grand Theft Auto: San Andreas for PS2,PS2,Rockstar Games,Rockstar North,17.3,2004 161 | Grand Theft Auto: Vice City Stories for PSP,PSP,Rockstar Games,Rockstar Leeds,5.08,2006 162 | Grand Theft Auto: Vice City for PS2,PS2,Rockstar Games,Rockstar North,16.15,2002 163 | Guild Wars 2 for PC,PC,NCSoft,ArenaNet,7.0,2012 164 | Guild Wars for PC,PC,NCSoft,ArenaNet,6.5,2005 165 | Guitar Hero II for PS2,PS2,RedOctane,Harmonix Music Systems,5.12,2006 166 | Guitar Hero III: Legends of Rock for PS2,PS2,RedOctane,BudCat Creations,4.98,2007 167 | Guitar Hero III: Legends of Rock for Wii,Wii,RedOctane,Vicarious Visions,4.6,2007 168 | Guitar Hero III: Legends of Rock for X360,X360,RedOctane,Neversoft,4.53,2007 169 | Half-Life 2 for PC,PC,VU Games,Valve Software,12.0,2004 170 | Half-Life for PC,PC,Sierra Entertainment,Valve Software,9.3,1998 171 | Halo 2 for XB,XB,Microsoft Game Studios,Bungie Studios,8.0,2004 172 | Halo 3 for X360,X360,Microsoft Game Studios,Bungie Studios,14.5,2007 173 | Halo 3: ODST for X360,X360,Microsoft Game Studios,Bungie,6.35,2009 174 | Halo 4 for X360,X360,Microsoft Studios,343 Industries,9.96,2012 175 | Halo 5: Guardians for XOne,XOne,Microsoft Studios,343 Industries,5.0,2015 176 | Halo: Combat Evolved for XB,XB,Microsoft,Bungie Studios,5.0,2001 177 | Halo: Reach for X360,X360,Microsoft Game Studios,Bungie,9.97,2010 178 | Horizon: Zero Dawn for PS4,PS4,Sony Interactive Entertainment,Guerrilla Games,10.0,2017 179 | Just Cause 2 for PC,PC,Eidos Interactive,Avalanche Studios,4.16,2010 180 | Just Dance 2 for Wii,Wii,Ubisoft,Ubisoft Paris,5.25,2010 181 | Just Dance 3 for Wii,Wii,Ubisoft,Ubisoft Paris,10.14,2011 182 | Just Dance 4 for Wii,Wii,Ubisoft,Ubisoft,6.89,2012 183 | Just Dance for Wii,Wii,Ubisoft,Ubisoft Paris,4.0,2009 184 | Kinect Adventures! for X360,X360,Microsoft Game Studios,Good Science Studio,24.0,2010 185 | Kingdom Hearts II for PS2,PS2,Square Enix,Square Enix,5.2,2006 186 | Kingdom Hearts for PS2,PS2,Square EA,SquareSoft,6.3,2002 187 | Kirby's Dream Land for GB,GB,Nintendo,HAL Laboratory,5.13,1992 188 | LEGO Star Wars: The Complete Saga for DS,DS,LucasArts,Traveller's Tales,4.77,2007 189 | LEGO Star Wars: The Complete Saga for Wii,Wii,LucasArts,Traveller's Tales,5.66,2007 190 | Left 4 Dead for PC,PC,Valve Corporation,Valve Software,4.6,2008 191 | Link's Crossbow Training for Wii,Wii,Nintendo,Nintendo EAD,5.79,2007 192 | LittleBigPlanet for PS3,PS3,Sony Computer Entertainment,Media Molecule,4.5,2008 193 | Luigi's Mansion 3 for NS,NS,Nintendo,"Next Level Games, Inc.",6.33,2019 194 | Luigi's Mansion: Dark Moon for 3DS,3DS,Nintendo,Next Level Games,6.16,2013 195 | Madden NFL 06 for PS2,PS2,EA Sports,EA Tiburon,4.91,2005 196 | Madden NFL 07 for PS2,PS2,EA Sports,EA Tiburon,4.49,2006 197 | Madden NFL 2003 for PS2,PS2,EA Sports,EA Tiburon,4.14,2002 198 | Madden NFL 2004 for PS2,PS2,EA Sports,EA Tiburon,5.23,2003 199 | Madden NFL 2005 for PS2,PS2,EA Sports,EA Tiburon,4.53,2004 200 | Mario & Luigi: Bowser's Inside Story for DS,DS,Nintendo,AlphaDream Corporation,4.56,2009 201 | Mario & Sonic at the Olympic Games for DS,DS,Sega,Sega,5.1,2008 202 | Mario & Sonic at the Olympic Winter Games for Wii,Wii,Sega,Sega,4.54,2009 203 | Mario Kart 64 for N64,N64,Nintendo,Nintendo EAD,9.87,1997 204 | Mario Kart 7 for 3DS,3DS,Nintendo,Nintendo EAD / Retro Studios,18.71,2011 205 | Mario Kart 8 Deluxe for NS,NS,Nintendo,Nintendo EPD,24.77,2017 206 | Mario Kart 8 for WiiU,WiiU,Nintendo,Nintendo,8.45,2014 207 | Mario Kart DS for DS,DS,Nintendo,Nintendo EAD,23.6,2005 208 | Mario Kart Wii for Wii,Wii,Nintendo,Nintendo EAD,37.32,2008 209 | Mario Kart: Double Dash!! for GC,GC,Nintendo,Nintendo EAD,6.88,2003 210 | Mario Kart: Super Circuit for GBA,GBA,Nintendo,Intelligent Systems,5.91,2001 211 | Mario Party 8 for Wii,Wii,Nintendo,Hudson Soft,8.85,2007 212 | Mario Party DS for DS,DS,Nintendo,Hudson Soft,9.31,2007 213 | Marvel's Spider-Man for PS4,PS4,Sony Interactive Entertainment,Insomniac Games,13.2,2018 214 | Medal of Honor: Frontline for PS2,PS2,Electronic Arts,EA Los Angeles,6.83,2002 215 | Medal of Honor: Rising Sun for PS2,PS2,Electronic Arts,EA Los Angeles,5.13,2003 216 | Metal Gear Solid 2: Sons of Liberty for PS2,PS2,Konami,Konami Computer Entertainment Japan,6.05,2001 217 | Metal Gear Solid 3: Snake Eater for PS2,PS2,Konami,KCEJ / Kojima Productions,4.23,2004 218 | Metal Gear Solid 4: Guns of the Patriots for PS3,PS3,Konami,Kojima Productions,6.0,2008 219 | Metal Gear Solid for PS,PS,Konami,Konami Computer Entertainment Japan,6.0,1998 220 | Michael Jackson: The Experience for Wii,Wii,Ubisoft,Ubisoft Montpellier,4.37,2010 221 | Microsoft Flight Simulator for PC,PC,Microsoft,Microsoft,5.12,1996 222 | Minecraft for PC,PC,Mojang,Mojang AB,33.15,2010 223 | Minecraft for PS3,PS3,Sony Computer Entertainment America,Mojang,6.05,2014 224 | Minecraft for PS4,PS4,Sony Computer Entertainment,Mojang,6.33,2014 225 | Minecraft for X360,X360,Microsoft Studios,Mojang,13.0,2013 226 | Minecraft for XOne,XOne,Microsoft Studios,Mojang,5.43,2014 227 | Monster Hunter 4 Ultimate for 3DS,3DS,Capcom,Capcom,4.2,2015 228 | Monster Hunter 4 for 3DS,3DS,Capcom,Capcom,4.1,2013 229 | Monster Hunter Freedom 3 for PSP,PSP,Capcom,Capcom,4.9,2010 230 | Monster Hunter Generations for 3DS,3DS,Capcom,Capcom,4.3,2016 231 | Monster Hunter: World for PS4,PS4,Capcom,Capcom,4.0,2018 232 | Mortal Kombat 11 for PS4,PS4,NetherRealm Studios,Warner Bros. Interactive Entertainment,4.2,2019 233 | Myst for PC,PC,Broderbund,Cyan Worlds,6.3,1995 234 | NBA 2K20 for PS4,PS4,2K Sports,Visual Concepts,8.0,2019 235 | Namco Museum Vol.3 for PS,PS,Namco,Namco,4.05,1997 236 | Namco Museum for GBA,GBA,Namco,Mass Media,4.24,2001 237 | Namco Museum: 50th Anniversary for PS2,PS2,Namco,Digital Eclipse,3.98,2005 238 | Need for Speed Underground 2 for PS2,PS2,Electronic Arts,EA Black Box,6.9,2004 239 | Need for Speed Underground for PS2,PS2,Electronic Arts,EA Black Box,7.2,2003 240 | Need for Speed: Most Wanted for PS2,PS2,Electronic Arts,EA Canada,4.37,2005 241 | New Super Mario Bros. 2 for 3DS,3DS,Nintendo,Nintendo,13.34,2012 242 | New Super Mario Bros. U Deluxe for NS,NS,Nintendo,Nintendo EPD,6.6,2019 243 | New Super Mario Bros. U for WiiU,WiiU,Nintendo,Nintendo EAD,5.8,2012 244 | New Super Mario Bros. Wii for Wii,Wii,Nintendo,Nintendo EAD,30.3,2009 245 | New Super Mario Bros. for DS,DS,Nintendo,Nintendo EAD,30.8,2006 246 | Nintendo Land for WiiU,WiiU,Nintendo,Nintendo,5.2,2012 247 | Nintendogs + cats for 3DS,3DS,Nintendo,Nintendo EAD,4.59,2011 248 | Nintendogs for DS,DS,Nintendo,Nintendo EAD,23.96,2005 249 | Overwatch for PS4,PS4,Blizzard Entertainment,Blizzard Entertainment,4.54,2016 250 | PLAYERUNKNOWN'S BATTLEGROUNDS for PC,PC,PUBG Corporation,PUBG Corporation,36.6,2017 251 | Pac-Man for 2600,2600,Atari,Atari,7.7,1982 252 | Pitfall! for 2600,2600,Activision,Activision,4.5,1982 253 | Pokemon Black / White Version for DS,DS,Nintendo,Game Freak,15.64,2011 254 | Pokemon Black 2 and White 2 for DS,DS,Nintendo,Game Freak,8.52,2012 255 | Pokemon Crystal Version for GBC,GBC,Nintendo,Game Freak,6.39,2001 256 | Pokemon Diamond / Pearl Version for DS,DS,Nintendo,Game Freak,17.67,2007 257 | Pokemon Emerald Version for GBA,GBA,Nintendo,Game Freak,7.06,2005 258 | Pokemon FireRed / LeafGreen Version for GBA,GBA,Nintendo,Game Freak,12.0,2004 259 | Pokemon Gold / Silver Version for GB,GB,Nintendo,Game Freak,23.1,2000 260 | Pokemon Heart Gold / Soul Silver Version for DS,DS,Nintendo,Game Freak,12.72,2010 261 | Pokemon Mystery Dungeon: Explorers of Time / Darkness for DS,DS,Nintendo,ChunSoft,4.88,2008 262 | Pokemon Omega Ruby/Pokemon Alpha Sapphire for 3DS,3DS,Nintendo,Game Freak,14.27,2014 263 | Pokemon Pinball for GBC,GBC,Nintendo,Jupiter Corporation,5.31,1999 264 | Pokemon Platinum Version for DS,DS,Nintendo,Game Freak,7.6,2009 265 | Pokemon Red / Green / Blue Version for GB,GB,Nintendo,Game Freak,31.38,1998 266 | Pokemon Ruby / Sapphire Version for GBA,GBA,Nintendo,Game Freak,16.22,2003 267 | Pokemon Stadium for N64,N64,Nintendo,HAL Laboratory,5.46,2000 268 | Pokemon Sun/Moon for 3DS,3DS,Nintendo,Game Freak,16.18,2016 269 | Pokemon Sword / Shield for NS,NS,Nintendo,Game Freak,17.37,2019 270 | Pokemon X/Y for 3DS,3DS,Nintendo,Game Freak,16.45,2013 271 | Pokemon Yellow: Special Pikachu Edition for GB,GB,Nintendo,Game Freak,14.64,1999 272 | "Pokemon: Let's Go, Pikachu! for NS",NS,Nintendo,Game Freak,4.57,2018 273 | "Pokemon: Let's Go, Pikachu/Eevee for NS",NS,Nintendo,Game Freak,11.97,2018 274 | Pokemon: Ultra Sun and Ultra Moon for 3DS,3DS,Nintendo,Game Freak,8.77,2017 275 | Portal 2 for PC,PC,Valve,Valve Software,13.06,2011 276 | Portal for PC,PC,Valve Corporation,Valve Software,9.97,2008 277 | Professor Layton and the Curious Village for DS,DS,Nintendo,Level 5,4.49,2008 278 | Red Dead Redemption 2 for PS4,PS4,Rockstar Games,Rockstar Games,13.94,2018 279 | Red Dead Redemption 2 for XOne,XOne,Rockstar Games,Rockstar Games,5.77,2018 280 | Red Dead Redemption for PS3,PS3,Rockstar Games,Rockstar San Diego,6.57,2011 281 | Red Dead Redemption for X360,X360,Rockstar Games,Rockstar San Diego,6.5,2010 282 | Resident Evil 2 for PS,PS,Capcom,Capcom,4.96,1998 283 | Resident Evil 5 for PS3,PS3,Capcom,Capcom,5.1,2009 284 | Resistance: Fall of Man for PS3,PS3,Sony Computer Entertainment,Insomniac Games,4.37,2006 285 | Riven: The Sequel to Myst for PC,PC,Red Orb,Cyan Worlds,4.5,1997 286 | RollerCoaster Tycoon 3 for PC,PC,Atari,Frontier Developments,10.0,2004 287 | Rust for PC,PC,Facepunch Studios,Facepunch Studios,9.02,2018 288 | Sid Meier's Civilization VI for PC,PC,2K Games,Firaxis Games,5.5,2016 289 | Sonic the Hedgehog 2 for GEN,GEN,Sega,Sonic Team,6.0,1992 290 | Sonic the Hedgehog for GEN,GEN,Sega,Sonic Team,15.0,1991 291 | Spider-Man: The Movie for PS2,PS2,Activision,Treyarch,4.48,2002 292 | Splatoon 2 for NS,NS,Nintendo,Nintendo EPD,10.13,2017 293 | Splatoon for WiiU,WiiU,Nintendo,Nintendo EAD,4.95,2015 294 | Spyro the Dragon for PS,PS,Sony Computer Entertainment,Insomniac Games,5.0,1998 295 | Star Fox 64 for N64,N64,Nintendo,Nintendo EAD,4.0,1997 296 | Star Wars Battlefront (2015) for PS4,PS4,Electronic Arts,EA DICE,8.03,2015 297 | Star Wars Battlefront (2015) for XOne,XOne,Electronic Arts,EA DICE,4.15,2015 298 | Star Wars Battlefront II (2017) for PS4,PS4,Electronic Arts,EA DICE,4.53,2017 299 | StarCraft II: Wings of Liberty for PC,PC,Blizzard Entertainment,Blizzard Entertainment,4.5,2010 300 | StarCraft for PC,PC,Blizzard Entertainment,Blizzard Entertainment,11.0,1998 301 | Starbound for PC,PC,"Infocom, Inc.",Unknown,4.31,2014 302 | Stardew Valley for PC,PC,Chucklefish,ConcernedApe,4.91,2016 303 | Street Fighter II Turbo for SNES,SNES,Capcom,Capcom,4.1,1993 304 | Street Fighter II: The World Warrior for SNES,SNES,Capcom,Capcom,6.3,1992 305 | Street Fighter IV for PS3,PS3,Capcom,Capcom / Dimps Corporation,4.19,2009 306 | Super Mario 3D Land for 3DS,3DS,Nintendo,Nintendo EAD Tokyo,12.7,2011 307 | Super Mario 3D World for WiiU,WiiU,Nintendo,Nintendo EAD Tokyo,5.84,2013 308 | Super Mario 64 DS for DS,DS,Nintendo,Nintendo EAD,11.06,2004 309 | Super Mario 64 for N64,N64,Nintendo,Nintendo EAD,11.91,1996 310 | Super Mario Advance 4: Super Mario Bros. 3 for GBA,GBA,Nintendo,Nintendo EAD,5.43,2003 311 | Super Mario Advance for GBA,GBA,Nintendo,Nintendo EAD,5.57,2001 312 | Super Mario All-Stars for SNES,SNES,Nintendo,Nintendo EAD,10.55,1993 313 | Super Mario Bros. 2 for NES,NES,Nintendo,Nintendo EAD,7.46,1988 314 | Super Mario Bros. 3 for NES,NES,Nintendo,Nintendo R&D2,17.28,1990 315 | Super Mario Bros. Deluxe for GB,GB,Nintendo,Nintendo EAD,5.07,1999 316 | Super Mario Bros. for NES,NES,Nintendo,Nintendo EAD,40.24,1985 317 | Super Mario Galaxy 2 for Wii,Wii,Nintendo,Nintendo EAD Tokyo,7.41,2010 318 | Super Mario Galaxy for Wii,Wii,Nintendo,Nintendo EAD Tokyo,12.8,2007 319 | Super Mario Kart for SNES,SNES,Nintendo,Nintendo EAD,8.76,1992 320 | Super Mario Land 2: 6 Golden Coins for GB,GB,Nintendo,Nintendo R&D1,11.18,1992 321 | Super Mario Land 3: Wario Land for GB,GB,Nintendo,Nintendo R&D1,5.19,1994 322 | Super Mario Land for GB,GB,Nintendo,Nintendo R&D1,18.14,1989 323 | Super Mario Maker 2 for NS,NS,Nintendo,Nintendo,5.48,2019 324 | Super Mario Maker for WiiU,WiiU,Nintendo,Nintendo EAD,4.01,2015 325 | Super Mario Odyssey for NS,NS,Nintendo,Nintendo EPD,17.41,2017 326 | Super Mario Party for NS,NS,Nintendo,"Nd Cube Co., Ltd.",10.1,2018 327 | Super Mario Sunshine for GC,GC,Nintendo,Nintendo EAD,5.91,2002 328 | Super Mario World 2: Yoshi's Island for SNES,SNES,Nintendo,Nintendo EAD,4.12,1995 329 | Super Mario World for SNES,SNES,Nintendo,Nintendo EAD,20.61,1991 330 | Super Mario World: Super Mario Advance 2 for GBA,GBA,Nintendo,Nintendo EAD,5.69,2002 331 | Super Paper Mario for Wii,Wii,Nintendo,Intelligent Systems,4.23,2007 332 | Super Smash Bros. Brawl for Wii,Wii,Nintendo,Project Sora,13.32,2008 333 | Super Smash Bros. Melee for GC,GC,Nintendo,HAL Laboratory,7.41,2001 334 | Super Smash Bros. Ultimate for NS,NS,Nintendo,Bandai Namco Games,18.84,2018 335 | Super Smash Bros. for 3DS for 3DS,3DS,Nintendo,Bandai Namco Games,9.59,2014 336 | Super Smash Bros. for N64,N64,Nintendo,HAL Laboratory,5.55,1999 337 | Super Smash Bros. for Wii U for WiiU,WiiU,Nintendo,Bandai Namco Games,5.37,2014 338 | Teenage Mutant Ninja Turtles for NES,NES,Ultra Games,Konami,4.17,1989 339 | Tekken 2 for PS,PS,Namco,Namco,5.74,1996 340 | Tekken 3 for PS,PS,Namco,Namco,8.3,1998 341 | Tekken Tag Tournament for PS2,PS2,Namco,Namco,4.05,2000 342 | Terraria for PC,PC,Unknown,Re-Logic,14.0,2011 343 | Tetris for GB,GB,Nintendo,Bullet Proof Software,30.26,1989 344 | Tetris for NES,NES,Nintendo,Nintendo,5.58,1989 345 | The Binding of Isaac for PC,PC,Edmund McMillen,Edmund McMillen,7.17,2011 346 | The Elder Scrolls IV: Oblivion for X360,X360,Take-Two Interactive,Bethesda Softworks,4.47,2009 347 | The Elder Scrolls V: Skyrim for PC,PC,Bethesda Softworks,Bethesda Game Studios,3.99,2011 348 | The Elder Scrolls V: Skyrim for PS3,PS3,Bethesda Softworks,Bethesda Game Studios,6.49,2011 349 | The Elder Scrolls V: Skyrim for X360,X360,Bethesda Softworks,Bethesda Game Studios,8.88,2011 350 | The Forest for PC,PC,Endnight Games Ltd,Unknown,5.3,2014 351 | The Last of Us Remastered for PS4,PS4,Sony Computer Entertainment,Naughty Dog,11.78,2014 352 | The Last of Us for PS3,PS3,Sony Computer Entertainment America,Naughty Dog,8.15,2013 353 | The Last of Us: Part II for PS4,PS4,Sony Interactive Entertainment,Naughty Dog,4.0,2020 354 | The Legend of Zelda for NES,NES,Nintendo,Nintendo EAD,6.51,1987 355 | The Legend of Zelda: A Link Between Worlds for 3DS,3DS,Nintendo,Nintendo EAD,4.07,2013 356 | The Legend of Zelda: A Link to the Past for SNES,SNES,Nintendo,Nintendo EAD,4.61,1992 357 | The Legend of Zelda: Breath of the Wild for NS,NS,Nintendo,Nintendo EPD,17.41,2017 358 | The Legend of Zelda: Link's Awakening for NS,NS,Nintendo,Nintendo,4.38,2019 359 | The Legend of Zelda: Ocarina of Time 3D for 3DS,3DS,Nintendo,GREZZO,6.02,2011 360 | The Legend of Zelda: Ocarina of Time for N64,N64,Nintendo,Nintendo EAD,7.6,1998 361 | The Legend of Zelda: Oracle of Ages / Seasons for GBC,GBC,Nintendo,Capcom,3.99,2001 362 | The Legend of Zelda: Phantom Hourglass for DS,DS,Nintendo,Nintendo EAD,4.76,2007 363 | The Legend of Zelda: The Wind Waker for GC,GC,Nintendo,Nintendo EAD,4.43,2003 364 | The Legend of Zelda: Twilight Princess for Wii,Wii,Nintendo,Nintendo EAD,7.26,2006 365 | The Lord of the Rings: The Two Towers for PS2,PS2,Electronic Arts,Stormfront Studios,4.67,2002 366 | The Simpsons: Hit & Run for PS2,PS2,VU Games,Radical Entertainment,4.7,2003 367 | The Sims 3 for PC,PC,Electronic Arts,EA Redwood Shores,7.96,2009 368 | The Sims 4 for PC,PC,Electronic Arts,Maxis,4.1,2014 369 | The Witcher 3: Wild Hunt for PC,PC,Warner Bros. Interactive Entertainment,CD Projekt Red Studio,12.4,2015 370 | The Witcher 3: Wild Hunt for PS4,PS4,Warner Bros. Interactive Entertainment,CD Projekt Red Studio,10.8,2015 371 | The Witcher 3: Wild Hunt for XOne,XOne,Warner Bros. Interactive Entertainment,CD Projekt Red Studio,4.3,2015 372 | Tom Clancy's Rainbow Six: Siege for PS4,PS4,Ubisoft,Ubisoft Montreal,4.36,2015 373 | Tom Clancy's The Division for PS4,PS4,Ubisoft,Massive Entertainment,4.37,2016 374 | Tomb Raider (2013) for PC,PC,Square Enix,Crystal Dynamics,5.5,2013 375 | Tomb Raider II for PS,PS,Eidos Interactive,Core Design Ltd.,5.24,1997 376 | Tomb Raider for PS,PS,Eidos Interactive,Core Design Ltd.,4.63,1996 377 | Tomodachi Life for 3DS,3DS,Nintendo,Nintendo,6.59,2014 378 | Tony Hawk's Pro Skater 2 for PS,PS,Activision,Neversoft Entertainment,4.68,2000 379 | Tony Hawk's Pro Skater 3 for PS2,PS2,Activision,Neversoft Entertainment,4.41,2001 380 | Tony Hawk's Pro Skater for PS,PS,Activision,Neversoft Entertainment,5.02,1999 381 | Uncharted 2: Among Thieves for PS3,PS3,Sony Computer Entertainment,Naughty Dog,6.74,2009 382 | Uncharted 3: Drake's Deception for PS3,PS3,Sony Computer Entertainment,Naughty Dog,9.3,2011 383 | Uncharted 4: A Thief's End for PS4,PS4,Sony Interactive Entertainment,Naughty Dog,16.25,2016 384 | Uncharted: Drake's Fortune for PS3,PS3,Sony Computer Entertainment,Naughty Dog,4.97,2007 385 | Uncharted: The Nathan Drake Collection for PS4,PS4,Sony Computer Entertainment,Bluepoint Games,5.7,2015 386 | Warcraft III: Reign of Chaos for PC,PC,Blizzard Entertainment,Blizzard Entertainment,4.5,2002 387 | Warzone 2100 for PS,PS,Eidos Interactive,Pumpkin Studios,5.01,1999 388 | Watch Dogs for PS4,PS4,Ubisoft,Ubisoft Montreal,4.32,2014 389 | Wii Fit Plus for Wii,Wii,Nintendo,Nintendo EAD,21.13,2009 390 | Wii Fit for Wii,Wii,Nintendo,Nintendo EAD,22.67,2008 391 | Wii Party for Wii,Wii,Nintendo,"Nd Cube Co., Ltd.",9.34,2010 392 | Wii Play for Wii,Wii,Nintendo,Nintendo EAD,28.02,2007 393 | Wii Sports Resort for Wii,Wii,Nintendo,Nintendo EAD,33.13,2009 394 | Wii Sports for Wii,Wii,Nintendo,Nintendo EAD,82.9,2006 395 | Winning Eleven: Pro Evolution Soccer 2007 for PS2,PS2,Konami,Konami Computer Entertainment Tokyo,4.39,2007 396 | World Soccer Winning Eleven 9 for PS2,PS2,Konami,Konami Computer Entertainment Tokyo,4.06,2006 397 | World of Warcraft for PC,PC,Blizzard Entertainment,Blizzard Entertainment,12.0,2004 398 | World of Warcraft: Cataclysm for PC,PC,Blizzard Entertainment,Blizzard Entertainment,4.7,2010 399 | World of Warcraft: Wrath of the Lich King for PC,PC,Blizzard Entertainment,Blizzard Entertainment,4.0,2008 400 | Yokai Watch 2: Bony Spirits / Fleshy Souls / Psychic Specters for 3DS,3DS,Nintendo,Level 5,7.29,2016 401 | Zelda II: The Adventure of Link for NES,NES,Nintendo,Nintendo EAD,4.38,1988 402 | --------------------------------------------------------------------------------