Professional Documents
Culture Documents
ON
GROUP A UEFA CHAMPIONS LEAGUE 2020-21
Signature
i
ACKNOWLEDGEMENT
Guidance, inspiration and motivation have always played a key role in the success of
any venture. We would like to pay my sincere regards to all those who guided me in
my project work.
We would like to avail this opportunity to pay our sincere gratitude and regards to
Asst. Prof. Dr Gaganmeet Kaur, USME, Delhi Technological University for
providing us such a wonderful opportunity to widen the horizons of our knowledge
and giving her support, guidance and encouragement throughout the project work.
Last but not the least we would like to thank our parents, family and friends who
have directly or indirectly contributed to make this project a success.
Batch: 2021-2023
ii
TABLE OF CONTENTS
1
Relations
1. groupa to match_table: Match table consist of football clubs matches information
where it specifies home or away team along with more information. (1:M)
2. match_table to referee: This relation shows the particular referee for each match
corresponding to match table. (1:1)
3. match_table to stadium: This relation signifies the stadium information to the
corresponding match data. (M:1)
4. groupa to bayern_munich: Match table consist of football clubs matches information
where it specifies home or away team along with more information. (1:M)
5. bayern_munich to bm_player_performance: Match table consist of football clubs
matches information where it specifies home or away team along with more
information. (1:M)
6. groupa to atletico_madrid: Match table consist of football clubs matches information
where it specifies home or away team along with more information. (1:M)
7. atletico_madrid to am_player_performance: Match table consist of football clubs
matches information where it specifies home or away team along with more
information. (1:M)
8. groupa to rb_salzburg: Match table consist of football clubs matches information
where it specifies home or away team along with more information. (1:M)
9. rb_salzburg to rbs_player_performance: Match table consist of football clubs
matches information where it specifies home or away team along with more
information. (1:M)
10. groupa to locomotiv_moscow: Match table consist of football clubs matches
information where it specifies home or away team along with more information. (1:M)
11. locomotiv_moscow to lm_player_performance: Match table consist of football clubs
matches information where it specifies home or away team along with more
information. (1:M)
2
ER Diagram
3
Relational Mapping Diagram
GroupA
fc_id fc_name played won draw lost Goals_for Goals_against Goals_difference
Match_table
m_id Match_date Home_team_id Away_team_id score S_id R_id
Stadium
S_id Stadium_name Fc_stadium Capacity City Surface_type
Referee
R_id R_name nationality
Bayern_munich
P_id First_name Last_name Date_of_birth Nationality Nominal_position Fc_id
Bm_player_performance
P_id goals assists Penal_cards
Atletico_madrid
P_id First_name Last_name Date_of_birth Nationality Nominal_position Fc_id
am_player_performance
P_id goals assists Penal_cards
Rb_salzburg
P_id First_name Last_name Date_of_birth Nationality Nominal_position Fc_id
rbz_player_performance
P_id goals assists Penal_cards
Locomotiv_moscow
P_id First_name Last_name Date_of_birth Nationality Nominal_position Fc_id
lm_player_performance
P_id goals assists Penal_cards
4
5
SQL Statements
use uefa_champions_league_2020;
4. Inserting values
6
-- creating table Stadium to record stadium information for respective matches --
create table Stadium(
s_id int,
stadium_name varchar(30),
fc_stadium int,
capacity int,
city varchar(20),
surface_type varchar(20),
primary key (s_id),
foreign key (fc_stadium) references GroupA (fc_id));
-- creating table Referee to record referee information accorting to respective matches played --
7
-- creating table Match Table to record all football club performances and other necessasry information
--
8
-- creating table Bayern Munich to record Bayern Munich Players information --
9
-- creating table Atletico Madrid to record Atletico Madrid Players information --
10
-- creating table Red Bull Salzburg to record Red Bull Salzburg Players information --
11
-- creating table Locomotiv Moscow to record Locomotiv Moscow Players information --
12
-- creating table bm_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --
13
-- creating table am_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --
14
-- creating table rbs_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --
15
-- creating table lm_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --
create table lm_player_performance(
p_id int,
goals int,
assist int,
penalty_cards varchar(10),
foreign key (p_id) references locomotiv_moscow (p_id));
-- 1. List the dates and scores of the matches played by FC Bayern Munich
Select a.match_date, a.score
from match_table a
16
join groupa b
on a.away_team_id=b.fc_id or a.home_team_id=b.fc_id
where b.fc_name='bayern_munich';
Select a.match_date
from match_table a
join stadium b
on a.s_id=b.s_id
where b.city='salzburg';
-- 4. List match dates played in Munich and Moscow along with the stadium details
17
-- 5. List all the matches played with respective referee name
-- 6. List match details of FC Atletico Madrid with respective stadium & referee information
18
-- 7. List all the match details with french referee
-- 9. List all the match details where spectators were more than 50000
-- 10. List all players of FC Bayern Munich who got at least 1 penalty card
-- 12. List all players of FC Red Bull Salzburg who got at least 1 assist
-- 13. List defeneders who got at least 1 penalty card of FC Locomotiv Moscow
-- 15. List forward players who did at least 1 goal of FC Atletico Madrid
-- sub queries
-- 16. List player jersey names, position on field and their country of FC Red Bull Salzburg
21
-- 17. List players of FC Locomotiv Moscow who play as midfielders
-- 19. List players of FC Atletico Madrid who are elder than the average of all players
22
where (year(curdate())-year(date_of_birth))>(Select avg(year(curdate())-year(date_of_birth)) as age
from atletico_madrid);
-- 20. List players of FC Red Bull Salzburg who are younger than the average of all players
-- 21. List the match details where FC Locomotiv Moscow was not the away team
-- 22. List the match details where FC Bayern Munich played in their home ground
-- 24. List the player details of FC Red Bull Salzburg who got assits more than 1
-- 25. List the player details of FC Locomotiv Moscow who has got more than 1 penalty cards
24
Conclusion
During the course of this project, we learnt a lot of the work and best practices that go into creating a database, the rules
to construct a good ER diagram, how to come up with relational schema mapping from the ER diagram, deriving
relational schema into schema afterwards. We learnt on how to design a system from Database perspective and how
to efficiently store and manipulate data.
25