Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Скрипт создания и заполнения к тестовому от mindbox
- create table product
- (
- product_id int primary key GENERATED BY DEFAULT AS IDENTITY,
- name varchar(100)
- );
- create table category
- (
- category_id int primary key GENERATED BY DEFAULT AS IDENTITY,
- name varchar(100)
- );
- create table product_and_category
- (
- product_id int,
- category_id int,
- foreign key (product_id) references product(product_id),
- foreign key (category_id) references category(category_id)
- );
- insert into product (name) values
- ('сыр'), ('молока'), ('кефир'), ('йогурт'), ('говядина'), ('свинина'), ('хлеб'), ('пирожное-картошка'), ('конфеты'), ('сладкий рулет'), ('Нечто');
- insert into category (name) values
- ('молочка'), ('мясо'), ('сладости'), ('хлебобулочные изделия')
- insert into product_and_category (product_id, category_id) values
- (1, 1),
- (2, 1),
- (3, 1),
- (4, 1),
- (5, 2),
- (6, 2),
- (7, 4),
- (8, 3),
- (8, 4),
- (9, 3),
- (10, 3),
- (10, 4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement