Artists Table

The artists table stores the information of all artists in the system. It contains only four columns (see Figure 2-12):

• id: Artist ID and table primary key

• artist_name: Artist's name

• genre: Associated genre for the artist

• created_date: Timestamp for when the entry was created

Figure 2-12. Artists table

There are also a few restrictions on the table. For starters, the artist_name and genre columns can't be empty, and there can be only one combination of artist name to artist genre. This will limit the possibility that an artist and genre combination is entered twice. There are a few flaws in this example, but I'm trying to keep it simple. For example, a user can enter a local artist in Los Angeles called "The Puffy Puffs Puffs" in the rock genre, and another user can enter the same artist name and the same genre for a completely different artist in Ohio. Given the restrictions, the artist in Ohio will not be saved, and the user will receive information from the artist in Los Angeles.

Was this article helpful?

0 0

Post a comment