пример:CREATE TABLE usr (
usr_id INT AUTO_INCREMENT NOT NULL,
first VARCHAR(25) NOT NULL,
surname VARCHAR(50) NOT NULL,
PRIMARY KEY(usr_id)
);
CREATE TABLE product (
prod_id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(40) NOT NULL,
descr VARCHAR(255) NOT NULL,
PRIMARY KEY(prod_id)
);
CREATE TABLE invoice (
inv_id INT AUTO_INCREMENT NOT NULL,
usr_id INT NOT NULL,
prod_id INT NOT NULL,
quantity INT NOT NULL,
PRIMARY KEY(inv_id),
FOREIGN KEY (usr_id) REFERENCES usr(usr_id),
FOREIGN KEY (prod_id) REFERENCES product(prod_id)
);