Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER AS MYSQL SCRIPT. ASLO PLEASE CLEARLY SHOW ER DIAGRAM, ALL TABLES AND PRIMARY AND FOREIGN KEYS. , Read the scenario below carefully and

PLEASE ANSWER AS MYSQL SCRIPT. ASLO PLEASE CLEARLY SHOW ER DIAGRAM, ALL TABLES AND PRIMARY AND FOREIGN KEYS.

,image text in transcribed

Read the scenario below carefully and answer the following questions accordingly. You started to work as a database administrator for UEFA. You are asked to design a database to keep information about European Football Leagues, including countries, leagues, seasons, teams, and players. Each league belongs to only one country, but one country may have many leagues, such as first, second, super, etc. Historically each team has been in many leagues for some period of time, but the current league of each team is only one. Similarly, each player has played for one or many teams, but the current team of each player is only one. For that purpose, you can create two date attributes to save start and end dates. For each past league, you must hold which team was champion. For each player, you must save how much he earned from each played team. 1. Identify the tables in your database together with their attributes. (DOC-20) 2. Identify the primary and foreign keys in your database by listing the attributes involved clearly. Explain your reasons. (DOC-10) 3. Draw your database's entity-relationship (ER) diagram by clearly showing tables, attributes, primary keys, and foreign keys. You can use lucid.app or diagrams.net to draw ER diagrams. (DOC-10) 4. Prepare SQL scripts that will create the tables in your database and their primary and foreign keys. (SQL-10) 5. Add other constraints to your tables and explain why you need these constraints. (SQL-5) 6. Prepare insert statements and insert at least ten records into every table. (SQL-5) 7. Find the team with the most champions in each country. (SQL-4) 8. Find out which teams each player plays for. (SQL-4) 9. Find the total income earned by each player during his career. (SQL-4) 10. Find out how many foreign players (countries of a player and his team are different) currently play in each team. (SQL-4) 11. Find out how many foreign players played for each team in the past. (SQL-4) 12. Find current league of each team. (SQL-4) 13. Find out in which league each team was in the 5 years after January 1, 2000 (You can change this date according to your inserted data.) (SQL-4) 14. Find all players who played in league L1 but never played in team T1 in league L1 (You can change T1 and L1 according to your records). (SQL-4) 15. Find players who played in country C1 and country C2 (You can change C1 and C2 according to your records). (SQL-4) 16. Find teams that have been in league L1 but have never been champions in that league (You can change L1 according to your records). (SQL-4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago