You are on page 1of 29

DQVL PROJECT REPORT

ON
GROUP A UEFA CHAMPIONS LEAGUE 2020-21

Submitted in partial fulfilment of requirement for the award of the


degree of MBA in Business Analytics, 2021-2023

UNDER THE GUIDANCE OF: SUBMITTED BY:

DR. GAGANMEET KAUR SNIGDHA DHUPAL - 2K21/BMBA/20


ASSISTANT PROFESSOR JITESH KADAM - 2K21/BMBA/10
USME – DTU

DELHI TECHNOLOGICAL UNIVERSITY


formerly Delhi College of Engineering
(under Delhi Act 6 of 2009, Govt. of NCT of Delhi)
Accredited with ‘A’ Grade (CGPA 3.22 out of 4.0) by NAAC (1st Cycle)
ISO 9001:2015 Certified
CERTIFICATE
This is to certify that the DQVL Project titled as “GROUP A UEFA CHAMPIONS
LEAGUE 2020-21” is an academic work done by Mr. Jitesh Kadam
and Ms. Snigdha Dhupal submitted in the partial fulfilment of the requirement for the
award of Degree of Masters of Management Administration in Business Analytics at
University School of Management & Entrepreneurship, Delhi Technological University
under my guidance and direction. To the best of my knowledge and belief, the data and
information presented by them in the project has not been submitted anywhere.

Signature

Dr. Gaganmeet Kaur


Assistant Professor

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.

Name of the Student: Jitesh Kadam; Snigdha Dhupal

University Enrolment No.: 2K21/BMBA/10; 2K21/BMBA/20

Program: MBA – Business Analytics

Batch: 2021-2023

ii
TABLE OF CONTENTS

S. No. Particulars Page No.


Certificate i
Acknowledgement ii
1. Problem Statement 1
2. Entities 1
3. Relations 2
4. ER Diagram 3
5. Relational Mapping Diagram 4
6. Schema Diagram 5
7. SQL Statements 6-24
8. Conclusion 25
Problem Statement
We need to store information pertaining to football clubs belonging to Group A in the UEFA
Championship League 2020-2021.
We need to store information of all the football clubs and their respective matches along with
points table. Also, the information about stadiums and referees.
With each player performance is associated with information about goals, assists and penalty
cards. In our system, we will store information about football clubs and their respective players
where the following data will be considered: first_name, last_name, date_of_birth, nationality.
Entities
1. groupa: Group A tells us about the teams in group A in UEFA Champions League
2020-21. It will consist of number of matches played, won, lost, goal difference and
points obtained by each club.
2. match_table: Match table tells us about the match dates with their respective scores,
stadium, referee, away team, home team information.
3. referee: Referee denotes the name and nationality of the referee who officiated in each
group match played between clubs in Group A.
4. stadium: Stadium will be telling us about the details of the particular stadium in which
each group match was played among the clubs in group A
5. bayern_munich: The players who participated in UEFA Champions League 2020-21
representing Bayern Munich in the competition. It consists of details of individuals such
as name, nationality, dob, position played.
6. bm_player_performance: Bayern Munich players’ performance is shown in the form
of number of goals scored, assists given, penalty cards received in the UEFA
Champions League 2020-21.
7. atletico_madrid: The players who participated in UEFA Champions League 2020-21
representing Atletico Madrid in the competition. It consists of details of individuals
such as name, nationality, dob, position played.
8. am_player_performance: Atletico Madrid players’ performance is shown in the form
of number of goals scored, assists given, penalty cards received in the UEFA
Champions League 2020-21.
9. rb_salzburg: The players who participated in UEFA Champions League 2020-21
representing Red Bull Salzburg in the competition. It consists of details of individuals
such as name, nationality, dob, position played.
10. rbs_player_performance: Red Bull Salzburg players’ performance is shown in the
form of number of goals scored, assists given, penalty cards received in the UEFA
Champions League 2020-21.
11. locomotiv_moscow: The players who participated in UEFA Champions League 2020-
21 representing Locomotiv Moscow in the competition. It consists of details of
individuals such as name, nationality, dob, position played.
12. lm_player_performance: Locomotiv Moscow players’ performance is shown in the
form of number of goals scored, assists given, penalty cards received in the UEFA
Champions League 2020-21.

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

1. -- creating database UEFA CHAMPIONS LEAGUE 2020 for GROUP A --

create database uefa_champions_league_2020;

2. -- using database UEFA CHAMPIONS LEAGUE 2020 for GROUP A --

use uefa_champions_league_2020;

3. -- creating table GroupA to record Group A points table --

create table GroupA(


fc_id int,
fc_name varchar(20) unique,
played int,
won int,
draw int,
lost int,
goals_for int,
goals_against int,
goals_difference int,
points int,
primary key (fc_id));

4. Inserting values

(206301,'Bayern_Munich', 6, 5, 1, 0, 18, 5, 13, 16),


(206302, 'Atletico_Madrid', 6, 2, 3, 1, 7, 8, -1, 9),
(206303, 'Red_Bull_Salzburg', 6, 1, 1, 4, 10, 17, -7, 4),
(206304, 'Locomotiv_Moscow', 6, 0, 3, 3, 5, 10, -5, 3);

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));

insert into stadium values


(201901,'Red_Bull_Arena',206303,31895,'Salzburg','Lawn'),
(201902,'Allianz_Arena',206301,75024,'Munich','Natural_grass'),
(201903,'Wanda_Metropolitano',206302,68456,'Madrid','Natural_grass'),
(201904,'RZD_Arena',206304,27084,'Moscow','Grass');

-- creating table Referee to record referee information accorting to respective matches played --

create table Referee(


r_id int,
r_name varchar(20),
nationality varchar(20),
primary key (r_id));

insert into referee values


(201801,'Ali_Palabiyik','Turkey'),
(201802,'Anthony_Taylor','England'),
(201803,'Benoit_Bastien','France'),
(201804,'Clement_Turpin','France'),
(201805,'Danny_Makkelie','Netherlands'),
(201806,'Istvan_Kovacs','Romania'),
(201807,'Michael_Oliver','Northumberland'),
(201808,'Orel_Grinfeld','Israel'),
(201809,'Ovidiu_Hategan','Romania'),
(201810,'Sandro_Scharer','Switzerland'),
(201811,'Serdar_Gozubuyuk','Netherlands'),
(201812,'Slavko_Vincic','Slovenia');

7
-- creating table Match Table to record all football club performances and other necessasry information
--

create table Match_table(


m_id int,
match_date date,
s_id int,
home_team_id int,
away_team_id int,
score varchar(5),
r_id int,
primary key (m_id),
foreign key (s_id) references Stadium (s_id),
foreign key (r_id) references Referee (r_id),
foreign key (away_team_id) references GroupA (fc_id),
foreign key (home_team_id) references GroupA (fc_id));

insert into match_table values


(201301,'2020-10-21',201901,206303,206304,'2-2',201811),
(201302,'2020-10-21',201902,206301,206302,'4-0',201807),
(201303,'2020-10-27',201904,206304,206301,'1-2',201806),
(201304,'2020-10-27',201903,206302,206303,'3-2',201809),
(201305,'2020-11-03',201904,206304,206302,'1-1',201803),
(201306,'2020-11-03',201901,206303,206301,'2-6',201805),
(201307,'2020-11-25',201903,206302,206304,'0-0',201812),
(201308,'2020-11-25',201902,206301,206303,'3-1',201808),
(201309,'2020-12-01',201904,206304,206303,'1-3',201801),
(201310,'2020-12-01',201903,206302,206301,'1-1',201804),
(201311,'2020-12-09',201902,206301,206304,'2-0',201810),
(201312,'2020-12-09',201901,206303,206302,'0-2',201802);

