Está en la página 1de 3

Nombre: Belsy Morales Jarquín

Máquina 48

create database empresa


go
use empresa
go

create table Producto (


Id_fab int not null,
Id_Producto int primary key identity (1,1) not null,
Descripcion_Producto varchar (50) not null,
Precio int not null,
Lim_Credito int not null,
Existencia_Producto int not null,
);

create table Vendedores (


Num_Empleado int primary key identity (1,1) not null,
Nombre_Empleado varchar (50) not null,
Edad_Empleado int not null,
Oficina_Vendedor varchar (50) not null,
titulo_Empleado varchar (50) not null,
Contrato_Empleado date not null,
Director int not null,
cuota int not null,
ventas int not null,
);

create table clientes (


Num_Cliente int primary key identity (1,1) not null,
Empresa varchar (50) not null,
Lim_Cliente int not null,
Num_Empleado int not null, foreign key (Num_Empleado) references Vendedores
(Num_Empleado)
);

create table pedidos (


Num_Pedido int primary key identity (1,1) not null,
Fecha_Pedido date not null,
Num_Cliente int not null, foreign key (Num_Cliente) references clientes
(Num_Cliente),
Num_Empleado int not null, foreign key (Num_Empleado) references Vendedores
(Num_Empleado),
Id_Producto int not null, foreign key (Id_Producto) references Producto
(Id_Producto),
Cantidad int not null,
Importe int not null,
);
select * from Producto
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('4','Vitaflenaco','350','6000','50')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('5','Bronquial','40','10000','400')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('6','Delor','20','15000','90')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('7','Dr Gripa','15','9000','200')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('8','Dolofin','20','4000','60')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('9','AlkaD','15','5000','400')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('10','Tapoo,','20','7500','35')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('1','Amoxicilina','20','5000','100')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('2','Acetaminohphen','10','8000','200')
insert into Producto
(Id_fab,Descripcion_Producto,Precio,Lim_Credito,Existencia_Producto ) values
('3','Aleve','300','3000','400')

select * from Vendedores


insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Juana
Maria','15','Medicamentos','Vendedor ','17/07/25','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Martha
Julia','28','Medicamentos','Vendedor ','10/07/24','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Ramiro
Daniela','33','Medicamentos','Vendedor ','09/08/22','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Daniel
Martinez','27','Medicamentos','Vendedor ','10/07/23','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Jonathan
Soza','20','Medicamentos','Vendedor ','03/07/24','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Francisco
Josefina','45','Medicamentos','Vendedor ','05/07/25','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Pedro
Antonia','20','Medicamentos','Vendedor ','09/07/24','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Camilo
Perez','20','Medicamentos','Vendedor ','25/07/23','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Luis Miguel
angel','30','Medicamentos','Vendedor ','22/07/22','1','400','50')
insert into Vendedores (Nombre_Empleado, Edad_Empleado,Oficina_Vendedor,
titulo_Empleado,Contrato_Empleado,Director,cuota,ventas ) values ('Miguel
Luis','56','Medicamentos','Vendedor ','23/07/22','1','400','50')

select * from clientes


insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
jahir','5000','1')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Maria','6000','2')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Yola','7000','3')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Josefa','9000','4')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Maria','1000','5')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Mario','10000','6')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Jose','5000','7')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Belsy','1000','8')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora Jose
Luis','9000','9')
insert into clientes (Empresa,Lim_Cliente,Num_Empleado) values ('Distribuidora
Marco','2000','10')

insert into pedidos


(Fecha_Pedido,Num_Cliente,Num_Empleado,Id_Producto,Cantidad,Importe) values
('10/08/22')

También podría gustarte