The experiment report can be obtained for free in my upload resources
*"Database Application Development Technology"*
*course report*
Football League Information Management System
Class : Mosaic_______________
Student ID: Mosaic___________
Name : Mosaic_______________
Time: 2020-11-21 _______________
Faculty: Mosaic
Environment: Oracle 11g R2 64-bit, Edraw icon (ER diagram drawing tool)
1. *Explanation* As the most popular sport in the world, football is none other than football. We will develop a football information management system to manage information about teams, players, coaches, venues and games.
*2. Demand analysis* (1) The system maintains information on players, teams, venues, training, referees, etc. Player information: player number, name, height, age, weight, whether to substitute, team number.
Team information: Team number, team name, representative area, establishment time, coach number. (commonly used)
Coach information: Coach ID, name, gender, age.
Site information: site number, site name, site size, site location.
Training information: team number, venue number, training time.
Referee information: referee number, age, name, gender, level.
Game information: game number, game time, group, score, referee number, team number of team A, team number of team B, venue number.
(2) Each team has a head coach and several players.
(3) There is a many-to-many relationship between teams and venues.
(4) Two teams in one game, one referee and one field.
****Three, ER diagram design
*Fourth, database table analysis and design*
PlayerTable
Satisfying the first normal form, each column maintains atomicity and cannot be subdivided. Use the team number as a foreign key, a one-to-many relationship, and put one into many.
playerTable
Field Name | type of data | illustrate |
---|---|---|
pid | Varchar2(5) | PRIMARY KEY |
pname | Varchar2(15) | Does the length need to be larger, the foreigner name is longer >_<.NOT NULL |
height | float | ----- |
weight | float | ----- |
alternate | Char(2) | Check ‘Y’ or ‘N’ |
time | Varchar2(10) | foreign key |
Team Table (teamTable)
Satisfying the first normal form, each column maintains atomicity and cannot be subdivided. The coach number is used as a foreign key because there are many teams and it is convenient.
Field Name | type of data | illustrate |
---|---|---|
time | Varchar2(10) | PRIMARY KEY |
tname | Varchar2(25) | NOT NULL |
tdeputy | Varchar2(20) | ------ |
establish | date | ------ |
cid | Varchar2(10) | foreign key |
CoachTable
Satisfying the first normal form, each column maintains atomicity and cannot be subdivided.
Field Name | type of data | illustrate |
---|---|---|
cid | Varchar2(10) | PRIMARY KEY |
cname | Varchar2(25) | NOT NULL |
sex | Char2 | Check ‘W’ or ‘M’ |
age | number |
Area Table (areaTable)
Satisfying the first normal form, each column maintains atomicity and cannot be subdivided.
Field Name | type of data | illustrate |
---|---|---|
aid | Varchar2(10) | PRIMARY KEY |
aname | Varchar2(25) | ------- |
he left | Varchar2(10) | ------- |
position | Varchar2(20) | ------- |
training table (trainTable)
In the second normal form, each column is associated with the primary key.
Field Name | type of data | illustrate |
---|---|---|
time | Varchar2(10) | foreign key |
aid | Varchar2(10) | foreign key |
Trtime | Date | ---- |
Referee Table (refereeTable)
Satisfying the first normal form, each column maintains atomicity and cannot be subdivided.
Field Name | type of data | illustrate |
---|---|---|
rid | Varchar2(10) | PRIMARY KEY (rid here uses sequence sq1) |
age | number | ----- |
rname | Varchar2(25) | ----- |
sex | Char2 | Check ‘W’ or ‘M’ |
grade | Char2 |
gameTable
Satisfy the third normal form and reduce data redundancy
Field Name | type of data | illustrate |
---|---|---|
guide | Varchar2(10) | PRIMARY KEY |
time | Date | |
group | Varchar2(10) | |
score | Varchar2(5) | |
rid | Varchar2(10) | foreign key |
tidA | Varchar2(10) | foreign key |
tidB | Varchar2(10) | foreign key |
aid | Varchar2(10) | foreign key |
Trigger Table (LogTable)
Field Name | type of data | illustrate |
---|---|---|
pid | Varchar2(10) | ----- |
pname | Varchar2(15) | ----- |
time | Varchar2(10) | ----- |
tname | Varchar2(25) | ----- |
cid | Varchar2(10) | ----- |
cname | Varchar2(25) | ----- |
time | date | ----- |
*Create table:*
The serial number starts from 1001
//Insert data into the coach table
//Insert data into the team table
//Player insert data
//Add data to field
//Add data to training
//Reference table
//Competition table
//Create view
//Use cursor
//procedure
//function
*5. PL/SQL*
*6. Summary*
Problem log:
\1. The constraint name is unique within a user.
\2. The naming of the field name is repeated with the group. I always thought it was a spelling error. I tried it three times, and there was indeed an error here.
3. Date type insert data needs to_date() formatting
4. The number of the team will be repeated, so it can be solved by adding the abbreviation of the team in front of the player ID as a string.
5. The initial design of logTable has no date, how can log have no date?
unction
[External link image dumping...(img-k4x5D05a-1606533880716)]
*5. PL/SQL*
*6. Summary*
Problem log:
\1. The constraint name is unique within a user.
\2. The naming of the field name is repeated with the group. I always thought it was a spelling error. I tried it three times, and there was indeed an error here.
3. Date type insert data needs to_date() formatting
4. The number of the team will be repeated, so it can be solved by adding the abbreviation of the team in front of the player ID as a string.
5. The initial design of logTable has no date, how can log have no date?