· 7 years ago · Mar 04, 2019, 03:28 PM
1create table if not exists Producto
2(
3id_producto int not null primary key auto_increment,
4nombre varchar(30) not null,
5categoria varchar(40) not null,
6precio float not null default '0',
7stock int(30) not null default '0',
8estado varchar(10) not null
9);
10
11create table if not exists Devolucion
12(
13id_devolucion int not null primary key auto_increment,
14nombre varchar(30) not null,
15cantidad varchar(30) not null default '0',
16precio float not null default '0',
17detdev varchar(30) not null
18);
19
20ALTER TABLE Devolucion add foreign key (id_devolucion) references Producto (id_producto);