0
votes

For my homework, we need to create a sql database model on paper, but I'm stuck at the following subject:

We have different people, with some data assigned to them:

Person table:

  • person_id (Primary key)
  • person_name
  • person_number
  • .....

Now we have to create a talent table, for every person has some kind of talent (IT, Art, singing, ...) and it has to be linked somehow. The catch here is that a person can have multiple talents(IT and art together).

What's the best way to create this relationship between those 2 tables?

1

1 Answers

1
votes

Create another table person_talent with

person_id
talent_id

Talent_table

1 talent_id talent_name
2 talent_id talent_name
3
4
.........

Person_table

person_id
...........

whenever person adds new talent insert talent_id and person_id into talent_person table and delete the record whenever person removes that talent.

Hope it helps