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), )