Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Last active April 4, 2024 06:53
Show Gist options
  • Star 45 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save pamelafox/585364b62390ea720858 to your computer and use it in GitHub Desktop.
Save pamelafox/585364b62390ea720858 to your computer and use it in GitHub Desktop.
marvel_characters.sql
/* Marvel Heroes and Villains
Based on the website http://marvel.wikia.com/Main_Page
with popularity data from http://observationdeck.io9.com/something-i-found-marvel-character-popularity-poll-cb-1568108064
and power grid data from http://marvel.wikia.com/Power_Grid#Power
Collected by: https://www.khanacademy.org/profile/Mentrasto/
*/
CREATE TABLE marvels (ID INTEGER PRIMARY KEY,
name TEXT,
popularity INTEGER,
alignment TEXT,
gender TEXT,
height_m NUMERIC,
weight_kg NUMERIC,
hometown TEXT,
intelligence INTEGER,
strength INTEGER,
speed INTEGER,
durability INTEGER,
energy_Projection INTEGER,
fighting_Skills INTEGER);
INSERT INTO marvels VALUES(1, "Spider Man", 1, "Good", "Male", 1.78, 75.75, "USA", 4, 4, 3, 3, 1, 4);
INSERT INTO marvels VALUES(2, "Iron Man", 20, "Neutral", "Male", 1.98, 102.58, "USA", 6, 6, 5, 6, 6, 4);
INSERT INTO marvels VALUES(3, "Hulk", 18, "Neutral", "Male", 2.44, 635.29, "USA", 1, 7, 3, 7, 5, 4);
INSERT INTO marvels VALUES(4, "Wolverine", 3, "Good", "Male", 1.6, 88.46, "Canada", 2, 4, 2, 4, 1, 7);
INSERT INTO marvels VALUES(5, "Thor", 5, "Good", "Male", 1.98, 290.3, "Asgard", 2, 7, 7, 6, 6, 4);
INSERT INTO marvels VALUES(6, "Green Goblin", 91, "Bad", "Male", 1.93, 174.63, "USA", 4, 4, 3, 4, 3, 3);
INSERT INTO marvels VALUES(7, "Magneto", 11, "Neutral", "Male", 1.88, 86.18, "Germany", 6, 3, 5, 4, 6, 4);
INSERT INTO marvels VALUES(8, "Thanos", 47, "Bad", "Male", 2.01, 446.79, "Titan", 6, 7, 7, 6, 6, 4);
INSERT INTO marvels VALUES(9, "Loki", 32, "Bad", "Male", 1.93, 238.14, "Jotunheim", 5, 5, 7, 6, 6, 3);
INSERT INTO marvels VALUES(10, "Doctor Doom", 19, "Bad", "Male", 2.01, 188.24, "Latveria", 6, 4, 5, 6, 6, 4);
INSERT INTO marvels VALUES(11, "Jean Grey", 8, "Good", "Female", 1.68, 52.16, "USA", 3, 2, 7, 7, 7, 4);
INSERT INTO marvels VALUES(12, "Rogue", 4, "Good", "Female", 1.73, 54.43, "USA", 7, 7, 7, 7, 7, 7);
INSERT INTO marvels VALUES(13, "Storm", 2, "Good", "Female", 1.80, 66, "Kenya", 2, 2, 3, 2, 5, 4);
INSERT INTO marvels VALUES(14, "Nightcrawler", 6, "Good", "Male", 1.75, 73, "Germany", 3, 2, 7, 2, 1, 3);
INSERT INTO marvels VALUES(15, "Gambit", 7, "Good", "Male", 1.88, 81, "EUA", 2, 2, 2, 2, 2, 4);
INSERT INTO marvels VALUES(16, "Captain America", 9, "Good", "Male", 1.88, 108, "EUA", 3, 3, 2, 3, 1, 6);
INSERT INTO marvels VALUES(17, "Cyclops", 10, "Good", "Male", 1.90, 88, "EUA", 3, 2, 2, 2, 5, 4);
INSERT INTO marvels VALUES(18, "Emma Frost", 12, "Neutral", "Female", 1.78, 65, "EUA", 4, 4, 2, 5, 5, 3);
INSERT INTO marvels VALUES(19, "Kitty Pryde", 13, "Good", "Female", 1.68, 50, "EUA", 4, 2, 2, 3, 1, 5);
INSERT INTO marvels VALUES(20, "Daredevil", 14, "Good", "Male", 1.83, 91, "EUA", 3, 3, 2, 2, 4, 5);
INSERT INTO marvels VALUES(21, "Punisher", 50, "Neutral", "Male", 1.85, 91, "EUA", 3, 3, 2, 2, 1, 6);
INSERT INTO marvels VALUES(22, "Silver Surfer", 33, "Good", "Male", 1.93, 102, "Zenn-La", 3, 7, 7, 6, 7, 2);
INSERT INTO marvels VALUES(23, "Ghost Rider", 86, "Good", "Male", 1.88, 99, "EUA", 2, 4, 3, 5, 4, 2);
INSERT INTO marvels VALUES(24, "Venon", 78, "Neutral", "Male", 1.90, 118, "EUA", 3, 4, 2, 6, 1, 4);
INSERT INTO marvels VALUES(25, "Juggernaut", 76, "Neutral", "Male", 2.87, 862, "EUA", 2, 7, 2, 7, 1, 4);
INSERT INTO marvels VALUES(26, "Professor X", 58, "Good", "Male", 1.83, 86, "EUA", 5, 2, 2, 2, 5, 3);
@AlexMooney
Copy link

