I have this table:
create table teams (team char(1) primary key, players text);
insert into teams('A', 'Jhon');
insert into teams('B', 'Mark');
Now, how do I add the player 'Carl' in team 'A'?
The column 'players' maybe like a list?
I have this table:
create table teams (team char(1) primary key, players text);
insert into teams('A', 'Jhon');
insert into teams('B', 'Mark');
Now, how do I add the player 'Carl' in team 'A'?
The column 'players' maybe like a list?
You would do:
insert into teams('A', 'Carl');
after you remove the primary key constraint.
Actually, what you really want is:
create table TeamPlayers (
TeamPlayerId int auto_increment,
team char(1),
players text
);
Then you do the inserts that you want. This is a junction table (sort of). It suggests that you also want a Teams table with one row per team and a Players table with one row per player. Depending on the application, those tables may not be necessary.