lunes, 16 de mayo de 2011

Create table compra (
idCompra numeric,
fechaCompra date,
constraint compra_pk primary key (idCompra)
enable)

create table producto (
idProducto numeric,
nombreProducto varchar(30),
stockActual numeric,
constraint producto_pk primary key (idProducto)
enable)

create table DetalleCompra(
IdCompra numeric ,
IdProducto numeric,
Cantidad numeric,
CONSTRAINT fk_detalle FOREIGN KEY (idCompra)
REFERENCES compra(idCompra),
CONSTRAINT fk_detalle2 FOREIGN KEY (idProducto)
REFERENCES producto(idProducto)
);

No hay comentarios.:

Publicar un comentario