OLYMPICS�DATABASE MANAGEMENT SYSTEM
THIRD SEMESTER PROJECT
SUBMITTED TO :
We as a team are very thankful to our mentor DR. DEBANJAN SADHYA for giving us wonderful opportunity to work on this project and solve real life problem.
While doing this project we have gained lot of experience in Database Management System
DR.DEBANJAN SADHYA
TEAM MEMBERS
HARSH DALWADI
HARSHVARDHAN�RAJ
APOORV �JAIN
01
04
AYUSH RAKESH
02
03
2021-IMT-026
2021-IMT-042
2021-IMT-015
2021-IMT-018
05
06
DEEPAK
KRIPLANI
�YASH
NIGAM
2021-IMT-115
2021-IMT-027
01. OVERVIEW OF PROJECT
The modern Olympic Games or Olympics are the leading international sporting events featuring summer and winter sports competitions in which thousands of athletes from around the world participate in a variety of competitions. The Olympic Games are considered the world's foremost sports competition with more than 200 teams, representing sovereign states and territories, participatingThis is an Olympics Database project which consists of developing of entities and their respective attributes. This approach also includes writing and applying
queries as required . After forming initial Entities with their attributes then we proceed with developing ER diagram for given entities in further phases.Details of the atheletes, countries, International Olympics Committee, Olympic Games are covered under this project . This database can handle different requests and provides an output based on above entities. The results from this database is used by olympic authorities for better decision making.
02.�ER DIAGRAM
ENTITY SETS
Athlete
This entity represents the athletes taking part in at least one sport in any Olympic. It has attributes name, dob, gender, contact, athlete_id
Country
This entity represents the countries taking part in at least one Olympics in any year. It has attributes such as abbreviation, name, anthem
Olympic
This entity represents the Olympics held in different years. It has attributes year, sponsors and host country
Olympic_game
This entity represents the game which is played in different Olympics in different years. It has attributes such sport, subsport and type.
Time_stamp
This entity has the attributes commencement time and date which gives information about which Olympic game is played at what date and time
Official
This entity represents the officers that forms an IOC(International Organization Council) in any Olympics. It has attributes such as dob, name, contact , official_id, etc.
AGGREGATION
An ER diagram is not capable of representing relationship between an entity and a relationship which may be required in some scenarios. In those cases, a relationship with its corresponding entities is aggregated into a higher level entity. Aggregation is an abstraction through which we can represent relationships as higher level entity sets.
An athlete can participate in various sports in multiple years. So played relationship is needed between played_at relationship and athlete entity. Using aggregation, played_at relationship with its entities Olympic_game and Olympics is aggregated into a single entity and the relationship played is created between aggregate entity and athlete.
03. ASSUMPTIONS
04. RELATIONSHIP SETS AND CARDINALITIES
It is a one to many relationship between country and athlete as multiple athletes can participate from single country and an athlete can belong to one and only one country. Country and Athlete both are showing total participation
It is an identifying relationship for the time_stamp which is a weak entity set and the aggregate entity is the identifying strong entity set. It is many to many relationship as single sport event can go on for multiple days and a many sport events can start at the same timestamp. It has total participation on both the sides.
it is a many to many relationship between Olympic entity and Officials as many officials can be part of an organizing IOC and a single official can be a part of multiple IOCs. Both the entities show total participation. It has a descriptive attribute post which identities which official has which post in a particular IOC.
It is a many to many relationship between athlete and an aggregate entity which includes Olympic_game and Olympic entities. Both the entities are showing total participation. It has a composite descriptive attribute of result which shows which medal was won by an athlete in a particular Olympic game.
It is a many to many relationship between Olympic_game and Olympic as an Olympic can have many Olympic games and a single Olympic game can be part of many olympics. Both entites are showing total participation. It has a composite descriptive attribute site_address which shows where was an Olympic game organized in a particular year.
It is a many to many relationship between country and Olympic as many countries can participate in single Olympic as well as a single country can participate in multiple Olympics. It has total participation from both the sides.
ER DIAGRAM TO RELATIONAL SCHEMA
05.
1) In athlete entity, contacts is a multi-valued attribute. That means, an athlete may have more than one contact number.
To reduce a multi-valued attribute into a relational schema, we have to create a separate table for each multi-valued attribute. Also, we need to include the primary key of strong entity set as a foreign key attribute to establish link.
Therefore, the athlete entity set will get divided into :
Athlete(athlete_id, name, dob, gender)
Athlete_contact(athlete_id, contact)
By the same reason, the officials entity will get divided into :
Official(official_id, dob, name, gender)
Official_contact(official_id, contact)
By the same logic, the olympic entity will get divided into :�Olympic(year, host_country)�Olympic_sponsor(year, sponsor)��2) Belongs_to(athlete_id, abbrev)�Since belongs_to relationship is one to many relationship between country and athlete and there is total participation in the athlete side, therefore instead of creating a schema for belongs_to relationship, we will be adding abbrev (primary key of country) in the athlete schema as a foreign key.�So the new schema for athlete entity :�Athlete(athlete_id, name, gender, abbrev, dob)�
WEAK ENTITY SET
Timestamp(commencement, date)
In the ER Diagram, Timestamp is an entity having commencement and date as the two attributes.It is a weak entity because it does not have any presence of its own and it depends upon the strong aggregate entity.
Therefore, we add the primary keys of the aggregate entity into the Timestamp entity as foreign keys. Since it is a weak entity set, the identifying relationship will be redundant and we have to add primary key of identifying strong entity set(aaggregate entity) and the resultant schema will be as follows :
Timestamp(sport, subsport, year, commencement, date)
The schemas (before normalization) will be : �
FUNCTIONAL DEPENDENCIES
06.
Schema | Functional Dependencies |
athelete | athelete_id 🡪 dob, gender, name, abbrev |
athelete_contact | contact 🡪athelete_id |
country | abbrev 🡪 name, anthem |
| name 🡪 anthem, abbrev |
| anthem 🡪 abbrev, name |
IOC | year, official_id 🡪 post |
officials | official_id🡪name, dob, gender |
Official_contact | Contact 🡪 official_id |
olympic | year 🡪 host_country |
played | athelete_id, year, sport, subsport🡪result |
played_at | sport, subsport, year 🡪 pincode, city, state |
| city 🡪 state |
| pincode 🡪 city, state |
olympic_game | Sport,subsport🡪 type |
| sport 🡪 type |
DECOMPOSITION USING NORMALIZATION
07.
1NF : Since all the attributes are in atomic form, the table is in 1NF
2NF : Since there is no partial dependency, the table is in 2NF
3NF : There is a transitive dependency,
Subsport, sport, year 🡪 pincode
pincode 🡪 city, state
which includes non-prime attributes. To convert the table into 3NF we split the table into two tables E1 and E2 :
E1(sport, subsport, year, pincode)
E2(pincode , city, state)
Played_at | |
PK | sport |
PK | subsport |
PK | year |
| state |
| city |
| pincode |
Here, E2 is still not in 3NF, therefore we split E2 into two table E3 and E4 :
E3(pincode, city)
E4(city, state). Therefore, played_at table gets decomposed into E1, E3, E4 and all are in 3NF , and all are in BCNF as well.
1NF : As all the attributes are in atomic form, the table is in 1NF form
2NF : As there is a dependency sport 🡪 type, we split the table into 2 tables E1 and E2
E1(sport, subsport)
E2(sport, type)
Both E1 and E2 are now in 2NF.
3NF : As there is no transitive dependencies in E1 and E2, both the tables are in 3NF and all are in BCNF as well.
Olympic_game | |
PK | sport |
PK | subsport |
| type |
Athelete | |
PK | athelete_id |
| dob |
| name |
| gender |
FK | abbrev |
athelete_contact | |
FK | athlete_id |
PK | contact |
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
Country | |
PK | abbrev |
| name |
| anthem |
IOC | |
PK | year |
PK | official_id |
| post |
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
official | |
PK | official_id |
| name |
| dob |
| gender |
official_contact | |
FK | official_id |
PK | contact |
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
Olympic | |
PK | year |
| host_country |
Played | |
PK | athlete_id |
PK | Year |
PK | Sport |
PK | subsport |
| result |
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
Timestamp | |
PK | year |
PK | sport |
PK | subsport |
PK | commencement |
PK | date |
Olympics_sports | |
PK | subsport |
PK | sport |
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
1NF – All attributes are atomic in nature, therefore table is in 1NF
2NF – There is no partial dependencies, therefore table is in 2NF
3NF –There is no transitive dependenvcies, therefore table is in 3NF
BCNF – All dependencies have superkey or candidate key on left side
08.�FINAL TABLES
Athelete | |
PK | athelete_id |
| dob |
| name |
| gender |
FK | abbrev |
athelete_contact | |
FK | athlete_id |
PK | contact |
IOC | |
PK | year |
PK | official_id |
| post |
Timestamp | |
PK | year |
PK | sport |
PK | subsport |
PK | commencement |
PK | date |
Played | |
PK | athlete_id |
PK | year |
PK | sport |
PK | subsport |
| result |
Country | |
PK | abbrev |
| name |
| anthem |
Olympics_sports | |
PK | subsport |
PK | sport |
Participated | |
PK | abbrev |
PK | year |
official | |
PK | official_id |
| name |
| dob |
| gender |
played_at | |
PK | sport |
PK | subsport |
PK | year |
| pincode |
official_contact | |
FK | official_id |
PK | contact |
address | |
PK | pincode |
| city |
place | |
PK | city |
| state |
Olympic | |
PK | year |
| host_country |
olympic_sponsor | |
PK | year |
PK | sponsor |
olympic_type | |
PK | type |
PK | sports |
DATATABLES
athelete
city
country
olympic
place
participate
official
played_at
time_stamp
ioc
olympic_type |
|
olympics_sponsers |
played
official_contact
athlete_contact
09.MYSQL QUERIES
Find details of all athletes who participated in Olympics when the President is Pablo Heung
Find the sports and number of gold medals won by female players in each sport.
Find the official_id and name of all officials in Olympic 2012;
�Find all athletes who participated in Olympic 2020;
Find the Indian athlete who won a gold medal in any Olympic.
10. RELATIONAL ALGEBRA QUERIES
Find athlete_id and name of all athletes who have played hockey or athletics.
Find all the sponsors of Olympic 2008.
Find all sports with corresponding subsport which had commenced on 21 NOV 08:45:25
Find all players who played Karate Women in Olympic 2022.
Find all the Outdoor sports played in Olympics 2020.