Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase design for dance-event tracklist storing
    primarykey
    data
    text
    <p>I am writing a simple interface in Python for a simple database. The database is a simple database which stores which certain tracks where played at which event and by which artist. The interface in Python isn't yet the problem, though the design of the database is. I've come up with the following thing:</p> <pre><code>--- EVENTS --- CREATE TABLE events ( id INTEGER PRIMARY KEY autoincrement, event_name TEXT NOT NULL, event_date TEXT NOT NULL, &lt;list of tracklist-ids - foreign key?&gt; ); --- TRACKLISTS --- CREATE TABLE tracklists ( id INTEGER PRIMARY KEY autoincrement, artist TEXT NOT NULL, &lt;list of track-ids - foreign key?&gt; ); --- TRACKS --- CREATE TABLE tracks ( id INTEGER PRIMARY KEY autoincrement, trackartist TEXT NOT NULL, trackname TEXT NOT NULL, timesplayed INTEGER NOT NULL, ); </code></pre> <p>It just doesn't feel logical for me, I need way to many operations to get some simple things out of the databases, few examples:</p> <ul> <li><p>Get a list of songs (tracks) played by artist A in the years 2006 till 2009: would require looping through the 'tracklists' table to get every tracklistid of artist A, then look it up in the 'events' table (which is already a pain, how to store a list?)</p></li> <li><p>Lookup which artist played track A most of the times: loop through the whole 'tracklists ' table and get some sort of counter which looks for the trackid of track A</p></li> </ul> <p>It might become a bit confusing because I'm talking about a lot of different things but to me it seems my database can be designed much better or should I use some kind of other approach to tackle this program database-wise? I'm looking for a basic start-off or hints/tips to get this database much more efficient and better. I know that not every lookup can be fast but to me this does not seem very efficient. Also, is there a better way of storing list into a SQL-database without having them to store them into strings?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload