Table "public.printers"
Column | Type | Collation | Nullable | Default
---------------+-----------------------+-----------+----------+---------
id | integer | | not null |
printer | character varying(45) | | |
id_work | integer | | |
Indexes:
"printers_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
"id_work" FOREIGN KEY (id_work) REFERENCES type_work(id_work) NOT VALID
Referenced by:
TABLE "printers" CONSTRAINT "id_work" FOREIGN KEY (id_work) REFERENCES typ
e_work(id_work) NOT VALID
1 "Принтер ч/б" 1
2 "Принтер цвет" 2
3 "Принтер ч/б и цвет" 3
Table "public.material"
Column | Type | Collation | Nullable | Default
----------+-----------------------+-----------+----------+---------
id | integer | | not null |
material | character varying(30) | | |
Indexes:
"material_pkey" PRIMARY KEY, btree (id)
1 "610*175m"
2 "610*50m"
3 "914*175m"
4 "914*50m"
5 "A3"
6 "A4"
7 "A3color"
8 "A4color"
CREATE TABLE printer_material (
printer_id integer REFERENCES printers (id),
material_id integer REFERENCES material (id),
PRIMARY KEY (printer_id, material_id)
);
INSERT INTO printer_material (printer_id, material_id)
VALUES
(1, 1),
(2, 1),
(2, 2),
(3, 1),
(3, 2),
(3, 3);