0% found this document useful (0 votes)
36 views1 page

LASAM, Ghenavel Lyne A. Bscs - 2B

The document contains SQL commands to create 6 database tables: teams, coaches, players, parents, and a joining table parents_players. The teams table stores team data, coaches stores coach data and links to teams, players stores player data and links to teams, and parents stores parent data. The parents_players table joins the parents and players tables to link players to their parents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

LASAM, Ghenavel Lyne A. Bscs - 2B

The document contains SQL commands to create 6 database tables: teams, coaches, players, parents, and a joining table parents_players. The teams table stores team data, coaches stores coach data and links to teams, players stores player data and links to teams, and parents stores parent data. The parents_players table joins the parents and players tables to link players to their parents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

LASAM, Ghenavel Lyne A.

BSCS 2B

create table teams (
id int (11) not null auto_increment,
name varchar (255) not null,
color varchar (255) not null,
primary key (id)
);

-------------------------------------------------

create table coaches (
id int (11) not null auto_increment,
fname varchar (255) not null,
lname varchar (255) not null,
phone varchar (255) null,
team_id int (11) not null,
primary key (id),
foreign key (team_id) references teams (id)
);

--------------------------------------------------

create table players (
id int (11) not null auto_increment,
fname varchar (255) not null,
dob date not null,
team_id int (11) not null,
primary key (id),
foreign key (team_id) references teams (id)
);

--------------------------------------------------

create table parents (
id int (11) not null auto_increment,
fname varchar (255) not null,
lname varchar (255) not null,
address varchar (255) not null,
phone varchar (255) null,
primary key (id)
);

--------------------------------------------------

create table parents_players (
parent_id int (11) not null,
player_id int (11) not null,
primary key (parent_id,player_id),
foreign key (parent_id) references parents
(id),
foreign key (player_id) references players
(id)
);

You might also like