Question

In: Computer Science

Case: A national football association needs to design a database to store information about all the...

Case:
A national football association needs to design a database to store information about all the players (identified by pid, with DOB, position and salary as attributes) registered under it, all the football clubs (identified by name, with city and asset as attributes) in the nation, and the stakeholders of each club (with name, age and percentage of holdings). Each player plays for one club, and each club has a captain player. Each stakeholder can only hold the shares of one club, and can be identified by name, given that his club is known.
Tasks:
1. Draw an ER diagram that captures this information.
2. Write SQL statements to create the corresponding relations and capture as many of the constraints as possible.
For any additional and reasonable assumptions made, please state clearly.

Solutions

Expert Solution

CREATE TABLE Player
(
Pid int NOT NULL ,
Date_of_Birth date NOT NULL ,
Position varchar(50) NOT NULL ,
Salary numeric(18,0) NOT NULL ,
Club varchar(50) NOT NULL ,
PRIMARY KEY(Pid),
FOREIGN KEY (Club) REFERENCES Football_Club(Name)
);

CREATE TABLE Football_Club
(
Name varchar(50) NOT NULL ,
City varchar(50) NOT NULL ,
Asset decimal(15,3) NOT NULL ,
Captain int Unique,
PRIMARY KEY(NAME),
FOREIGN KEY (Captain) REFERENCES Player(Pid)
);
CREATE TABLE Stakeholder
(
Name varchar(50) NOT NULL ,
Age numeric(5,0) NOT NULL ,
Percentage_Holding decimal(5,2) NOT NULL ,
Club_Owned varchar(50) NOT NULL ,
PRIMARY KEY(NAME,Club_Owned),
FOREIGN KEY (Club_Owned) REFERENCES Football_Club(Name),
CHECK (Percentage_Holding>0 AND Percentage_Holding<=100)
);


Related Solutions

A company database needs to store information about employees (identified by ssn, with salary and phone...
A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departments (identified by dno, with dname and budget as attributes), and children of employees (with name, age, and relationship to the employee as attributes). Employees work in departments; each department is managed by an employee; a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. We...
Assume you are creating a database for IS paint store. The database needs to support the...
Assume you are creating a database for IS paint store. The database needs to support the following business functions. • Allow customers to browse the inventory. Customers want to search by paint types and colors. Customers also wants to know pricing information. • A customer can be a regular customer (e.g., home owner), or a contractor or painting professionals. Different customers can get different discounts for the same type of paint. We assume each customer can get the same discount...
Database design of cothing Online Shopping System. Schema represents minimal information required to store information of...
Database design of cothing Online Shopping System. Schema represents minimal information required to store information of a shop and products to sell. Cart information can be stored in session or if wish-list / watchlist is needed, the schema can be simply extended. Enjoy. SQL and methodology.
What is important aspect about REA modeling for Accounting Information Systems database design?
What is important aspect about REA modeling for Accounting Information Systems database design?
design a relational database to cater for the needs of the new bookshop owner as described...
design a relational database to cater for the needs of the new bookshop owner as described in the first question giving examples of tables, attributes, primary and foreign keys. you may assume that suppliers' orders contain more than one line
PROBLEM1. The Football Bowl Subdivision (FBS) level of the National Collegiate Athletic Association (NCAA) consists of...
PROBLEM1. The Football Bowl Subdivision (FBS) level of the National Collegiate Athletic Association (NCAA) consists of over 100 schools. Most of these schools belong to one of several conferences, or collections of schools, that compete with each other on a regular basis in collegiate sports. Suppose the NCAA has commissioned a study that will propose the formation of conferences based on the similarities of the constituent schools. The file FBS contains data on schools belong to the Football Bowl Subdivision...
National Artists Association (NAA) maintains a small database to track painters, paintings, and galleries. A painting...
National Artists Association (NAA) maintains a small database to track painters, paintings, and galleries. A painting is created by a particular artist and then exhibited in a particular gallery. A gallery can exhibit many paintings, but each painting can be exhibited in only one gallery. Similarly, a painting is created by a single painter, but each painter can create many paintings. Create a database implementation of the statements above using SQL.
A database needs to be developed that supports a supermarket. (i) Design an entity-relationship diagram that...
A database needs to be developed that supports a supermarket. (i) Design an entity-relationship diagram that captures, as far as possible, the requirements stated below. (Statements in brackets are additional explanations and not part of the requirements proper.) If you make any assumptions in your design, please write them down. Assumptions, however, must not contradict the requirements. 1. The supermarket sells products. Each product is uniquely identified by its product number. Moreover, a product has price. The supermarket also records...
The Football Bowl Subdivision (FBS) level of the National Collegiate Athletic Association (NCAA) consists of over 100 schools.
  The Football Bowl Subdivision (FBS) level of the National Collegiate Athletic Association (NCAA) consists of over 100 schools. Most of these schools belong to one of several conferences, or collections of schools, that compete with each other on a regular basis in collegiate sports. Suppose the NCAA has commissioned a study that will propose the formation of conferences based on the similarities of the constituent schools. The file FBS contains data on schools belong to the Football Bowl Subdivision...
Consider a database containing information about all the car accidents between 1997 and 2005, including the...
Consider a database containing information about all the car accidents between 1997 and 2005, including the cars involved and their owners. The database has the following tables: Car (license, year, make, model); Accident (license, accident date, damage_amount zipcode); Owner (SSN, license, name, address, zipcode); // zipcode in Accident is the place where accident took place // assume that the same car does not get into an accident twice in a day // assume each owner has only one licensed car...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT