· 6 years ago · Oct 30, 2019, 03:58 PM
1CREATE TABLE IF NOT EXISTS clients (`client_id` int not null auto_increment, `name` text, adress int, birthday int, phone int, primary key(`client_id`), index `clients_id_idx` (`client_id` ASC));
2CREATE TABLE IF NOT EXISTS adresses (`adress_id` int not null auto_increment, `adress` text, primary key(`adress_id`), index `adress_id_idx` (`adress_id` ASC), constraint `address_id_constr` foreign key(`adress_id`) references `sqlist18_1_das`.`clients`(`adress`) on delete cascade on update no action);
3CREATE TABLE IF NOT EXISTS phones (id int not null auto_increment, `phones` text, primary key(id), index `phone_id_idx` (`id` ASC), constraint `phone_id_constr` foreign key(`id`) references `sqlist18_1_das`.`clients`(`phone`) on delete cascade on update no action);
4CREATE TABLE IF NOT EXISTS birthdays (id int not null auto_increment, `birthday` text, primary key(id), index `birthday_id_idx` (`id` ASC), constraint `birthday_id_constr` foreign key(`id`) references `sqlist18_1_das`.`clients`(`phone`) on delete cascade on update no action);