 USE [VentaUniformes]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
--motivos cancelacion
-- DROP TABLE [INNOVACION].[dbo].[User]
-- SELECT * FROM [INNOVACION].[dbo].[User]
CREATE TABLE [VentaUniformes].[dbo].[User](
	[ID] [int]  IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](125) NULL,
	[Role] [int]  NOT NULL,
	[Password] [nvarchar](256) NULL
PRIMARY KEY ([ID])
)
insert into [VentaUniformes].[dbo].[User]
([UserName], [Role], [Password])
values
('admin', 0, 'admin');
--select * FROM [VentaUniformes].[dbo].[SaleLine]
--DROP TABLE [VentaUniformes].[dbo].[SaleLine]
CREATE TABLE [VentaUniformes].[dbo].[SaleLine](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	
	[SaleId] [int]  NOT NULL,
	[ProductId] [int]  NOT NULL,
	[Amount] [int]  NOT NULL,
	[Price] [float] NULL
PRIMARY KEY ([ID])
)
--ALTER TABLE [VentaUniformes].[dbo].[Sale]
--ADD IsDelete BIT DEFAULT 0; 
-- DROP TABLE [VentaUniformes].[dbo].[Sale]
--DELETE FROM [VentaUniformes].[dbo].[Sale];
--select * from [VentaUniformes].[dbo].[Sale]
-- update [VentaUniformes].[dbo].[Sale] set IsDelete=0
CREATE TABLE [VentaUniformes].[dbo].[Sale](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Curso] [nvarchar](128) NOT NULL,
	[Alumno] [nvarchar](256) NOT NULL,
	[PaymentType]	[int] NOT NULL,
	[Fecha] [date] NOT NULL,
	[Total] [float] NOT NULL,
	IsDelete bit not NULL
PRIMARY KEY ([ID])
)
--DELETE FROM [VentaUniformes].[dbo].[SaleBill];
CREATE TABLE [VentaUniformes].[dbo].[SaleBill](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[DNI] [nvarchar](128) NULL,
	[Name] [nvarchar](256) NULL,
	[SaleId] [int]  NOT NULL
PRIMARY KEY ([ID])
)
-- DROP TABLE [VentaUniformes].[dbo].[Product]
CREATE TABLE [VentaUniformes].[dbo].[Product](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](256) NULL,
	[Description] [nvarchar](256) NULL,
	[Price] [float] NULL
PRIMARY KEY ([ID])
)

insert into [VentaUniformes].[dbo].[Product]
( [Name],[Description], Price)
values
('Producto 1', 'Descripcion 1', 10),
('Producto 2', 'Descripcion 1', 10.3436);

