Imagine I want to create a SQLite database of films, where the columns correspond to: title publication year, genre... How would you do it to store a list of actors in the database? Consider that:
- Since the number of actors may vary from film to film, I cannot use one column per actor.
- SQLite does not have a data type that corresponds to a list.
- I want to use, for example
"SELECT filmname FROM table WHERE X"
. Where X would be something that indicates if an actor is present in the film. I would like to be able to use a single or multiple actors on X
The best thing I though is to use a single string, like "actor1_actor2"
, and then apply "WHERE actorname LIKE %actor1"
. But that would allow me to filter films by only one actor.
Thanks!