Confused about basic SQL schema table issue -


if person can have hobby many sports wants, , every sports can seen hobby many persons possible, how can create db schema table it?

it's simple many-to-many realtionship:

create table person (     id       integer       primary key,     name     varchar(50)   not null )  create table sport (     id       integer       primary key,     sport    varchar(50)   not null )  create table hobby  (     personid       integer,     sportid        integer,     primary key(personid,sportid),     foreign key(personid) references person(id),     foreign key(sportid) references sport(id), ) 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -