create table `customer` ( id_customer int auto_increment, customer_name varchar(255) not null, constraint customer_pk primary key (id_customer) ); create table `orders` ( id_order int auto_increment, order_nr int not null, fk_customer int not null, constraint order_pk primary key (id_order), constraint order_customer_id_customer_fk foreign key (fk_customer) references customer (id_customer) ); #customer insert into `customer`(id_customer, customer_name) values (1, 'John Doe'), (2, 'Sarah Doe'), (3, 'Frank Doe'); insert into `orders`(id_order, order_nr, fk_customer) values (1, 123456, 1), (2, 123457, 1), (3, 123458, 2);