8
-- creating table Bayern Munich to record Bayern Munich Players information --

create table bayern_munich(


p_id int,
first_name varchar(20),
last_name varchar(20) unique,
nominal_position varchar(20),
nationality varchar(20),
date_of_birth date,
fc_id int,
primary key (p_id),
foreign key (fc_id) references GroupA (fc_id));

insert into bayern_munich(p_id, first_name, last_name, nominal_position, nationality, date_of_birth,


fc_id) values
(201601, 'Manuel', 'Neuer', 'Goalkeeper', 'Germany', '1986-03-27', 206301),
(201602, 'Niklas', 'Sule', 'Defender', 'Germany', '1995-09-03', 206301),
(201603, 'Benjamin', 'Pavard', 'Defender', 'France', '1996-03-28', 206301),
(201604, 'Joshua', 'Kimmich', 'Midfielder', 'Germany', '1995-02-08', 206301),
(201605, 'Serge', 'Gnabry', 'Midfielder', 'Germany', '1995-07-14', 206301),
(201606, 'Javi', 'Martinez', 'Defender', 'Spain', '1998-09-02', 206301),
(201607, 'Robert', 'Lewandowski', 'Forward', 'Poland', '1988-08-21', 206301),
(201608, 'Leroy', 'Sane', 'Forward', 'Germany', '1996-01-11', 206301),
(201609, 'Corentiano', 'Tolisso', 'Midfielder', 'Spain', '1991-04-11', 206301),
(201610,'Eric', 'Maxim', 'Forward', 'Cameroon', '1989-03-23', 206301),
(201611,'Kingsley', 'Coman', 'Forward', 'France', '1996-06-13', 206301),
(201612,'Jerome', 'Boateng', 'Defender', 'Germany', '1988-09-03', 206301),
(201613,'Leon', 'Goretzka', 'Midfielder', 'Germany', '1995-02-06', 206301),
(201614,'Alphonso', 'Davies', 'Midfielder', 'Canada', '2000-11-02', 206301),
(201615,'Thomas','Muller','Midfielder','Germany','1989-09-13',206301);

9
-- creating table Atletico Madrid to record Atletico Madrid Players information --

create table atletico_madrid(


p_id int,
first_name varchar(20),
last_name varchar(20) unique,
nominal_position varchar(20),
nationality varchar(20),
date_of_birth date,
fc_id int,
primary key (p_id),
foreign key (fc_id) references GroupA (fc_id));

insert into atletico_madrid values


(201616, 'Jan', 'Oblak', 'Goalkeeper', 'Slovenia', '1993-01-07', 206302),
(201617, 'Jorge', 'Koke', 'Midfielder', 'Spain', '1992-01-08', 206302),
(201618, 'Joao', 'Felix', 'Forward', 'Portugal', '1999-11-10', 206302),
(201619, 'Luis', 'Suarez', 'Forward', 'Uruguay', '1987-01-24', 206302),
(201620, 'Angel', 'Correa', 'Forward', 'Argentina', '1995-03-09', 206302),
(201621, 'Thomas', 'Lemar', 'Midfielder', 'France', '1995-11-12', 206302),
(201622, 'Jose', 'Gimenez', 'Defender', 'Uruguay', '1995-01-20', 206302),
(201623, 'Marcos', 'Llorente', 'Midfielder', 'Spain', '1995-01-30', 206302),
(201624, 'Stefan', 'Savic', 'Defender', 'Montenegro', '1991-01-08', 206302),
(201625, 'Kieran', 'Trippier', 'Defender', 'England', '1990-09-19', 206302),
(201626, 'Yannick', 'Carrasco', 'Midfielder', 'Belgium', '1993-09-04', 206302),
(201627, 'Felipe', 'Monteiro', 'Defender', 'Brazil', '1989-05-16', 206302),
(201628, 'Renan', 'Lodi', 'Defender', 'Brazil', '1998-04-08', 206302),
(201629, 'Hector', 'Herrera', 'Midfielder', 'Mexico', '1990-04-19', 206302),
(201630, 'Lucas', 'Torreira', 'Midfielder', 'Uruguay', '1996-02-11', 206302);

