File: create2.sql

package info (click to toggle)
libsql-translator-perl 0.11011-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,380 kB
  • sloc: perl: 251,748; sql: 3,805; xml: 233; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
create table person (
  person_id INTEGER PRIMARY KEY AUTO_INCREMENT,
  name varchar(20) not null,
  age integer default '18',
  weight double(11,2),
  iq int default '0',
  is_rock_star tinyint default '1',
  physical_description text,
  UNIQUE KEY UC_person_id (person_id),
  UNIQUE KEY UC_age_name (age, name)
) ENGINE=InnoDB;

create unique index unique_name on person (name);

create table employee (
	position varchar(50),
	employee_id INTEGER,
	CONSTRAINT FK5302D47D93FE702E_diff FOREIGN KEY (employee_id) REFERENCES person (person_id),
	PRIMARY KEY  (employee_id, position)
) ENGINE=InnoDB;

create table added (
  id integer
);