Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GreyHat147/1b8f3637549dcd934947ba7147fd7bc9 to your computer and use it in GitHub Desktop.
Save GreyHat147/1b8f3637549dcd934947ba7147fd7bc9 to your computer and use it in GitHub Desktop.
Taller 3
create database taller;
create table producto(
codigoProducto int(11),
nombre varchar(100),
precio decimal(18, 2)
);
create table venta(
codigoVenta int(11),
cliente varchar(100),
fecha datetime
);
create table detalleventa(
codigoVenta int(11),
codigoProducto int(11),
cantidad decimal(18, 2),
descuento decimal(18, 2),
foreign key(codigoProducto) references producto(codigoProducto),
foreign key(codigoVenta) references producto(codigoVenta)
);
create index idxCodProd on detalleventa(codigoProducto);
create index idxCodVent on detalleventa(codigoVenta);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment