CREATE DATABASE homework;

USE homework;

# --------------------------------------------------------
#
# Table structure for table 'anecdotal'
#

CREATE TABLE anecdotal (
   id int(11) DEFAULT '0' NOT NULL auto_increment,
   stid int(11) DEFAULT '0' NOT NULL,
   teacher text NOT NULL,
   date timestamp(14),
   comment text NOT NULL,
   PRIMARY KEY (id)
);


# --------------------------------------------------------
#
# Table structure for table 'staff'
#

CREATE TABLE staff (
   id int(11) DEFAULT '0' NOT NULL auto_increment,
   teacher text NOT NULL,
   username text NOT NULL,
   PRIMARY KEY (id)
);


# --------------------------------------------------------
#
# Table structure for table 'studentid'
#

CREATE TABLE studentid (
   stid int(4) DEFAULT '0' NOT NULL,
   firstname text NOT NULL,
   lastname text NOT NULL,
   advisory text NOT NULL,
   PRIMARY KEY (stid)
);

GRANT SELECT, DELETE, INSERT, UPDATE on homework.* 
   to homework@localhost;

INSERT INTO staff (teacher, username) VALUES ('Teacher', 'teacher');
