Re: [Hampshire] [OT] BaB Soton Uni register MySQL script

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: lug, Hampshire LUG Discussion List
Subject: Re: [Hampshire] [OT] BaB Soton Uni register MySQL script
2009/1/13 Damian Brasher <lug@???>:

>
> This works...
>
> CREATE DATABASE bab_register;
>
> USE bab_register;
>
> DROP TABLE IF EXISTS attendee;
> CREATE TABLE attendee (
>        id              INT NOT NULL AUTO_INCREMENT,
>        forename        VARCHAR(50) NOT NULL,
>        surname         VARCHAR(50) NOT NULL,
>        email           VARCHAR(50),
>        member          ENUM('yes','no') NOT NULL,
>        new_attendee    ENUM('yes','no') NOT NULL,
>        mac             VARCHAR(50),
>                        PRIMARY KEY (id),
>                        FOREIGN KEY (mac) REFERENCES macs (mac)
> ) COMMENT "HLUG BaB meeting register Southampton Uni (ECS)";

>
> DROP TABLE IF EXISTS macs;
> CREATE TABLE macs (
>        attendee_id     INT NOT NULL,
>        mac             VARCHAR(50) NOT NULL,
>                        PRIMARY KEY (mac),
>                        FOREIGN KEY (attendee_id) REFERENCES attendee
> (attendee_id)
> ) COMMENT "MAC Address entries";

>
> Damian



Sorry to be a pain, but I see a problem if an attendee wants to
register a second MAC. I'd be inclined to leave the MAC data out of
the attendee table altogether. That's what the macs table is for.