Você está na página 1de 1

CREATE DATABASE Almacen

create table Producto


(
idproducto int identity (1,1)primary key,
nombre varchar(20),
precioU decimal(20,2),
precioM decimal(20,2),
Stock int,
unidadM varchar(20)
)
GO
CREATE TABLE Remision
(
IDRemision int identity (1,1)primary key,
idFactura int,
idProducto int,
cantidad decimal(20,2)
)
alter table Remision add foreign key (idProducto) references Producto
TAREA
CREAR UN SP QUE AUMENTE O RESTE DE PRODUCTO DADO (STOCK +-)
LA CANTIDAD Y ID PRODUCTO SPstock (@Cant,idProd)
hacer lo mismo en forma de funcion
integer fnSTOCK(@Cant,@IdProd)

Você também pode gostar