"Models" for Relational Tables.

  • Thread starter WWGD
  • Start date
  • Tags
    Models
In summary, the number of games that can be played is limited by the number of team entries in the team table and the number of games that can be chosen for each team.
  • #1
WWGD
Science Advisor
Gold Member
6,910
10,291
Hi again, say we are given the relational table:

TEAM(TeamID, TeamName, TeamColor, Game, DatePlayed).

Question is: how many games can we play, meaning, while preserving the properties of relational tables?

This is what I have.We know
We know TeamID, TeamName andTeamColor are fixed in any row , while Game and DatePlayed are variable. All tables will be of this type 1 N1 C1 G_11 D_11

2 N2 C2 G_21 D_21

........

1 N1 C1 G_{1j} D_ {1j}

......

Now, while this is not stated, I would assume either of TeamID, TeamName are candidate keys; two teams
may have the same color. Obviously, we have at least two teams.
 
  • Like
Likes Silicon Waffle
Computer science news on Phys.org
  • #2
I know this doesn't answer your question, but that seems like a very awkward way to organize things. It would be way more reasonable in a relational db to have a team table with one entry per team

team ID, team #, team color

and then have each game in a different table with foreign keys into the team table

game #, play date, team 1 ID, team 2 ID

This is a well organized relational structure and imposes no restrictions on the number of teams or the number of games.
 
  • Like
Likes Silicon Waffle and WWGD
  • #3
Yes, good point, but I am trying to help someone ( for free, or I would have been fired) with some questions from a book.
 
  • #4
Well, I don't really understand the question then. Why would there be any limit on the number of games played? If there is a specific set of teams and each should only play the other once, then that does put a restriction on the number of games, but I see no specification for that or for a specific number of teams, so there's no answer there.
 
  • #5
All I can think is you want to avoid inconsistency: Once a team is selected, the TeamID, TeamName, TeamColor, are determined. But your free to choose a game and a date, so that, e.g., every game played by a fixed team must be played in a fixed date, I think. Maybe we need to use the fact that both TeamID and TeamName are candidate keys, but I am not sure.
 
  • Like
Likes Silicon Waffle

1. What is a model for a relational table?

A model for a relational table is a representation of the structure and relationships of data within a database table. It defines the fields, data types, and constraints for the table and allows for data to be organized and queried in a logical manner.

2. How are models used in relational database design?

Models are used in the initial design phase of a relational database to create a blueprint for organizing data. They help ensure data integrity and consistency, and provide a framework for creating efficient database structures.

3. What are the types of models used for relational tables?

The two main types of models used for relational tables are conceptual models and physical models. Conceptual models focus on the logical structure and relationships of data, while physical models represent the actual implementation of the database.

4. How do models ensure data integrity in relational tables?

Models use data constraints such as primary and foreign keys, data types, and validation rules to ensure data integrity in relational tables. These constraints prevent incorrect or inconsistent data from being entered into the database, ensuring the accuracy and reliability of the data.

5. Can models be modified after the database is created?

Yes, models can be modified after the database is created. However, any changes made to the model may affect the data already stored in the database, so it is important to carefully plan and test any modifications to ensure data integrity is maintained.

Similar threads

  • Electrical Engineering
Replies
32
Views
2K
  • Cosmology
3
Replies
100
Views
5K
Replies
2
Views
892
Replies
2
Views
767
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Electrical Engineering
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Programming and Computer Science
Replies
8
Views
2K
  • Math Proof Training and Practice
2
Replies
38
Views
6K
  • Programming and Computer Science
Replies
6
Views
1K
Back
Top