10
-- creating table Red Bull Salzburg to record Red Bull Salzburg Players information --

create table rb_salzburg(


p_id int,
first_name varchar(20),
last_name varchar(20) unique,
nominal_position varchar(20),
nationality varchar(20),
date_of_birth date,
fc_id int,
primary key (p_id),
foreign key (fc_id) references GroupA (fc_id));

insert into rb_salzburg values


(201631,'Cican', 'Stankovic', 'Goalkeeper', 'Austria', '1992-11-04', 206303),
(201632,'Albert', 'Vallci', 'Defender', 'Austria', '1995-07-02', 206303),
(201633,'Andreas', 'Ulmer', 'Defender', 'Austria', '1985-10-30', 206303),
(201634,'Zlatko', 'Junuzovic', 'Midfielder', 'Austria', '1987-09-26', 206303),
(201635,'Mohammad', 'Camara', 'Midfielder', 'Mali', '2000-01-06', 206303),
(201636,'Sekou', 'Koita', 'Forward', 'Mali', '1999-11-28', 206303),
(201637,'Mergim', 'Berisha', 'Forward', 'Germany', '1998-05-11', 206303),
(201638,'Masaya', 'Okugawa', 'Midfielder', 'Japan', '1996-04-14', 206303),
(201639,'Noah', 'Okafor', 'Midfielder', 'Switzerland', '2000-05-24', 206303),
(201640,'Andre', 'Silva', 'Defender', 'Brazil', '1992-02-16', 206303),
(201641,'Maximillian', 'Wober', 'Defender', 'Austria', '1998-02-04', 206303),
(201642,'Enock', 'Mwepu', 'Midfielder', 'Zambia', '1998-01-01', 206303),
(201643,'Dominik', 'Szoboszlai', 'Midfielder', 'Hungary', '2000-10-25', 206303),
(201644,'Patson','Daka','Forward','Zambia','1998-10-09',206303),
(201645,'Rasmus','Kristensen','Defender','Denmark','1997-07-11',206303);

11
-- creating table Locomotiv Moscow to record Locomotiv Moscow Players information --

create table locomotiv_moscow(


p_id int,
first_name varchar(20),
last_name varchar(20) unique,
nominal_position varchar(20),
nationality varchar(20),
date_of_birth date,
fc_id int,
primary key (p_id),
foreign key (fc_id) references GroupA (fc_id));

insert into locomotiv_moscow values


(201646,'Guilherme','Marinato','Goalkeeper','Russia','1985-12-12',206304),
(201647,'Dmitri','Zhivoglyadov','Defender','Russia','1994-05-29',206304),
(201648,'Murilo','Cerqueira','Defender','Brazil','1997-03-27',206304),
(201649,'Verdan','Corluka','Defender','Croatia','1986-02-05',206304),
(201650,'Maciej','Rybus','Defender','Poland','1989-08-19',206304),
(201651,'Rifat','Zhemaletdinov','Midfielder','Russia','1996-09-20',206304),
(201652,'Grzegorv','Krychowiak','Midfielder','Poland','1990-01-29',206304),
(201653,'Daniil','Kulikov','Midfielder','Russia','1998-06-24',206304),
(201654,'Anton','Miranchuk','Midfielder','Russia','1995-10-17',206304),
(201655,'Fyodor','Smolov','Forward','Russia','1990-02-09',206304),
(201656,'Ederzito','Lopes','Forward','Portugal','1987-12-22',206304),
(201657,'Vitaly','Lisakovich','Forward','Belarus','1998-02-08',206304),
(201658,'Dmitri','Rybchinsky','Midfielder','Russia','1998-08-19',206304),
(201659,'Francois','Kamano','Forward','Guinea','1996-05-02',206304),
(201660,'Vladislav','Ignatyev','Defender','Russia','1987-01-20',206304);

12
-- creating table bm_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --

create table bm_player_performance(


p_id int,
goals int,
assist int,
penalty_cards varchar(10),
foreign key (p_id) references bayern_munich (p_id));

insert into bm_player_performance values


(201601,0,0,1),
(201602,1,0,0),
(201603,0,2,1),
(201604,1,4,2),
(201605,0,1,1),
(201606,0,2,0),
(201607,6,0,0),
(201608,4,0,1),
(201609,1,1,2),
(201610,4,0,1),
(201611,3,2,1),
(201612,1,0,2),
(201613,2,2,1),
(201614,0,0,0),
(201615,2,1,2);

13
-- creating table am_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --

create table am_player_performance(


p_id int,
goals int,
assist int,
penalty_cards varchar(10),
foreign key (p_id) references atletico_madrid (p_id));

insert into am_player_performance values


(201616,0,0,0),
(201617,0,0,2),
(201618,3,0,0),
(201619,0,0,1),
(201620,0,2,0),
(201621,0,1,1),
(201622,1,0,1),
(201623,1,1,2),
(201624,0,0,3),
(201625,0,0,0),
(201626,2,1,0),
(201627,0,0,0),
(201628,0,0,2),
(201629,0,0,1),
(201630,0,0,1);

14
-- creating table rbs_player_performance for the UEFA CHAMPIONS LEAGUE 2020 season --

create table rbs_player_performance(


p_id int,
goals int,
assist int,
penalty_cards varchar(10),
foreign key (p_id) references rb_salzburg (p_id));

insert into rbs_player_performance values


(201631,0,0,1),
(201632,0,0,0),
(201633,0,0,0),
(201634,1,1,0),
(201635,0,0,1),
(201636,0,1,1),
(201637,5,1,0),
(201638,1,0,0),
(201639,0,0,0),
(201640,0,0,1),
(201641,0,0,2),
(201642,0,0,1),
(201643,3,0,1),
(201644,0,1,0),
(201645,0,1,0);

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));

insert into lm_player_performance values


(201646,0,0,0),
(201647,0,1,1),
(201648,0,0,3),
(201649,0,0,1),
(201650,0,0,0),
(201651,0,1,2),
(201652,0,0,1),
(201653,0,0,1),
(201654,3,0,0),
(201655,1,0,0),
(201656,0,1,1),
(201657,0,0,0),
(201658,0,0,0),
(201659,0,0,0),
(201660,0,0,2);

-- data retrieving queries --

-- 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';

-- 2. List FC Atletico Madrid match details as an away team

Select a.match_date, a.score


from match_table a
join groupa b
on a.away_team_id=b.fc_id
where b.fc_name='atletico_madrid';

-- 3. List the match dates played in Salzburg

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

Select a.match_date, b.stadium_name, b.capacity, b.surface_type


from match_table a
join stadium b
on a.s_id=b.s_id
where b.city='munich' or b.city='moscow';

17
-- 5. List all the matches played with respective referee name

Select a.match_date, a.score, b.r_name


from match_table a
join referee b
on a.r_id=b.r_id;

-- 6. List match details of FC Atletico Madrid with respective stadium & referee information

Select a.match_date, a.score, c.stadium_name, d.r_name


from match_table a
join groupa b
on a.home_team_id=b.fc_id or a.away_team_id=b.fc_id
join stadium c
on a.s_id=c.s_id
join referee d
on a.r_id=d.r_id
where b.fc_name='atletico_madrid';

18
-- 7. List all the match details with french referee

Select a.match_date, a.score, b.r_name


from match_table a
join referee b
on a.r_id=b.r_id
where b.nationality='France';

-- 8. List the match details played in natural grass

Select a.match_date, a.score


from match_table a
join stadium b
on a.s_id=b.s_id
where b.surface_type='natural_grass';

-- 9. List all the match details where spectators were more than 50000

Select a.match_date, a.score


from match_table a
join stadium b
on a.s_id=b.s_id
where b.capacity>50000;

-- 10. List all players of FC Bayern Munich who got at least 1 penalty card

Select a.first_name, a.last_name


from bayern_munich a
join bm_player_performance b
on a.p_id=b.p_id
where b.penalty_cards>0;
19
-- 11. List all players of FC Atletico Madrid who did at least 1 goal

Select a.first_name, a.last_name


from atletico_madrid a
join am_player_performance b
on a.p_id=b.p_id
where b.goals>0;

-- 12. List all players of FC Red Bull Salzburg who got at least 1 assist

Select a.first_name, a.last_name


from rb_salzburg a
join rbs_player_performance b
on a.p_id=b.p_id
where b.assist>0;

-- 13. List defeneders who got at least 1 penalty card of FC Locomotiv Moscow

Select a.first_name, a.last_name


from locomotiv_moscow a
20
join lm_player_performance b
on a.p_id=b.p_id
where a.nominal_position='defender' and b.penalty_cards>0;

-- 14. List Midfielder who got at least 1 assist of FC Bayern Munich

Select a.first_name, a.last_name


from bayern_munich a
join bm_player_performance b
on a.p_id=b.p_id
where a.nominal_position='midfielder' and b.assist>0;

-- 15. List forward players who did at least 1 goal of FC Atletico Madrid

Select a.first_name, a.last_name


from atletico_madrid a
join am_player_performance b
on a.p_id=b.p_id
where a.nominal_position='forward' and b.goals>0;

-- sub queries

-- 16. List player jersey names, position on field and their country of FC Red Bull Salzburg

select last_name, nominal_position, nationality


from rb_salzburg
where p_id in (select p_id from rb_salzburg);

21
-- 17. List players of FC Locomotiv Moscow who play as midfielders

select first_name, last_name


from locomotiv_moscow
where p_id in (select p_id from locomotiv_moscow
where nominal_position='midfielder');

-- 18. List players of FC Bayern Munich who belongs to country Germany

select first_name, last_name


from bayern_munich
where p_id in (select p_id from bayern_munich
where nationality='germany');

-- 19. List players of FC Atletico Madrid who are elder than the average of all players

Select first_name, last_name, date_of_birth


from atletico_madrid

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

Select first_name, last_name, date_of_birth


from rb_salzburg
where (year(curdate())-year(date_of_birth))>(Select avg(year(curdate())-year(date_of_birth)) as age
from rb_salzburg);

-- 21. List the match details where FC Locomotiv Moscow was not the away team

select match_date, home_team_id, away_team_id, score


from match_table
where away_team_id not in (select a.away_team_id from match_table a
join groupa b
on a.away_team_id=b.fc_id
where b.fc_name='locomotiv_moscow');

-- 22. List the match details where FC Bayern Munich played in their home ground

select match_date, home_team_id, away_team_id, score


from match_table
where home_team_id in (select a.home_team_id from match_table a
join groupa b
on a.home_team_id=b.fc_id
where b.fc_name='bayern_munich');
23
-- 23. List the player details of FC Atletico Madrid who has scored more than 1 goal

select p_id, first_name, last_name, (year(curdate())-year(date_of_birth)) as Age


from atletico_madrid
where p_id in (select p_id from am_player_performance where goals>1);

-- 24. List the player details of FC Red Bull Salzburg who got assits more than 1

select p_id, first_name, last_name, (year(curdate())-year(date_of_birth)) as Age


from rb_salzburg
where p_id in (select p_id from rbs_player_performance where assist>0);

-- 25. List the player details of FC Locomotiv Moscow who has got more than 1 penalty cards

select p_id, first_name, last_name, (year(curdate())-year(date_of_birth)) as Age


from locomotiv_moscow
where p_id in (select p_id from lm_player_performance where penalty_cards>1);

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

You might also like