Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Листинг_данных

.docx
Скачиваний:
3
Добавлен:
17.06.2023
Размер:
25.99 Кб
Скачать

Код программы.

create table Dishes ( id int unique not null primary key check(id > 0), name text unique not null, fat_amount_100_gr float not null check(fat_amount_100_gr > 0), protein_amount_100_gr float not null check(protein_amount_100_gr > 0), carbohydrates_amount_100_gr float not null check(carbohydrates_amount_100_gr > 0), weigh_gr int not null check(weigh_gr > 0), kcal_100_gr float not null check(kcal_100_gr > 0) ); create table Products ( id int unique not null primary key check(id > 0), name text unique not null, measure text not null ); create table Dish_Product ( id_dish int references Dishes(id), id_prod int references Products(id), prod_amount float not null ); create table Menu ( id int unique not null primary key check(id > 0), date date unique not null ); create table Menu_cont ( id_menu int references Menu(id), id_dish int references Dishes(id), portion_amount int not null check(portion_amount > 0) ); create table Storage ( id int unique not null primary key check(id > 0), name text unique not null ); create table Storage_prod ( id_storage int references Storage(id), id_prod int references Products(id), prod_amount float not null check(prod_amount > 0) ); create table Waybill ( id int unique not null primary key check(id > 0), date date not null, id_storage int references Storage(id), partner text not null, gen_price float not null check(gen_price > 0) ); create table Waybill_product ( id_waybill int references Waybill(id), id_prod int references Products(id), prod_amount float not null check(prod_amount > 0), price_for_one int not null check(price_for_one > 0), prod_price float not null check(prod_price > 0) );

Соседние файлы в предмете Технологии баз данных