Skip to content

Instantly share code, notes, and snippets.

Created September 28, 2012 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5dee7db1088287f7c5a9 to your computer and use it in GitHub Desktop.
Save anonymous/5dee7db1088287f7c5a9 to your computer and use it in GitHub Desktop.
create table users (
id int not null auto_increment primary key,
name varchar(255) not null
);
create table photos (
id int not null auto_increment primary key,
user_id int not null references user (id),
filename varchar(255) not null
);
insert into users (name) values ('cyan'), ('magenta'), ('yellow'), ('black');
insert into photos (user_id, filename) values
(1, 'cat.jpg'),
(1, 'cat2.jpg'),
(2, 'homework.jpg'),
(2, 'window.jpg'),
(2, 'logo.png'),
(3, 'lol.gif');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment