-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarvel Dataset
More file actions
106 lines (92 loc) · 5.4 KB
/
Marvel Dataset
File metadata and controls
106 lines (92 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* 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);
--average, min, and max popularity values
--if making marvel game app, important to know who buff up less popular champions to increase overall average popularity to yield new customers and retain old ones by not over relying on highly popular marvel characters but having a low average (27 out of 100 in this case).
select min(popularity) as min, avg(popularity) as avg, max(popularity) as max
from marvels;
--which champions are in the lower half of popularity (that is, lower than the the average score of popularity of 27)?
--these are the champions you would focus on making more popular if you had a marvel app by either buffing up attack or giving certain special bundles that make the character more lucractive than just the personality from the comics and movies.
select name
from marvels
where popularity<27;
-- other max min avg values
select max(strength), min(strength), avg(strength)
from marvels;
select max(speed), min(speed), avg(speed)
from marvels;
select distinct alignment
from marvels;
--find out reasons as to why those champions are not as popular, especially alignment
select name, alignment,count(*)as total, avg(popularity)
from marvels
group by alignment;
--it seems as though characters with "good" alignment seem less popular while bad is overall highest in popularity
select name, alignment
from marvels
where popularity = (select max(popularity) from marvels);
--bad alignment has highest popularity
--look at other features in relation to popularity
select name, alignment, speed, popularity
from marvels
where speed = (select max(speed) from marvels);
select name, height_m, durability
from marvels;
--count number of characters within each durability level, but only those levels that contain more
--than six characters.
select count(*) as count, alignment,
case
when durability <3 then 'Low'
when durability <5 then 'Medium'
else 'High'
end as durability_indicator
from marvels
group by durability_indicator
having count(*)>6;
--find average popularity grouped by fighting skill index
select fighting_skills, count(*) as count, avg(popularity) as avg_popularity
from marvels
group by fighting_skills;