· 7 years ago · Feb 16, 2019, 12:26 PM
1CREATE TABLE IF NOT EXISTS `flat` (
2 `number` int(6) unsigned NOT NULL,
3 `count_room` int(5) NOT NULL,
4 `floor` int(3) unsigned NOT NULL,
5 `square` int(10) NOT NULL,
6 PRIMARY KEY (`number`)
7) DEFAULT CHARSET=utf8;
8
9CREATE TABLE IF NOT EXISTS `persons` (
10 `id` int(6) unsigned NOT NULL,
11 `fio` varchar(40) NOT NULL,
12 `flat` int(6) NOT NULL,
13 PRIMARY KEY (`id`)
14) DEFAULT CHARSET=utf8;
15
16
17 INSERT INTO flat (number, count_room, floor, square) VALUES (1, 2, 1, 60);
18 INSERT INTO flat (number, count_room, floor, square) VALUES (2, 3, 2, 80);
19
20 INSERT INTO persons (id, fio, flat) VALUES (1, "PVA", 1);
21 INSERT INTO persons (id, fio, flat) VALUES (2, "MAI", 2);