Commit | Line | Data |
fb3e4caf |
1 | create table person ( |
2 | person_id INTEGER PRIMARY KEY AUTO_INCREMENT, |
3 | name varchar(20) not null, |
4 | age integer default '18', |
5 | weight double(11,2), |
6 | iq int default '0', |
7 | is_rock_star tinyint default '1', |
8 | description text, |
9 | UNIQUE KEY UC_person_id (person_id) |
10 | ) ENGINE=InnoDB; |
11 | |
d990d84b |
12 | create unique index unique_name on person (name); |
9ae898b9 |
13 | |
14 | create table employee ( |
15 | position varchar(50), |
16 | employee_id INTEGER, |
6a0f3000 |
17 | CONSTRAINT FK5302D47D93FE702E_diff FOREIGN KEY (employee_id) REFERENCES person (person_id), |
18 | PRIMARY KEY (employee_id, position) |
9ae898b9 |
19 | ) ENGINE=InnoDB; |