/** * hw3.sql * Author: Meg Richards (merichar@andrew.cmu.edu) * Created: 5 February 2008 * * Generates an database for the link bboard assignment. */ drop database if exists hw3_development; create database hw3_development; use hw3_development; create table links ( id int not null auto_increment, url varchar(100) null, comment varchar(100) null, user_id int null default 0, constraint fk_links_users foreign key (user_id) references users(id), primary key (id) ); create table users ( id int not null auto_increment, username varchar(100) null, hashed_password varchar(255) null, salt varchar(255) null, primary key (id) ); insert into links (url, comment, user_id) values ("http://www.xkcd.com", "Geeky stick figures!", "1"); insert into users (username) values ("merichar");