The SQL Data dig project here on Khan Academy requires someone to query a table with at least 20 rows, but this has only 12.

@Mentrasto
Copy link

@groovytree
Copy link

groovytree commented Oct 13, 2017

The information of height is wrong. Jean Greay's height is 5'8" feet = 1.73m and Wolverine's height is 5 ft. 3 (Although in the in the X Men and Wolverine X Men Origins movies his height is 6' 2½" (1.89 m) http://www.imdb.com/character/ch0001095/bio

@FLASHFAN3
Copy link

The information of height is wrong. Jean Greay's height is 5'8" feet = 1.73m and Wolverine's height is 5 ft. 3 (Although in the in the X Men and Wolverine X Men Origins movies his height is 6' 2½" (1.89 m) http://www.imdb.com/character/ch0001095/bio

This is Marvel Comics data, not data from the movie characters.

@StarkieM
Copy link

StarkieM commented Sep 10, 2019

Some of this is wrong, Thor is from Asgard (Dr. Donald Blake is American), and Magneto is Polish.
Jean's name is spelt Jean Grey, no "a".
Plus Hulk isn't intelligent, Bruce Bannor is.
Green Goblin is one of the smartarest people on the planet, as is Spider-Man; they both have intelects rivelling Tony.
Dr. Doom should be at least a seven (as should Reed Richards if he was on the list), and who the hell did Rogue just absorb?
Finally the "strenth" colomn is all out of wack, Thor shouldn't be on par with Thanos or Hulk, and Spider-Man and Doom should both be stronger.

@masterswordio
Copy link

You misspelled venom as venon

@masterswordio
Copy link

For the popularity is it that 1 is the best and 91 is the worst? It is right?

@satyasuchak
Copy link

Some of this is wrong, Thor is from Asgard (Dr. Donald Blake is American), and Magneto is Polish.
Jean's name is spelt Jean Grey, no "a".
Plus Hulk isn't intelligent, Bruce Bannor is.
Green Goblin is one of the smartarest people on the planet, as is Spider-Man; they both have intelects rivelling Tony.
Dr. Doom should be at least a seven (as should Reed Richards if he was on the list), and who the hell did Rogue just absorb?
Finally the "strenth" colomn is all out of wack, Thor shouldn't be on par with Thanos or Hulk, and Spider-Man and Doom should both be stronger.

does that really matter?
all we are here for is sql

@Radostina
Copy link

Hello,
I would like to point out that from line 35 onward the name of the table is changed to Marvel with capital letter and this creates mistakes when trying to execute

@pamelafox
Copy link
Author

Fixed! I believe some SQL implementations (like SQLite) may be case-insensitive in regards to table names, which is why it didn't cause an error for me originally.

@Radostina
Copy link

Thank you ☺️

@TariesW
Copy link

TariesW commented Apr 26, 2022

Thank you!

@TechAMonica
Copy link

Some of this is wrong, Thor is from Asgard (Dr. Donald Blake is American), and Magneto is Polish.
Jean's name is spelt Jean Grey, no "a".
Plus Hulk isn't intelligent, Bruce Bannor is.
Green Goblin is one of the smartarest people on the planet, as is Spider-Man; they both have intelects rivelling Tony.
Dr. Doom should be at least a seven (as should Reed Richards if he was on the list), and who the hell did Rogue just absorb?
Finally the "strenth" colomn is all out of wack, Thor shouldn't be on par with Thanos or Hulk, and Spider-Man and Doom should both be stronger.

does that really matter? all we are here for is sql

To me it does. Thanks to him, I made my own adjustments to the stats. Companies don't care about "sql only", they care about accuracy AND if you know SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment