SQL Çoklu Tablolar ve LookUp Tablo

0 Cevap php

Ben bu yanıtları için çevresinde arama denedim ama hala biraz kayıp değilim.

I have a site using PHP/SQL to store details about music tracks. I want to search/add/edit/delete tracktitle, album, composer, bpm, timesignature, duration, instrumentation, genre, keywords (description). I have so far done a test version with just three tables and a lookup table (track, composer, album) which seems to work okay with searching.

table 'track' (id, tracktitle) table 'composer' (id, composername) table 'album' (id, albumtitle) table 'albumtrack (track.id, composer.id, album.id)

Ancak yeni bir parça ekleyerek ve bir besteci ve albüm atarken sağ Ekle biraz olsun gibi olamaz. TRACKTITLE parça tabloya yolunda gider, ama nasıl albumtrack arama tablosunda bağlamak yok.

Burada bazı ekstra bit ihtiyacım var mı?

  $sql = "INSERT INTO track SET
  track.tracktitle='$tracktitle' ";

Ayrıca ... Ben her bit (bpm tablo, süre masa, tarz tablo) tabloları kullanılarak bu konuda doğru yolu gidiyorum?

A track may have more than one duration (different edits), bpms, time signature so a lot of data will be shared. I also want the user to be able to search on a range of durations or bpm's, eg tracks between 2 and 3 minutes.

Benim test versiyonu üzerinde genişletmek için önce ben bu en iyi şekilde yapıyorum olup olmadığı gibi bazı tavsiyeler gerekir.

Teşekkürler

0 Cevap