· 7 years ago · Oct 20, 2018, 07:14 PM
1create table if not exists clientes(
2id_clie int auto_increment primary key,
3nombre char(30),
4telefono char(20) not null,
5ciudad char(30),
6lcredito double
7);
8
9create table if not exists ventas(
10id_ventas int auto_increment primary key,
11id_cliente int,
12id_prod int,
13cantidad double,
14precio double,
15total double as (cantidad*precio),
16constraint id_cliente_fk foreign key (id_cliente) references clientes (id_clie),
17constraint id_prod_fk foreign key (id_prod) references productos (id_prod)
18);