An Olympic metrics reporting web application
- General Info
- Implementation Details
- Testing
- Screenshots
- Technologies Used
- Usage
- Acknowledgements
- Author
In this project I wrote all the SQL statements for an Olympic metrics reporting web application called Gold Medal Metrics.
You can view all of this functionality in action in the video below: ▶
Gold Medal Metrics allows users to:
- View countries in a list with their population, GDP, and number of Olympic gold medals.
- Sort the list of countries by any of these attributes, as well as alphabetically by name.
- View a detailed description of a country, with statistics on their Olympic wins.
- View a list of every Olympic win a country has with the year, season, winner name, city, and event.
- Sort the list of Olympic wins by any of these attributes.
To complete this project, I needed to write a series of JavaScript functions that return the SQL queries (as strings) that operate Gold Medal Metrics:
-
createCountryTable
Returns the SQL command that will create a table, named
Country
. -
createGoldMedalTable
Returns the SQL command that will create a table, named
GoldMedal
. -
goldMedalNumber
Returns the SQL command that will retrieve the number of gold medals that country has won in all Olympic games.
-
mostSummerWins
Returns the SQL command that will retrieve the year where the given country won the most summer medals
-
mostWinterWins
Returns the SQL command that will retrieve the year where the given country won the most winter medals
-
bestYear
Returns the SQL command that will retrieve the
year
that country won the most Olympic medals, and how many medals were won. -
bestDiscipline
Returns the SQL command that will retrieve the
discipline
in which that country won the most Olympic medals, and how many medals were won. -
bestSport
Returns the SQL command that will retrieve the
sport
in which that country won the most Olympic medals, and how many medals were won. -
bestEvent
Returns the SQL command that will retrieve the
event
in which that country won the most Olympic medals, and how many medals were won. -
numberMenMedalists
Returns the SQL command that will retrieve the number of men who have won Olympic medals for that country.
-
numberWomenMedalists
Returns the SQL command that will retrieve the number of women who have won Olympic medals for that country.
-
mostMedaledAthlete
Returns the sql command that will retrieve the
name
of the athlete who won olympic medals for that country. -
orderedMedals
Return a SQL query that returns all fields for every Olympic medal won by the given country in the specified order, ascending or descending.
-
Bonus:
orderedSports
Return a SQL query that retrieves all the sports that country has received a Gold Medal in in the specified order, ascending or descending. Additionally the query returned should return the number of times the given country received a medal in that sport
✅ #2 issue
A testing suite has been provided, checking for all essential functionality and edge cases.
To run these tests run
npm test
✅ #3 issue
✔ All test passed
To view the webpage, run
$ npm run webpack
to compile the front-end files, and follow that with open index.html
from the root directory of this project.
To start your server, run
$ npm install
and then node server.js
. Refresh your browser to collect the information from the server.
- React 15
- react-router-dom 4
- mocha 10
- chai 4
- express 4
- sqlite3 5
This project comes from the Codecademy's Create a Back-End with JavaScript course.