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

Top Page

Reply to this message
Author: Damian Brasher
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] [OT] BaB Soton Uni register MySQL script
Damian Brasher wrote:

>
> DROP TABLE IF EXISTS attendee;
> CREATE TABLE attendee (
>         id              INT NOT NULL AUTO_INCREMENT,


But this is better...

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 (
        id             INT NOT NULL,
        mac             VARCHAR(50) NOT NULL,
                        PRIMARY KEY (mac),
                        FOREIGN KEY (id) REFERENCES attendee (id)
) COMMENT "MAC Address entries";



--
http://www.diap.org.uk - distributed backup volume management system.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.