问题背景:
2.1 The application domain for the component data sources
Envisage the situation where there are three Athletics clubs, each having a different emphasis
on various aspects of the sport of athletics. For one club, track events are the focus of attention
while for another, the field events are of particular importance. The third club takes a more
balanced view of the track and field components of Athletics. The databases used by each club
reflect the different interests of each club: however, as a requirement of a new funding initiative
the clubs need to present a unified view of the data collected for all athletes in the region.
During this project you are to model each of the three different data sources used by the individual
athletics clubs and, to allow the clubs to qualify for the new source of funding, you are
to also integrate these data sources to provide the unified data view of all athletes in the region
covered by the clubs.
问题描述:
In general terms, an athletics championship will have the following entities and relationships:
Athletes who may participate in an arbitrary number of competitions. An athlete is described
by his or her first and last name, address, his or her coaches (may be a number, e.g. for
fitness, tactics, style, etc.) and the competitions in which they compete.
Competitions which can be classified into classes (like running disciplines, throwing, jumping,
etc.). For each competition, a list of competitors and the results list are to be maintained.
While most disciplines are only for individuals there may also be disciplines for teams
only (like 100m or 400m relay). Moreover, some disciplines may consist of a number of
sub-disciplines (like decathlon or pentathlon) in which case the results and competitors
for each sub-discipline are to be stored.
Teams each of which represents exactly one club, but a club may have more than one team. For
a team, the name of the team, the constituent members, and the disciplines in which the
members participate are to be stored.• your model/schema needs to be extensible: for example, a complex discipline may consist
of an arbitrary number of sub-disciplines.以上是问题的描述,要求用SQL DDL定义数据库,请大家给点意见如何去定义SQL Statement 用 CREATE TABLE语句,我给出一点我写的语句,希望高手能给出完整的定义,稍候我会贴出我的完整定义。CREATE TABLE Athletes
(
athleteID INT NOT NULL PRIMARY KEY,
firstname VARCHAR(20) NOT NULL,
lastname VARCHAR(20) NOT NULL,
address VARCHAR(20) NOT NULL
);CREATE TABLE Coaches
(
coacheID INT NOT NULL PRIMARY KEY,
lastname VARCHAR(20) NOT NULL,
firstname VARCHAR(20) NOT NULL,
athleteID INT NOT NULL REFERENCES Athletes(athleteID)
);

解决方案 »

  1.   

    为什么不翻译过来呢使用sql的表生成脚本,有完整的定义哦
      

  2.   

    起码有很多对象和关系被你忽视了,仔细阅读问题描述,我发现的有:Athlete(AthleteID,Name,etc…)Competition(CompetitionID,ClassID,CompetitionName,etc…)CompetitionClass(ClassID,ClassName,etc…)AthleteCompetition(AthleteID, CompetitionID)Team(TeamID,TeamName,etc…)Disipline(DisiplineID, DisiplineName,etc…)AthleteDisiplineResult(AthleteID, DisiplineID,result,etc…)TeamDisiplineResult(TeamID, DisiplineID,result,etc…)
      

  3.   

    更正:
    Disipline(DisiplineID,ParentDisiplineID, DisiplineName,etc…) 
    因为有层级关系