Database design

JamalJamal Posts: 2,115
edited January 2007 in Technical Stuff and Help
I'm creating a database in SQL (MySQL) for a rado station's website and I kind of got myself stuck in the design phase ... :o

I am struggling wether I ought to make 2 tables (programs and daysoftheweek) or if it would be better with 3 tables (one extra to link the programs to the days)....
I hope it's clear enough :o
Surf little waves big... Charge big waves hard

- Antwerp '06, Nijmegen '07, Werchter '07
Post edited by Unknown User on

Comments

  • AhnimusAhnimus Posts: 10,560
    My suggestion is to make it as diverse as you can.

    The company I work for started off by spending 10 years just building the database and filling it with as much information as possible. Now we are the largest in the industry. The manufacturers use us because we have the most flexible and diversified database.
    I necessarily have the passion for writing this, and you have the passion for condemning me; both of us are equally fools, equally the toys of destiny. Your nature is to do harm, mine is to love truth, and to make it public in spite of you. - Voltaire
  • JamalJamal Posts: 2,115
    Ahnimus wrote:
    My suggestion is to make it as diverse as you can.

    The company I work for started off by spending 10 years just building the database and filling it with as much information as possible. Now we are the largest in the industry. The manufacturers use us because we have the most flexible and diversified database.
    yeah, diversity is key...

    but it's a short-term project that will not be expanded in the future. Therefore I just want it to be light-weight and efficient, yet versatile.
    Surf little waves big... Charge big waves hard

    - Antwerp '06, Nijmegen '07, Werchter '07
  • AhnimusAhnimus Posts: 10,560
    Jamal wrote:
    yeah, diversity is key...

    but it's a short-term project that will not be expanded in the future. Therefore I just want it to be light-weight and efficient, yet versatile.

    Well, I'm not a huge DB expert, but I don't think one extra table will cause serious latency issues. I always have problems figuring that stuff out myself.
    I necessarily have the passion for writing this, and you have the passion for condemning me; both of us are equally fools, equally the toys of destiny. Your nature is to do harm, mine is to love truth, and to make it public in spite of you. - Voltaire
  • JamalJamal Posts: 2,115
    Ahnimus wrote:
    Well, I'm not a huge DB expert, but I don't think one extra table will cause serious latency issues. I always have problems figuring that stuff out myself.
    I think I'll take the extra table then
    I don't expect too many entries anyways, so ...

    thanks :)
    Surf little waves big... Charge big waves hard

    - Antwerp '06, Nijmegen '07, Werchter '07
  • JamalJamal Posts: 2,115
    *edit*
    this is what I came up with
    # fotofactory DATABASE
    # Jimmy Symoens 2 ICT 1
    # 2006-2007
    
    create database radio;
    use radio;
    
    # tabel staffs aanmaken
    create table staff (
      staff_id int(10) NOT NULL auto_increment,
      login varchar(20) NOT NULL default '',
      pw varchar(20) NOT NULL default '',
      naam varchar(50) NOT NULL,
      job varchar(255),
      email varchar(255) NOT NULL default '',
      photo_url varchar(255),
      primary key(staff_id)
    ) engine='innodb';
    
    # tabel shows aanmaken
    create table shows (
      show_id int(10) NOT NULL auto_increment,
      name varchar(20) NOT NULL default '',
      show_email varchar(255) NOT NULL default '',
      descr mediumtext,
      primary key(show_id)
    ) engine='innodb';
    
    # tabel episodes aanmaken
    create table episodes (
      episode_id int(10) NOT NULL auto_increment,
      show_id int(10) NOT NULL,
      staff_id int(10),
      foreign key(show_id) references shows(show_id),
      foreign key(staff_id) references staff(staff_id),
      primary key(episode_id)
    ) engine='innodb';
    
    # tabel program aanmaken
    create table program (
      day ENUM ('monday','tuesday','wednesday','thursday','friday','saturday','sunday'),
      begin varchar(5),
      end varchar(5),
      episode_id int(10),
      foreign key(episode_id) references episodes(episode_id),
      primary key(day, begin)
    ) engine='innodb';
    
    
    Surf little waves big... Charge big waves hard

    - Antwerp '06, Nijmegen '07, Werchter '07
  • JamalJamal Posts: 2,115
    Anyone really good in php? :o
    Surf little waves big... Charge big waves hard

    - Antwerp '06, Nijmegen '07, Werchter '07
  • Im not really good at it but i know some...what you trying to know?
  • JamalJamal Posts: 2,115
    Im not really good at it but i know some...what you trying to know?
    How I can use a class to make the conversation with my database object-oriented :o
    *edit*
    and a class for making xml podcasts automatically... :)
    Surf little waves big... Charge big waves hard

    - Antwerp '06, Nijmegen '07, Werchter '07
Sign In or Register to comment.