├── .gitignore
├── Dataset
├── athlete_events.csv
└── noc_regions.csv
├── ER_diagram
├── ER_Diagram.drawio
└── ER_Diagram.jpg
├── LICENSE
├── README.md
├── Reports
└── Report_week1.pdf
├── Scripts
├── AnalysisQuery.sql
├── clean_data.ipynb
├── insert_data.sql
├── normalization.sql
├── week_1_analysis.ipynb
└── weel_2_analysis.ipynb
├── Viz_Images
├── 1.jpg
├── 2.jpg
├── 3.jpg
├── 4.jpg
├── 5.jpg
└── 6.jpg
└── read_csv.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | .vscode
4 | ReportFormat.txt
--------------------------------------------------------------------------------
/Dataset/noc_regions.csv:
--------------------------------------------------------------------------------
1 | NOC,region,notes
AFG,Afghanistan,
AHO,Curacao,Netherlands Antilles
ALB,Albania,
ALG,Algeria,
AND,Andorra,
ANG,Angola,
ANT,Antigua,Antigua and Barbuda
ANZ,Australia,Australasia
ARG,Argentina,
ARM,Armenia,
ARU,Aruba,
ASA,American Samoa,
AUS,Australia,
AUT,Austria,
AZE,Azerbaijan,
BAH,Bahamas,
BAN,Bangladesh,
BAR,Barbados,
BDI,Burundi,
BEL,Belgium,
BEN,Benin,
BER,Bermuda,
BHU,Bhutan,
BIH,Bosnia and Herzegovina,
BIZ,Belize,
BLR,Belarus,
BOH,Czech Republic,Bohemia
BOL,Boliva,
BOT,Botswana,
BRA,Brazil,
BRN,Bahrain,
BRU,Brunei,
BUL,Bulgaria,
BUR,Burkina Faso,
CAF,Central African Republic,
CAM,Cambodia,
CAN,Canada,
CAY,Cayman Islands,
CGO,Republic of Congo,
CHA,Chad,
CHI,Chile,
CHN,China,
CIV,Ivory Coast,
CMR,Cameroon,
COD,Democratic Republic of the Congo,
COK,Cook Islands,
COL,Colombia,
COM,Comoros,
CPV,Cape Verde,
CRC,Costa Rica,
CRO,Croatia,
CRT,Greece,Crete
CUB,Cuba,
CYP,Cyprus,
CZE,Czech Republic,
DEN,Denmark,
DJI,Djibouti,
DMA,Dominica,
DOM,Dominican Republic,
ECU,Ecuador,
EGY,Egypt,
ERI,Eritrea,
ESA,El Salvador,
ESP,Spain,
EST,Estonia,
ETH,Ethiopia,
EUN,Russia,
FIJ,Fiji,
FIN,Finland,
FRA,France,
FRG,Germany,
FSM,Micronesia,
GAB,Gabon,
GAM,Gambia,
GBR,UK,
GBS,Guinea-Bissau,
GDR,Germany,
GEO,Georgia,
GEQ,Equatorial Guinea,
GER,Germany,
GHA,Ghana,
GRE,Greece,
GRN,Grenada,
GUA,Guatemala,
GUI,Guinea,
GUM,Guam,
GUY,Guyana,
HAI,Haiti,
HKG,China,Hong Kong
HON,Honduras,
HUN,Hungary,
INA,Indonesia,
IND,India,
IOA,Individual Olympic Athletes,Individual Olympic Athletes
IRI,Iran,
IRL,Ireland,
IRQ,Iraq,
ISL,Iceland,
ISR,Israel,
ISV,"Virgin Islands, US",Virgin Islands
ITA,Italy,
IVB,"Virgin Islands, British",
JAM,Jamaica,
JOR,Jordan,
JPN,Japan,
KAZ,Kazakhstan,
KEN,Kenya,
KGZ,Kyrgyzstan,
KIR,Kiribati,
KOR,South Korea,
KOS,Kosovo,
KSA,Saudi Arabia,
KUW,Kuwait,
LAO,Laos,
LAT,Latvia,
LBA,Libya,
LBR,Liberia,
LCA,Saint Lucia,
LES,Lesotho,
LIB,Lebanon,
LIE,Liechtenstein,
LTU,Lithuania,
LUX,Luxembourg,
MAD,Madagascar,
MAL,Malaysia,
MAR,Morocco,
MAS,Malaysia,
MAW,Malawi,
MDA,Moldova,
MDV,Maldives,
MEX,Mexico,
MGL,Mongolia,
MHL,Marshall Islands,
MKD,Macedonia,
MLI,Mali,
MLT,Malta,
MNE,Montenegro,
MON,Monaco,
MOZ,Mozambique,
MRI,Mauritius,
MTN,Mauritania,
MYA,Myanmar,
NAM,Namibia,
NBO,Malaysia,North Borneo
NCA,Nicaragua,
NED,Netherlands,
NEP,Nepal,
NFL,Canada,Newfoundland
NGR,Nigeria,
NIG,Niger,
NOR,Norway,
NRU,Nauru,
NZL,New Zealand,
OMA,Oman,
PAK,Pakistan,
PAN,Panama,
PAR,Paraguay,
PER,Peru,
PHI,Philippines,
PLE,Palestine,
PLW,Palau,
PNG,Papua New Guinea,
POL,Poland,
POR,Portugal,
PRK,North Korea,
PUR,Puerto Rico,
QAT,Qatar,
RHO,Zimbabwe,
ROT,NA,Refugee Olympic Team
ROU,Romania,
RSA,South Africa,
RUS,Russia,
RWA,Rwanda,
SAA,Germany,
SAM,Samoa,
SCG,Serbia,Serbia and Montenegro
SEN,Senegal,
SEY,Seychelles,
SIN,Singapore,
SKN,Saint Kitts,Turks and Caicos Islands
SLE,Sierra Leone,
SLO,Slovenia,
SMR,San Marino,
SOL,Solomon Islands,
SOM,Somalia,
SRB,Serbia,
SRI,Sri Lanka,
SSD,South Sudan,
STP,Sao Tome and Principe,
SUD,Sudan,
SUI,Switzerland,
SUR,Suriname,
SVK,Slovakia,
SWE,Sweden,
SWZ,Swaziland,
SYR,Syria,
TAN,Tanzania,
TCH,Czech Republic,
TGA,Tonga,
THA,Thailand,
TJK,Tajikistan,
TKM,Turkmenistan,
TLS,Timor-Leste,
TOG,Togo,
TPE,Taiwan,
TTO,Trinidad,Trinidad and Tobago
TUN,Tunisia,
TUR,Turkey,
TUV,NA,Tuvalu
UAE,United Arab Emirates,
UAR,Syria,United Arab Republic
UGA,Uganda,
UKR,Ukraine,
UNK,NA,Unknown
URS,Russia,
URU,Uruguay,
USA,USA,
UZB,Uzbekistan,
VAN,Vanuatu,
VEN,Venezuela,
VIE,Vietnam,
VIN,Saint Vincent,
VNM,Vietnam,
WIF,Trinidad,West Indies Federation
YAR,Yemen,North Yemen
YEM,Yemen,
YMD,Yemen,South Yemen
YUG,Serbia,Yugoslavia
ZAM,Zambia,
ZIM,Zimbabwe,
--------------------------------------------------------------------------------
/ER_diagram/ER_Diagram.drawio:
--------------------------------------------------------------------------------
1 | 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
--------------------------------------------------------------------------------
/ER_diagram/ER_Diagram.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/ER_diagram/ER_Diagram.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Saurabh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SQL-DataScience-Capstone
2 | Capstone Project for Databases and SQL for Data Science Specialization from Coursera
3 |
--------------------------------------------------------------------------------
/Reports/Report_week1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Reports/Report_week1.pdf
--------------------------------------------------------------------------------
/Scripts/AnalysisQuery.sql:
--------------------------------------------------------------------------------
1 | -- Using the uc_davis Database
2 | USE uc_davis;
3 |
4 | -- Displaying the total tables
5 | SHOW TABLES;
6 |
7 | SELECT DISTINCT * FROM country;
8 |
9 | SELECT * FROM athlete_events LIMIT 20;
10 |
11 | SELECT MIN(`Year`) FROM athlete_events;
12 |
13 | SELECT MAX(`Year`) FROM athlete_events;
14 |
15 |
16 | SELECT `Name`, COUNT(`Name`) AS `Participated_Events_Count`
17 | FROM athlete_events
18 | GROUP BY `Name`
19 | ORDER BY COUNT(`Name`) DESC;
20 |
21 |
22 |
23 | SELECT `Season`, COUNT(`Season`) AS `Total Seasons`
24 | FROM athlete_events
25 | GROUP BY `Season`
26 | ORDER BY COUNT(`Season`) DESC;
27 |
28 |
29 | SELECT `Sport`, COUNT(`Sport`) AS `Sports`
30 | FROM athlete_events
31 | GROUP BY `Sport`
32 | ORDER BY COUNT(`Sport`) DESC;
33 |
34 |
35 | SELECT DISTINCT(`Name`), `Team`
36 | FROM athlete_events
37 | GROUP BY `Name`
38 | ORDER BY COUNT(`Team`) DESC LIMIT 30;
39 |
40 |
41 | SELECT `Sex`, COUNT(DISTINCT(`Sex`)) AS `Gender` FROM athlete_events
42 | GROUP BY `Sex`;
43 |
44 |
45 | SELECT DISTINCT(`Name`), `Sex`, country.NOC, `Games`, `Year`
46 | FROM country
47 | INNER JOIN athlete_events
48 | ON
49 | country.NOC = athlete_events.NOC
50 | WHERE athlete_events.NOC = 'USA'
51 | AND `Sport` = 'Football';
52 |
53 |
--------------------------------------------------------------------------------
/Scripts/clean_data.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "metadata": {
3 | "language_info": {
4 | "codemirror_mode": {
5 | "name": "ipython",
6 | "version": 3
7 | },
8 | "file_extension": ".py",
9 | "mimetype": "text/x-python",
10 | "name": "python",
11 | "nbconvert_exporter": "python",
12 | "pygments_lexer": "ipython3",
13 | "version": "3.8.6-final"
14 | },
15 | "orig_nbformat": 2,
16 | "kernelspec": {
17 | "name": "python3",
18 | "display_name": "Python 3",
19 | "language": "python"
20 | }
21 | },
22 | "nbformat": 4,
23 | "nbformat_minor": 2,
24 | "cells": [
25 | {
26 | "cell_type": "code",
27 | "execution_count": 1,
28 | "metadata": {},
29 | "outputs": [],
30 | "source": [
31 | "import pandas as pd\n",
32 | "import sqlalchemy as sq\n",
33 | "\n",
34 | "import plotly_express as px"
35 | ]
36 | },
37 | {
38 | "cell_type": "code",
39 | "execution_count": 2,
40 | "metadata": {},
41 | "outputs": [],
42 | "source": [
43 | "engine = sq.create_engine('mysql+pymysql://saurabh:saurabh_sql@localhost:3306/uc_davis')"
44 | ]
45 | },
46 | {
47 | "cell_type": "code",
48 | "execution_count": 3,
49 | "metadata": {},
50 | "outputs": [],
51 | "source": [
52 | "athlete = pd.read_sql('SELECT * FROM athlete_events', con = engine)"
53 | ]
54 | },
55 | {
56 | "cell_type": "code",
57 | "execution_count": 4,
58 | "metadata": {},
59 | "outputs": [
60 | {
61 | "output_type": "execute_result",
62 | "data": {
63 | "text/plain": [
64 | " ID Name Sex Age Height Weight \\\n",
65 | "0 1 A Dijiang M 24.0 180.0 80.0 \n",
66 | "1 2 A Lamusi M 23.0 170.0 60.0 \n",
67 | "2 3 Gunnar Nielsen Aaby M 24.0 NaN NaN \n",
68 | "3 4 Edgar Lindenau Aabye M 34.0 NaN NaN \n",
69 | "4 5 Christine Jacoba Aaftink F 21.0 185.0 82.0 \n",
70 | "5 5 Christine Jacoba Aaftink F 21.0 185.0 82.0 \n",
71 | "6 5 Christine Jacoba Aaftink F 25.0 185.0 82.0 \n",
72 | "7 5 Christine Jacoba Aaftink F 25.0 185.0 82.0 \n",
73 | "8 5 Christine Jacoba Aaftink F 27.0 185.0 82.0 \n",
74 | "9 5 Christine Jacoba Aaftink F 27.0 185.0 82.0 \n",
75 | "10 6 Per Knut Aaland M 31.0 188.0 75.0 \n",
76 | "11 6 Per Knut Aaland M 31.0 188.0 75.0 \n",
77 | "12 6 Per Knut Aaland M 31.0 188.0 75.0 \n",
78 | "13 6 Per Knut Aaland M 31.0 188.0 75.0 \n",
79 | "14 6 Per Knut Aaland M 33.0 188.0 75.0 \n",
80 | "15 6 Per Knut Aaland M 33.0 188.0 75.0 \n",
81 | "16 6 Per Knut Aaland M 33.0 188.0 75.0 \n",
82 | "17 6 Per Knut Aaland M 33.0 188.0 75.0 \n",
83 | "18 7 John Aalberg M 31.0 183.0 72.0 \n",
84 | "19 7 John Aalberg M 31.0 183.0 72.0 \n",
85 | "20 7 John Aalberg M 31.0 183.0 72.0 \n",
86 | "21 7 John Aalberg M 31.0 183.0 72.0 \n",
87 | "22 7 John Aalberg M 33.0 183.0 72.0 \n",
88 | "23 7 John Aalberg M 33.0 183.0 72.0 \n",
89 | "24 7 John Aalberg M 33.0 183.0 72.0 \n",
90 | "25 7 John Aalberg M 33.0 183.0 72.0 \n",
91 | "26 8 Cornelia \"Cor\" Aalten (-Strannood) F 18.0 168.0 NaN \n",
92 | "27 8 Cornelia \"Cor\" Aalten (-Strannood) F 18.0 168.0 NaN \n",
93 | "28 9 Antti Sami Aalto M 26.0 186.0 96.0 \n",
94 | "29 10 Einar Ferdinand \"Einari\" Aalto M 26.0 NaN NaN \n",
95 | "30 11 Jorma Ilmari Aalto M 22.0 182.0 76.5 \n",
96 | "31 12 Jyri Tapani Aalto M 31.0 172.0 70.0 \n",
97 | "32 13 Minna Maarit Aalto F 30.0 159.0 55.5 \n",
98 | "33 13 Minna Maarit Aalto F 34.0 159.0 55.5 \n",
99 | "34 14 Pirjo Hannele Aalto (Mattila-) F 32.0 171.0 65.0 \n",
100 | "35 15 Arvo Ossian Aaltonen M 22.0 NaN NaN \n",
101 | "36 15 Arvo Ossian Aaltonen M 22.0 NaN NaN \n",
102 | "37 15 Arvo Ossian Aaltonen M 30.0 NaN NaN \n",
103 | "38 15 Arvo Ossian Aaltonen M 30.0 NaN NaN \n",
104 | "39 15 Arvo Ossian Aaltonen M 34.0 NaN NaN \n",
105 | "40 16 Juhamatti Tapio Aaltonen M 28.0 184.0 85.0 \n",
106 | "41 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
107 | "42 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
108 | "43 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
109 | "44 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
110 | "45 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
111 | "46 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
112 | "47 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
113 | "48 17 Paavo Johannes Aaltonen M 28.0 175.0 64.0 \n",
114 | "49 17 Paavo Johannes Aaltonen M 32.0 175.0 64.0 \n",
115 | "\n",
116 | " Team NOC Games Year Season City \\\n",
117 | "0 China CHN 1992 Summer 1992 Summer Barcelona \n",
118 | "1 China CHN 2012 Summer 2012 Summer London \n",
119 | "2 Denmark DEN 1920 Summer 1920 Summer Antwerpen \n",
120 | "3 Denmark/Sweden DEN 1900 Summer 1900 Summer Paris \n",
121 | "4 Netherlands NED 1988 Winter 1988 Winter Calgary \n",
122 | "5 Netherlands NED 1988 Winter 1988 Winter Calgary \n",
123 | "6 Netherlands NED 1992 Winter 1992 Winter Albertville \n",
124 | "7 Netherlands NED 1992 Winter 1992 Winter Albertville \n",
125 | "8 Netherlands NED 1994 Winter 1994 Winter Lillehammer \n",
126 | "9 Netherlands NED 1994 Winter 1994 Winter Lillehammer \n",
127 | "10 United States USA 1992 Winter 1992 Winter Albertville \n",
128 | "11 United States USA 1992 Winter 1992 Winter Albertville \n",
129 | "12 United States USA 1992 Winter 1992 Winter Albertville \n",
130 | "13 United States USA 1992 Winter 1992 Winter Albertville \n",
131 | "14 United States USA 1994 Winter 1994 Winter Lillehammer \n",
132 | "15 United States USA 1994 Winter 1994 Winter Lillehammer \n",
133 | "16 United States USA 1994 Winter 1994 Winter Lillehammer \n",
134 | "17 United States USA 1994 Winter 1994 Winter Lillehammer \n",
135 | "18 United States USA 1992 Winter 1992 Winter Albertville \n",
136 | "19 United States USA 1992 Winter 1992 Winter Albertville \n",
137 | "20 United States USA 1992 Winter 1992 Winter Albertville \n",
138 | "21 United States USA 1992 Winter 1992 Winter Albertville \n",
139 | "22 United States USA 1994 Winter 1994 Winter Lillehammer \n",
140 | "23 United States USA 1994 Winter 1994 Winter Lillehammer \n",
141 | "24 United States USA 1994 Winter 1994 Winter Lillehammer \n",
142 | "25 United States USA 1994 Winter 1994 Winter Lillehammer \n",
143 | "26 Netherlands NED 1932 Summer 1932 Summer Los Angeles \n",
144 | "27 Netherlands NED 1932 Summer 1932 Summer Los Angeles \n",
145 | "28 Finland FIN 2002 Winter 2002 Winter Salt Lake City \n",
146 | "29 Finland FIN 1952 Summer 1952 Summer Helsinki \n",
147 | "30 Finland FIN 1980 Winter 1980 Winter Lake Placid \n",
148 | "31 Finland FIN 2000 Summer 2000 Summer Sydney \n",
149 | "32 Finland FIN 1996 Summer 1996 Summer Atlanta \n",
150 | "33 Finland FIN 2000 Summer 2000 Summer Sydney \n",
151 | "34 Finland FIN 1994 Winter 1994 Winter Lillehammer \n",
152 | "35 Finland FIN 1912 Summer 1912 Summer Stockholm \n",
153 | "36 Finland FIN 1912 Summer 1912 Summer Stockholm \n",
154 | "37 Finland FIN 1920 Summer 1920 Summer Antwerpen \n",
155 | "38 Finland FIN 1920 Summer 1920 Summer Antwerpen \n",
156 | "39 Finland FIN 1924 Summer 1924 Summer Paris \n",
157 | "40 Finland FIN 2014 Winter 2014 Winter Sochi \n",
158 | "41 Finland FIN 1948 Summer 1948 Summer London \n",
159 | "42 Finland FIN 1948 Summer 1948 Summer London \n",
160 | "43 Finland FIN 1948 Summer 1948 Summer London \n",
161 | "44 Finland FIN 1948 Summer 1948 Summer London \n",
162 | "45 Finland FIN 1948 Summer 1948 Summer London \n",
163 | "46 Finland FIN 1948 Summer 1948 Summer London \n",
164 | "47 Finland FIN 1948 Summer 1948 Summer London \n",
165 | "48 Finland FIN 1948 Summer 1948 Summer London \n",
166 | "49 Finland FIN 1952 Summer 1952 Summer Helsinki \n",
167 | "\n",
168 | " Sport Event \\\n",
169 | "0 Basketball Basketball Men's Basketball \n",
170 | "1 Judo Judo Men's Extra-Lightweight \n",
171 | "2 Football Football Men's Football \n",
172 | "3 Tug-Of-War Tug-Of-War Men's Tug-Of-War \n",
173 | "4 Speed Skating Speed Skating Women's 500 metres \n",
174 | "5 Speed Skating Speed Skating Women's 1,000 metres \n",
175 | "6 Speed Skating Speed Skating Women's 500 metres \n",
176 | "7 Speed Skating Speed Skating Women's 1,000 metres \n",
177 | "8 Speed Skating Speed Skating Women's 500 metres \n",
178 | "9 Speed Skating Speed Skating Women's 1,000 metres \n",
179 | "10 Cross Country Skiing Cross Country Skiing Men's 10 kilometres \n",
180 | "11 Cross Country Skiing Cross Country Skiing Men's 50 kilometres \n",
181 | "12 Cross Country Skiing Cross Country Skiing Men's 10/15 kilometres Pu... \n",
182 | "13 Cross Country Skiing Cross Country Skiing Men's 4 x 10 kilometres R... \n",
183 | "14 Cross Country Skiing Cross Country Skiing Men's 10 kilometres \n",
184 | "15 Cross Country Skiing Cross Country Skiing Men's 30 kilometres \n",
185 | "16 Cross Country Skiing Cross Country Skiing Men's 10/15 kilometres Pu... \n",
186 | "17 Cross Country Skiing Cross Country Skiing Men's 4 x 10 kilometres R... \n",
187 | "18 Cross Country Skiing Cross Country Skiing Men's 10 kilometres \n",
188 | "19 Cross Country Skiing Cross Country Skiing Men's 50 kilometres \n",
189 | "20 Cross Country Skiing Cross Country Skiing Men's 10/15 kilometres Pu... \n",
190 | "21 Cross Country Skiing Cross Country Skiing Men's 4 x 10 kilometres R... \n",
191 | "22 Cross Country Skiing Cross Country Skiing Men's 10 kilometres \n",
192 | "23 Cross Country Skiing Cross Country Skiing Men's 30 kilometres \n",
193 | "24 Cross Country Skiing Cross Country Skiing Men's 10/15 kilometres Pu... \n",
194 | "25 Cross Country Skiing Cross Country Skiing Men's 4 x 10 kilometres R... \n",
195 | "26 Athletics Athletics Women's 100 metres \n",
196 | "27 Athletics Athletics Women's 4 x 100 metres Relay \n",
197 | "28 Ice Hockey Ice Hockey Men's Ice Hockey \n",
198 | "29 Swimming Swimming Men's 400 metres Freestyle \n",
199 | "30 Cross Country Skiing Cross Country Skiing Men's 30 kilometres \n",
200 | "31 Badminton Badminton Men's Singles \n",
201 | "32 Sailing Sailing Women's Windsurfer \n",
202 | "33 Sailing Sailing Women's Windsurfer \n",
203 | "34 Biathlon Biathlon Women's 7.5 kilometres Sprint \n",
204 | "35 Swimming Swimming Men's 200 metres Breaststroke \n",
205 | "36 Swimming Swimming Men's 400 metres Breaststroke \n",
206 | "37 Swimming Swimming Men's 200 metres Breaststroke \n",
207 | "38 Swimming Swimming Men's 400 metres Breaststroke \n",
208 | "39 Swimming Swimming Men's 200 metres Breaststroke \n",
209 | "40 Ice Hockey Ice Hockey Men's Ice Hockey \n",
210 | "41 Gymnastics Gymnastics Men's Individual All-Around \n",
211 | "42 Gymnastics Gymnastics Men's Team All-Around \n",
212 | "43 Gymnastics Gymnastics Men's Floor Exercise \n",
213 | "44 Gymnastics Gymnastics Men's Horse Vault \n",
214 | "45 Gymnastics Gymnastics Men's Parallel Bars \n",
215 | "46 Gymnastics Gymnastics Men's Horizontal Bar \n",
216 | "47 Gymnastics Gymnastics Men's Rings \n",
217 | "48 Gymnastics Gymnastics Men's Pommelled Horse \n",
218 | "49 Gymnastics Gymnastics Men's Individual All-Around \n",
219 | "\n",
220 | " Medal \n",
221 | "0 None \n",
222 | "1 None \n",
223 | "2 None \n",
224 | "3 Gold \n",
225 | "4 None \n",
226 | "5 None \n",
227 | "6 None \n",
228 | "7 None \n",
229 | "8 None \n",
230 | "9 None \n",
231 | "10 None \n",
232 | "11 None \n",
233 | "12 None \n",
234 | "13 None \n",
235 | "14 None \n",
236 | "15 None \n",
237 | "16 None \n",
238 | "17 None \n",
239 | "18 None \n",
240 | "19 None \n",
241 | "20 None \n",
242 | "21 None \n",
243 | "22 None \n",
244 | "23 None \n",
245 | "24 None \n",
246 | "25 None \n",
247 | "26 None \n",
248 | "27 None \n",
249 | "28 None \n",
250 | "29 None \n",
251 | "30 None \n",
252 | "31 None \n",
253 | "32 None \n",
254 | "33 None \n",
255 | "34 None \n",
256 | "35 None \n",
257 | "36 None \n",
258 | "37 Bronze \n",
259 | "38 Bronze \n",
260 | "39 None \n",
261 | "40 Bronze \n",
262 | "41 Bronze \n",
263 | "42 Gold \n",
264 | "43 None \n",
265 | "44 Gold \n",
266 | "45 None \n",
267 | "46 None \n",
268 | "47 None \n",
269 | "48 Gold \n",
270 | "49 None "
271 | ],
272 | "text/html": "
\n\n
\n \n \n | \n ID | \n Name | \n Sex | \n Age | \n Height | \n Weight | \n Team | \n NOC | \n Games | \n Year | \n Season | \n City | \n Sport | \n Event | \n Medal | \n
\n \n \n \n 0 | \n 1 | \n A Dijiang | \n M | \n 24.0 | \n 180.0 | \n 80.0 | \n China | \n CHN | \n 1992 Summer | \n 1992 | \n Summer | \n Barcelona | \n Basketball | \n Basketball Men's Basketball | \n None | \n
\n \n 1 | \n 2 | \n A Lamusi | \n M | \n 23.0 | \n 170.0 | \n 60.0 | \n China | \n CHN | \n 2012 Summer | \n 2012 | \n Summer | \n London | \n Judo | \n Judo Men's Extra-Lightweight | \n None | \n
\n \n 2 | \n 3 | \n Gunnar Nielsen Aaby | \n M | \n 24.0 | \n NaN | \n NaN | \n Denmark | \n DEN | \n 1920 Summer | \n 1920 | \n Summer | \n Antwerpen | \n Football | \n Football Men's Football | \n None | \n
\n \n 3 | \n 4 | \n Edgar Lindenau Aabye | \n M | \n 34.0 | \n NaN | \n NaN | \n Denmark/Sweden | \n DEN | \n 1900 Summer | \n 1900 | \n Summer | \n Paris | \n Tug-Of-War | \n Tug-Of-War Men's Tug-Of-War | \n Gold | \n
\n \n 4 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 21.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1988 Winter | \n 1988 | \n Winter | \n Calgary | \n Speed Skating | \n Speed Skating Women's 500 metres | \n None | \n
\n \n 5 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 21.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1988 Winter | \n 1988 | \n Winter | \n Calgary | \n Speed Skating | \n Speed Skating Women's 1,000 metres | \n None | \n
\n \n 6 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 25.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Speed Skating | \n Speed Skating Women's 500 metres | \n None | \n
\n \n 7 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 25.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Speed Skating | \n Speed Skating Women's 1,000 metres | \n None | \n
\n \n 8 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 27.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Speed Skating | \n Speed Skating Women's 500 metres | \n None | \n
\n \n 9 | \n 5 | \n Christine Jacoba Aaftink | \n F | \n 27.0 | \n 185.0 | \n 82.0 | \n Netherlands | \n NED | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Speed Skating | \n Speed Skating Women's 1,000 metres | \n None | \n
\n \n 10 | \n 6 | \n Per Knut Aaland | \n M | \n 31.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 10 kilometres | \n None | \n
\n \n 11 | \n 6 | \n Per Knut Aaland | \n M | \n 31.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 50 kilometres | \n None | \n
\n \n 12 | \n 6 | \n Per Knut Aaland | \n M | \n 31.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 10/15 kilometres Pu... | \n None | \n
\n \n 13 | \n 6 | \n Per Knut Aaland | \n M | \n 31.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 4 x 10 kilometres R... | \n None | \n
\n \n 14 | \n 6 | \n Per Knut Aaland | \n M | \n 33.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 10 kilometres | \n None | \n
\n \n 15 | \n 6 | \n Per Knut Aaland | \n M | \n 33.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 30 kilometres | \n None | \n
\n \n 16 | \n 6 | \n Per Knut Aaland | \n M | \n 33.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 10/15 kilometres Pu... | \n None | \n
\n \n 17 | \n 6 | \n Per Knut Aaland | \n M | \n 33.0 | \n 188.0 | \n 75.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 4 x 10 kilometres R... | \n None | \n
\n \n 18 | \n 7 | \n John Aalberg | \n M | \n 31.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 10 kilometres | \n None | \n
\n \n 19 | \n 7 | \n John Aalberg | \n M | \n 31.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 50 kilometres | \n None | \n
\n \n 20 | \n 7 | \n John Aalberg | \n M | \n 31.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 10/15 kilometres Pu... | \n None | \n
\n \n 21 | \n 7 | \n John Aalberg | \n M | \n 31.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1992 Winter | \n 1992 | \n Winter | \n Albertville | \n Cross Country Skiing | \n Cross Country Skiing Men's 4 x 10 kilometres R... | \n None | \n
\n \n 22 | \n 7 | \n John Aalberg | \n M | \n 33.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 10 kilometres | \n None | \n
\n \n 23 | \n 7 | \n John Aalberg | \n M | \n 33.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 30 kilometres | \n None | \n
\n \n 24 | \n 7 | \n John Aalberg | \n M | \n 33.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 10/15 kilometres Pu... | \n None | \n
\n \n 25 | \n 7 | \n John Aalberg | \n M | \n 33.0 | \n 183.0 | \n 72.0 | \n United States | \n USA | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Cross Country Skiing | \n Cross Country Skiing Men's 4 x 10 kilometres R... | \n None | \n
\n \n 26 | \n 8 | \n Cornelia \"Cor\" Aalten (-Strannood) | \n F | \n 18.0 | \n 168.0 | \n NaN | \n Netherlands | \n NED | \n 1932 Summer | \n 1932 | \n Summer | \n Los Angeles | \n Athletics | \n Athletics Women's 100 metres | \n None | \n
\n \n 27 | \n 8 | \n Cornelia \"Cor\" Aalten (-Strannood) | \n F | \n 18.0 | \n 168.0 | \n NaN | \n Netherlands | \n NED | \n 1932 Summer | \n 1932 | \n Summer | \n Los Angeles | \n Athletics | \n Athletics Women's 4 x 100 metres Relay | \n None | \n
\n \n 28 | \n 9 | \n Antti Sami Aalto | \n M | \n 26.0 | \n 186.0 | \n 96.0 | \n Finland | \n FIN | \n 2002 Winter | \n 2002 | \n Winter | \n Salt Lake City | \n Ice Hockey | \n Ice Hockey Men's Ice Hockey | \n None | \n
\n \n 29 | \n 10 | \n Einar Ferdinand \"Einari\" Aalto | \n M | \n 26.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1952 Summer | \n 1952 | \n Summer | \n Helsinki | \n Swimming | \n Swimming Men's 400 metres Freestyle | \n None | \n
\n \n 30 | \n 11 | \n Jorma Ilmari Aalto | \n M | \n 22.0 | \n 182.0 | \n 76.5 | \n Finland | \n FIN | \n 1980 Winter | \n 1980 | \n Winter | \n Lake Placid | \n Cross Country Skiing | \n Cross Country Skiing Men's 30 kilometres | \n None | \n
\n \n 31 | \n 12 | \n Jyri Tapani Aalto | \n M | \n 31.0 | \n 172.0 | \n 70.0 | \n Finland | \n FIN | \n 2000 Summer | \n 2000 | \n Summer | \n Sydney | \n Badminton | \n Badminton Men's Singles | \n None | \n
\n \n 32 | \n 13 | \n Minna Maarit Aalto | \n F | \n 30.0 | \n 159.0 | \n 55.5 | \n Finland | \n FIN | \n 1996 Summer | \n 1996 | \n Summer | \n Atlanta | \n Sailing | \n Sailing Women's Windsurfer | \n None | \n
\n \n 33 | \n 13 | \n Minna Maarit Aalto | \n F | \n 34.0 | \n 159.0 | \n 55.5 | \n Finland | \n FIN | \n 2000 Summer | \n 2000 | \n Summer | \n Sydney | \n Sailing | \n Sailing Women's Windsurfer | \n None | \n
\n \n 34 | \n 14 | \n Pirjo Hannele Aalto (Mattila-) | \n F | \n 32.0 | \n 171.0 | \n 65.0 | \n Finland | \n FIN | \n 1994 Winter | \n 1994 | \n Winter | \n Lillehammer | \n Biathlon | \n Biathlon Women's 7.5 kilometres Sprint | \n None | \n
\n \n 35 | \n 15 | \n Arvo Ossian Aaltonen | \n M | \n 22.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1912 Summer | \n 1912 | \n Summer | \n Stockholm | \n Swimming | \n Swimming Men's 200 metres Breaststroke | \n None | \n
\n \n 36 | \n 15 | \n Arvo Ossian Aaltonen | \n M | \n 22.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1912 Summer | \n 1912 | \n Summer | \n Stockholm | \n Swimming | \n Swimming Men's 400 metres Breaststroke | \n None | \n
\n \n 37 | \n 15 | \n Arvo Ossian Aaltonen | \n M | \n 30.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1920 Summer | \n 1920 | \n Summer | \n Antwerpen | \n Swimming | \n Swimming Men's 200 metres Breaststroke | \n Bronze | \n
\n \n 38 | \n 15 | \n Arvo Ossian Aaltonen | \n M | \n 30.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1920 Summer | \n 1920 | \n Summer | \n Antwerpen | \n Swimming | \n Swimming Men's 400 metres Breaststroke | \n Bronze | \n
\n \n 39 | \n 15 | \n Arvo Ossian Aaltonen | \n M | \n 34.0 | \n NaN | \n NaN | \n Finland | \n FIN | \n 1924 Summer | \n 1924 | \n Summer | \n Paris | \n Swimming | \n Swimming Men's 200 metres Breaststroke | \n None | \n
\n \n 40 | \n 16 | \n Juhamatti Tapio Aaltonen | \n M | \n 28.0 | \n 184.0 | \n 85.0 | \n Finland | \n FIN | \n 2014 Winter | \n 2014 | \n Winter | \n Sochi | \n Ice Hockey | \n Ice Hockey Men's Ice Hockey | \n Bronze | \n
\n \n 41 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Individual All-Around | \n Bronze | \n
\n \n 42 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Team All-Around | \n Gold | \n
\n \n 43 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Floor Exercise | \n None | \n
\n \n 44 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Horse Vault | \n Gold | \n
\n \n 45 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Parallel Bars | \n None | \n
\n \n 46 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Horizontal Bar | \n None | \n
\n \n 47 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Rings | \n None | \n
\n \n 48 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 28.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1948 Summer | \n 1948 | \n Summer | \n London | \n Gymnastics | \n Gymnastics Men's Pommelled Horse | \n Gold | \n
\n \n 49 | \n 17 | \n Paavo Johannes Aaltonen | \n M | \n 32.0 | \n 175.0 | \n 64.0 | \n Finland | \n FIN | \n 1952 Summer | \n 1952 | \n Summer | \n Helsinki | \n Gymnastics | \n Gymnastics Men's Individual All-Around | \n None | \n
\n \n
\n
"
273 | },
274 | "metadata": {},
275 | "execution_count": 4
276 | }
277 | ],
278 | "source": [
279 | "athlete.head(50)"
280 | ]
281 | },
282 | {
283 | "cell_type": "code",
284 | "execution_count": 5,
285 | "metadata": {},
286 | "outputs": [
287 | {
288 | "output_type": "execute_result",
289 | "data": {
290 | "text/plain": [
291 | "ID 0\n",
292 | "Name 0\n",
293 | "Sex 0\n",
294 | "Age 9474\n",
295 | "Height 60171\n",
296 | "Weight 62875\n",
297 | "Team 0\n",
298 | "NOC 0\n",
299 | "Games 0\n",
300 | "Year 0\n",
301 | "Season 0\n",
302 | "City 0\n",
303 | "Sport 0\n",
304 | "Event 0\n",
305 | "Medal 231333\n",
306 | "dtype: int64"
307 | ]
308 | },
309 | "metadata": {},
310 | "execution_count": 5
311 | }
312 | ],
313 | "source": [
314 | "reviews.isnull().sum()"
315 | ]
316 | },
317 | {
318 | "source": [
319 | "### If I perform fill_na() method, it will then Falsify my data for Analysis\n",
320 | "\n",
321 | "Many people dont have their Age, Height and Weight Values, We can see that Medal columns also have NaN values, Since not all participant wins all the matches.."
322 | ],
323 | "cell_type": "markdown",
324 | "metadata": {}
325 | },
326 | {
327 | "cell_type": "code",
328 | "execution_count": 7,
329 | "metadata": {},
330 | "outputs": [
331 | {
332 | "output_type": "execute_result",
333 | "data": {
334 | "text/plain": [
335 | " COUNT(*)\n",
336 | "0 271116"
337 | ],
338 | "text/html": "\n\n
\n \n \n | \n COUNT(*) | \n
\n \n \n \n 0 | \n 271116 | \n
\n \n
\n
"
339 | },
340 | "metadata": {},
341 | "execution_count": 7
342 | }
343 | ],
344 | "source": [
345 | "COUNTs = pd.read_sql('SELECT COUNT(*) AS `Total Data` FROM athlete_events', con = engine)\n",
346 | "COUNTs"
347 | ]
348 | }
349 | ]
350 | }
--------------------------------------------------------------------------------
/Scripts/insert_data.sql:
--------------------------------------------------------------------------------
1 | USE uc_davis;
2 |
3 | -- iNSERTING RECORDS IN THE CITIES TABLE
4 | INSERT INTO cities (city_name)
5 | SELECT DISTINCT City
6 | FROM athlete_events
7 | GROUP BY City;
8 |
9 |
10 | -- INSERTING RECORDS IN THE MEDALS TABLE
11 | INSERT INTO medals (medal_type)
12 | SELECT DISTINCT Medal
13 | FROM athlete_events
14 | GROUP BY Medal;
15 |
16 |
17 | -- INSERTING RECORDS IN THE SEASONS TABLE
18 | INSERT INTO seasons (season_name)
19 | SELECT DISTINCT Season
20 | FROM athlete_events;
21 |
22 |
23 | -- INSERTING RECORDS IN THE GAMES TABLE
24 | INSERT INTO games ( city_id, season_id, year )
25 | SELECT c.city_id, s.season_id, a.year
26 | FROM
27 | athlete_events a
28 | INNER JOIN cities c ON a.City = c.city_name
29 | INNER JOIN seasons s ON a.Season = s.season_name
30 | GROUP BY c.city_id, s.season_id, a.year;
31 |
32 |
33 | -- INSERTING RECORDS IN THE SPORTS TABLE
34 | INSERT INTO sports (season_id, sport_name)
35 | SELECT s.season_id, a.Sport
36 | FROM
37 | athlete_events a
38 | INNER JOIN seasons s ON a.Season = s.season_name
39 | GROUP BY s.season_id, a.Sport;
40 |
41 |
42 | -- INSERTING RECORDS IN THE EVENTS TABLE
43 | INSERT INTO events (sport_id, event_name)
44 | SELECT DISTINCT s.sport_id, a.Event
45 | FROM
46 | athlete_events a
47 | INNER JOIN sports s ON a.Sport = s.sport_name
48 | GROUP BY s.sport_id, a.Event;
49 |
50 |
51 | -- INSERTING RECORDS IN THE REGIONS TABLE
52 | INSERT INTO regions (city_id, region_name, country_name)
53 | SELECT DISTINCT c.city_id, a.NOC, co.region
54 | FROM cities c, athlete_events a
55 | INNER JOIN country co ON a.NOC = co.NOC
56 | GROUP BY c.city_id, a.NOC, co.region;
57 |
58 |
59 | -- INSERTING DATA INTO ATHLETES TABLE
60 | INSERT INTO athletes (region_id, game_id, athlete_name, athlete_gender)
61 | SELECT DISTINCT r.region_id, g.game_id, a.Name, a.SEX
62 | FROM athlete_events a
63 | JOIN
64 | games g ON a.Year = g.year
65 | JOIN
66 | regions r ON a.NOC = r.region_name
67 | GROUP by
68 | a.Name;
69 |
70 |
71 | -- INSERTING RECORDS INTO TEAMS TABLE
72 | INSERT INTO teams (region_id, team_name)
73 | SELECT DISTINCT r.region_id, a.Team
74 | FROM athlete_events a
75 | INNER JOIN regions r ON a.NOC = r.region_name
76 | GROUP BY r.region_id, a.Team;
77 |
78 |
79 | -- INSERTING DATA INTO Sports_Stats TABLE
80 | INSERT INTO sports_stats (athlete_id, game_id, event_id, medal_id, athlete_age, athlete_height, athlete_weight)
81 | SELECT DISTINCT at.athlete_id, g.game_id, e.event_id, m.medal_id, a.Age, a.Height, a.Weight
82 | FROM athlete_events a
83 | JOIN
84 | medals m ON a.Medal = m.medal_type
85 | JOIN
86 | events e ON a.Event = e.event_name
87 | JOIN
88 | games g ON a.Year = g.year
89 | JOIN
90 | athletes at ON a.Sex = at.athlete_gender
91 | GROUP BY a.Age;
--------------------------------------------------------------------------------
/Scripts/normalization.sql:
--------------------------------------------------------------------------------
1 | -- Creating the Database
2 | CREATE DATABASE IF NOT EXISTS uc_davis;
3 |
4 | -- DATABASE NAME
5 | USE uc_davis;
6 |
7 | DROP TABLE sports_stats, medals, seasons, cities, events, sports, games, athletes, regions, teams;
8 |
9 | -- MAIN TABLE
10 | CREATE TABLE IF NOT EXISTS sports_stats (
11 | sports_stats_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
12 | athlete_id INT,
13 | game_id INT,
14 | event_id INT,
15 | medal_id INT,
16 | athlete_age INT,
17 | athlete_height INT,
18 | athlete_weight INT,
19 |
20 | FOREIGN KEY (athlete_id) REFERENCES athletes(athlete_id),
21 | FOREIGN KEY (game_id) REFERENCES games(game_id),
22 | FOREIGN KEY (event_id) REFERENCES events(event_id),
23 | FOREIGN KEY (medal_id) REFERENCES medals(medal_id)
24 | );
25 |
26 |
27 | -- MEDAL TABLE
28 | CREATE TABLE IF NOT EXISTS medals (
29 | medal_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
30 | medal_type VARCHAR(100)
31 | );
32 |
33 |
34 | -- SEASONS TABLE
35 | CREATE TABLE IF NOT EXISTS seasons (
36 | season_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
37 | season_name VARCHAR(100)
38 | );
39 |
40 |
41 | -- CITIES TABLE
42 | CREATE TABLE IF NOT EXISTS cities (
43 | city_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
44 | city_name VARCHAR(100)
45 | );
46 |
47 |
48 | -- SPORTS TABLE
49 | CREATE TABLE IF NOT EXISTS sports (
50 | sport_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
51 | season_id INT,
52 | sport_name VARCHAR(100),
53 | FOREIGN KEY (season_id)
54 | REFERENCES seasons (season_id)
55 | );
56 |
57 |
58 | -- EVENTS TABLE
59 | CREATE TABLE IF NOT EXISTS events (
60 | event_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
61 | sport_id INT,
62 | event_name VARCHAR(100),
63 | FOREIGN KEY (sport_id)
64 | REFERENCES sports (sport_id)
65 | );
66 |
67 |
68 | -- GAME TABLE
69 | CREATE TABLE IF NOT EXISTS games (
70 | game_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
71 | city_id INT,
72 | season_id INT,
73 | year INT,
74 | FOREIGN KEY (season_id)
75 | REFERENCES seasons (season_id),
76 |
77 | FOREIGN KEY (city_id)
78 | REFERENCES cities (city_id)
79 | );
80 |
81 |
82 | -- REGIONS TABLE
83 | CREATE TABLE IF NOT EXISTS regions (
84 | region_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
85 | city_id INT,
86 | region_name VARCHAR(100),
87 | country_name VARCHAR(100),
88 | FOREIGN KEY (city_id)
89 | REFERENCES cities (city_id)
90 | );
91 |
92 |
93 | -- ATHLETE TABLE
94 | CREATE TABLE IF NOT EXISTS athletes (
95 | athlete_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
96 | region_id INT,
97 | game_id INT,
98 | athlete_name VARCHAR(100),
99 | athlete_gender VARCHAR(100),
100 | FOREIGN KEY (region_id)
101 | REFERENCES regions (region_id),
102 |
103 | FOREIGN KEY (game_id)
104 | REFERENCES games (game_id)
105 | );
106 |
107 | ALTER TABLE athletes MODIFY COLUMN athlete_name VARCHAR(600);
108 |
109 |
110 | -- TEAM TABLE
111 | CREATE TABLE IF NOT EXISTS teams (
112 | team_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
113 | region_id INT,
114 | team_name VARCHAR(100),
115 | FOREIGN KEY (region_id)
116 | REFERENCES regions (region_id)
117 | );
--------------------------------------------------------------------------------
/Scripts/weel_2_analysis.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "metadata": {
3 | "language_info": {
4 | "codemirror_mode": {
5 | "name": "ipython",
6 | "version": 3
7 | },
8 | "file_extension": ".py",
9 | "mimetype": "text/x-python",
10 | "name": "python",
11 | "nbconvert_exporter": "python",
12 | "pygments_lexer": "ipython3",
13 | "version": "3.8.6-final"
14 | },
15 | "orig_nbformat": 2,
16 | "kernelspec": {
17 | "name": "python3",
18 | "display_name": "Python 3.8.6 64-bit",
19 | "metadata": {
20 | "interpreter": {
21 | "hash": "83030e7af8a3b2fc518ff2dabcf75fa775bedd9c7d16153aeba13ec8e555d11f"
22 | }
23 | }
24 | }
25 | },
26 | "nbformat": 4,
27 | "nbformat_minor": 2,
28 | "cells": [
29 | {
30 | "cell_type": "code",
31 | "execution_count": 1,
32 | "metadata": {},
33 | "outputs": [],
34 | "source": [
35 | "import pandas as pd\n",
36 | "import plotly_express as px\n",
37 | "import matplotlib.pyplot as plt\n",
38 | "\n",
39 | "import sqlalchemy as sq"
40 | ]
41 | },
42 | {
43 | "cell_type": "code",
44 | "execution_count": 2,
45 | "metadata": {},
46 | "outputs": [],
47 | "source": [
48 | "engine = sq.create_engine('mysql+pymysql://saurabh:saurabh_sql@localhost:3306/uc_davis')"
49 | ]
50 | },
51 | {
52 | "cell_type": "code",
53 | "execution_count": 3,
54 | "metadata": {},
55 | "outputs": [],
56 | "source": [
57 | "tables = pd.read_sql('SHOW TABLES', con = engine)"
58 | ]
59 | },
60 | {
61 | "cell_type": "code",
62 | "execution_count": 4,
63 | "metadata": {},
64 | "outputs": [
65 | {
66 | "output_type": "execute_result",
67 | "data": {
68 | "text/plain": [
69 | " Tables_in_uc_davis\n",
70 | "0 athlete_events\n",
71 | "1 athletes\n",
72 | "2 cities\n",
73 | "3 country\n",
74 | "4 events\n",
75 | "5 games\n",
76 | "6 medals\n",
77 | "7 regions\n",
78 | "8 seasons\n",
79 | "9 sports\n",
80 | "10 sports_stats\n",
81 | "11 teams"
82 | ],
83 | "text/html": "\n\n
\n \n \n | \n Tables_in_uc_davis | \n
\n \n \n \n 0 | \n athlete_events | \n
\n \n 1 | \n athletes | \n
\n \n 2 | \n cities | \n
\n \n 3 | \n country | \n
\n \n 4 | \n events | \n
\n \n 5 | \n games | \n
\n \n 6 | \n medals | \n
\n \n 7 | \n regions | \n
\n \n 8 | \n seasons | \n
\n \n 9 | \n sports | \n
\n \n 10 | \n sports_stats | \n
\n \n 11 | \n teams | \n
\n \n
\n
"
84 | },
85 | "metadata": {},
86 | "execution_count": 4
87 | }
88 | ],
89 | "source": [
90 | "tables"
91 | ]
92 | },
93 | {
94 | "source": [
95 | "# Finding out First season played"
96 | ],
97 | "cell_type": "markdown",
98 | "metadata": {}
99 | },
100 | {
101 | "cell_type": "code",
102 | "execution_count": 5,
103 | "metadata": {},
104 | "outputs": [],
105 | "source": [
106 | "first_game = pd.read_sql('''SELECT season_name, city_name, MIN(year) AS `First Game Year`\n",
107 | " FROM\n",
108 | " sports_stats,\n",
109 | " seasons,\n",
110 | " athletes\n",
111 | " INNER JOIN\n",
112 | " games ON athletes.game_id = games.game_id\n",
113 | " INNER JOIN\n",
114 | " cities ON games.city_id = cities.city_id\n",
115 | " WHERE\n",
116 | " seasons.season_id = games.season_id\n",
117 | " ORDER BY sports_stats_id;''', \n",
118 | " con = engine\n",
119 | ")"
120 | ]
121 | },
122 | {
123 | "cell_type": "code",
124 | "execution_count": 8,
125 | "metadata": {},
126 | "outputs": [
127 | {
128 | "output_type": "stream",
129 | "name": "stdout",
130 | "text": [
131 | " season_name city_name First Game Year\n0 Summer Barcelona 1896\n"
132 | ]
133 | }
134 | ],
135 | "source": [
136 | "first_game"
137 | ]
138 | },
139 | {
140 | "source": [
141 | "# How many medals were distributed?"
142 | ],
143 | "cell_type": "markdown",
144 | "metadata": {}
145 | },
146 | {
147 | "cell_type": "code",
148 | "execution_count": 9,
149 | "metadata": {},
150 | "outputs": [],
151 | "source": [
152 | "total_medal = pd.read_sql(\n",
153 | " '''\n",
154 | " SELECT \t\n",
155 | " COUNT(Medal) AS `Total Medal Distributed`\n",
156 | " FROM\n",
157 | "\t athlete_events\n",
158 | " WHERE Medal IS NOT NULL;\n",
159 | " ''',\n",
160 | " con = engine\n",
161 | ")"
162 | ]
163 | },
164 | {
165 | "cell_type": "code",
166 | "execution_count": 10,
167 | "metadata": {},
168 | "outputs": [
169 | {
170 | "output_type": "execute_result",
171 | "data": {
172 | "text/plain": [
173 | " Total Medal Distributed\n",
174 | "0 39783"
175 | ],
176 | "text/html": "\n\n
\n \n \n | \n Total Medal Distributed | \n
\n \n \n \n 0 | \n 39783 | \n
\n \n
\n
"
177 | },
178 | "metadata": {},
179 | "execution_count": 10
180 | }
181 | ],
182 | "source": [
183 | "total_medal"
184 | ]
185 | },
186 | {
187 | "source": [
188 | "# Lists of Sports Events played in first game(1896)"
189 | ],
190 | "cell_type": "markdown",
191 | "metadata": {}
192 | },
193 | {
194 | "cell_type": "code",
195 | "execution_count": 11,
196 | "metadata": {},
197 | "outputs": [],
198 | "source": [
199 | "games_list = pd.read_sql(\n",
200 | " '''\n",
201 | " SELECT DISTINCT (sport_name)\n",
202 | " FROM\n",
203 | " sports_stats,\n",
204 | " sports,\n",
205 | " athletes\n",
206 | " INNER JOIN\n",
207 | " games ON athletes.game_id = games.game_id\n",
208 | " INNER JOIN\n",
209 | " cities ON games.city_id = cities.city_id\n",
210 | " WHERE\n",
211 | " games.year = 1896\n",
212 | " ORDER BY sport_name;\n",
213 | " ''',\n",
214 | " con = engine\n",
215 | ")"
216 | ]
217 | },
218 | {
219 | "cell_type": "code",
220 | "execution_count": 12,
221 | "metadata": {},
222 | "outputs": [
223 | {
224 | "output_type": "execute_result",
225 | "data": {
226 | "text/plain": [
227 | " sport_name\n",
228 | "0 Aeronautics\n",
229 | "1 Alpine Skiing\n",
230 | "2 Alpinism\n",
231 | "3 Archery\n",
232 | "4 Art Competitions\n",
233 | ".. ...\n",
234 | "61 Tug-Of-War\n",
235 | "62 Volleyball\n",
236 | "63 Water Polo\n",
237 | "64 Weightlifting\n",
238 | "65 Wrestling\n",
239 | "\n",
240 | "[66 rows x 1 columns]"
241 | ],
242 | "text/html": "\n\n
\n \n \n | \n sport_name | \n
\n \n \n \n 0 | \n Aeronautics | \n
\n \n 1 | \n Alpine Skiing | \n
\n \n 2 | \n Alpinism | \n
\n \n 3 | \n Archery | \n
\n \n 4 | \n Art Competitions | \n
\n \n ... | \n ... | \n
\n \n 61 | \n Tug-Of-War | \n
\n \n 62 | \n Volleyball | \n
\n \n 63 | \n Water Polo | \n
\n \n 64 | \n Weightlifting | \n
\n \n 65 | \n Wrestling | \n
\n \n
\n
66 rows × 1 columns
\n
"
243 | },
244 | "metadata": {},
245 | "execution_count": 12
246 | }
247 | ],
248 | "source": [
249 | "games_list"
250 | ]
251 | },
252 | {
253 | "source": [
254 | "We can see that 66 sports were played in first Games in the year 1896"
255 | ],
256 | "cell_type": "markdown",
257 | "metadata": {}
258 | },
259 | {
260 | "source": [
261 | "# Country with highest players"
262 | ],
263 | "cell_type": "markdown",
264 | "metadata": {}
265 | },
266 | {
267 | "cell_type": "code",
268 | "execution_count": null,
269 | "metadata": {},
270 | "outputs": [],
271 | "source": [
272 | "games_list = pd.read_sql(\n",
273 | " '''\n",
274 | " SELECT \n",
275 | " country_name, COUNT(country_name)\n",
276 | " FROM\n",
277 | " Regions\n",
278 | " GROUP BY country_name\n",
279 | " ORDER BY COUNT(country_name) DESC;\n",
280 | " ''',\n",
281 | " con = engine\n",
282 | ")"
283 | ]
284 | },
285 | {
286 | "source": [
287 | "# Some Statistics"
288 | ],
289 | "cell_type": "markdown",
290 | "metadata": {}
291 | },
292 | {
293 | "cell_type": "code",
294 | "execution_count": null,
295 | "metadata": {},
296 | "outputs": [],
297 | "source": [
298 | "avg_age = pd.read_sql(\n",
299 | " '''\n",
300 | " SELECT \n",
301 | " AVG(athlete_age) AS `Avg Age`\n",
302 | " FROM\n",
303 | " sports_stats;\n",
304 | " ''',\n",
305 | " con = engine\n",
306 | ")"
307 | ]
308 | },
309 | {
310 | "cell_type": "code",
311 | "execution_count": null,
312 | "metadata": {},
313 | "outputs": [],
314 | "source": [
315 | "avg_weight = pd.read_sql(\n",
316 | " ''' \n",
317 | " SELECT \n",
318 | " AVG(athlete_weight) AS `Avg Weight`\n",
319 | " FROM\n",
320 | " sports_stats;\n",
321 | " ''',\n",
322 | " con = engine\n",
323 | ")"
324 | ]
325 | },
326 | {
327 | "cell_type": "code",
328 | "execution_count": null,
329 | "metadata": {},
330 | "outputs": [],
331 | "source": [
332 | "avg_height = pd.read_sql(\n",
333 | " ''' \n",
334 | " SELECT \n",
335 | " AVG(athlete_height) AS `Avg Height`\n",
336 | " FROM\n",
337 | " sports_stats;\n",
338 | " ''',\n",
339 | " con = engine\n",
340 | ")"
341 | ]
342 | }
343 | ]
344 | }
--------------------------------------------------------------------------------
/Viz_Images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/1.jpg
--------------------------------------------------------------------------------
/Viz_Images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/2.jpg
--------------------------------------------------------------------------------
/Viz_Images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/3.jpg
--------------------------------------------------------------------------------
/Viz_Images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/4.jpg
--------------------------------------------------------------------------------
/Viz_Images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/5.jpg
--------------------------------------------------------------------------------
/Viz_Images/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mega-Barrel/SQL-DataScience-Capstone/21787f7a4efc2b804cba9c33434b576eca1d2f42/Viz_Images/6.jpg
--------------------------------------------------------------------------------
/read_csv.py:
--------------------------------------------------------------------------------
1 |
2 | import pandas as pd
3 | import sqlalchemy
4 |
5 |
6 | # Creating connecting object
7 |
8 | engine = sqlalchemy.create_engine('mysql+pymysql://saurabh:saurabh_sql@localhost:3306/UC_Davis')
9 |
10 |
11 | # Reading the CSV files
12 |
13 | print('Reading noc_regions CSV file')
14 | regions = pd.read_csv('Dataset/noc_regions.csv')
15 |
16 |
17 | print('Reading athlete_events CSV file')
18 | events = pd.read_csv('Dataset/athlete_events.csv')
19 |
20 |
21 | '''
22 | Using inbuild pandas function to convert CSV to MySQL
23 | '''
24 |
25 | events.to_sql(
26 | 'athlete_events',
27 | con = engine,
28 | index = False,
29 | if_exists = 'append'
30 | )
31 | print('Finished storing CSV file to MySQL database!')
32 |
33 |
34 | regions.to_sql(
35 | 'country',
36 | con = engine,
37 | index = False,
38 | if_exists = 'append'
39 | )
40 | print('Finished storing CSV file to MySQL database!')
--------------------------------------------------------------------------------