Sie sind auf Seite 1von 23

Conalep Len II

Colegio de Educacin Profesional Tcnica del Estado de Guanajuato.

Profesional Tcnico Bachiller en Informtica

Programacin de Bases de Datos


Garnica Arista Gustavo Adolfo
Base de Datos Calzado Patris.
Integrantes:
Bueno Avila Edgar Raymundo
Rayas Alemn Jorge Armando de Jess
Jimnez Romero Michelle
Landry Delgado Ricardo Ivn
Ramrez Lozano Fernanda Jacqueline
Len, Gto. a 17 de septiembre de 2013.

INTRODUCCIN
De lo que trata la base de datos es para llevar ms sencillo el control de almacn de una zapatera, al
hacer entrada, salida y cambios de mercanca para que as hacer los cortes sean ms sencillos.
TEMA
CalzadoPatris
ANTECEDENTES Y JUSTIFICACIN

ANTECEDENTES
Nosotros asistimos a la empresa para saber cul era su mayor problema y as sacamos una
conclusin de cmo ayudarlos, al momento de crear un programa que lleve un control ms fcil para
el usuario o para personas que no estn relacionadas con el programa.
JUSTIFICACIN
Este programa es ms que eficaz para una empresa y que se puede aprender a usar ms sencillo, y
satisface a una zapatera que tiene problemas con su almacn.
OBJETIVOS
El objetivo del proyecto es de crear una base de datos que contenga la informacin del tipo de
organizacin que se est realizando
METODOLOGA
La metodologa de esta documentacin de los cdigos de SQL Server 2000
TIPO DE INVESTIGACIN
Los ejercicios en clases ya que con esos ejercicios pude desarrollar este proyecto.
INSTRUMENTOS UTILIZADOS
Lenguaje, Software, Hardware, Humano, Datos.
Lenguaje: Lenguaje de programacin en SQL Data Base
Software: SQL Data Base
Hardware: Un equipo de computacin (pc, laptop, etc.)
Humano: Solo el equipo (empresa), encargado de la empresa.
Datos: los nicos proporcionados de la empresa.

Actividad 1.

Actividad 2. Crear Base de Datos y Capturar Pantalla de Ubicacin.

Actividad 3. Definir Tablas.


Tablas: Proveedores, Producto, Sucursales, Ventas, Pedidos, Empleados, Empleados_Sucursales,
Sucursales_Proveedores, Sucursales_Ventas, Ventas_Producto, Proveedores_Producto,
Proveedores_Pedido.

Actividad 4. Crear Tablas y Capturar Pantalla.


create table Proveedores(
Folio char(5)not null,
Nombre char(20)not null,
Apellidos char(20)not null,
Empresa char(20)not null,
Telefono char(12)not null,
Direccion char(25)not null,
Ubicacion char(15)not null,
Transporte char(12)not null,
Costo char(15)not null,
Pedidos char(2)not null,

primary key (Folio));

select * from Proveedores

create table Producto(


Modelo char(4)not null,
Marca char(10)not null,
Color char (10)not null,
Talla char(5)not null,
Material char(10)not null,
Temporada char(10)not null,
Unidades_Almacenadas char(4)not null,
Precio char(10)not null,
Ubicacion char(10)not null,
Proveedor char(12)not null,
primary key (Modelo));

select * from Producto

create table Sucursales(


Sucursal char(20)not null,
Direccion char(15)not null,
Codigo_Postal char(5)not null,
Telefono char(12)not null,
Gerente char(15)not null,
Empleados char(3)not null,
Ubicacion char(10)not null,
Productos char(3)not null,
Proveedor char(12)not null,
primary key (Sucursal));

select * from Sucursales

create table Ventas(


Ticket char(3)not null,
Modelo char(4)not null,
Cantidad char(4)not null,
Ubicacion char(10)not null,
Fecha_Venta datetime not null,
Tipo_Pago char(10)not null,
Empleado char(12)not null,
Cliente char(20)not null,
Descuento char(3)not null,
Total_Pago char(8)not null,
primary key (Ticket));

select * from Ventas

create table Pedidos(


IdPedido char(3)not null,
Producto char(4)not null,
Cantidad char(4)not null,
Fecha_Pedido datetime not null,
Fecha_Entrega datetime not null,
Mayoreo char(2)not null,
Sucursal char(20)not null,
Lote char(4)not null,
Corrida char(8)not null,
Total_Pago char(12)not null,
primary key (IdPedido));

select * from Pedidos

create table Empleados(


Folio char(3)not null,
Nombre char(12)not null,
Apellidos char(12)not null,
Direccion char(15)not null,
Numero char(7)not null,
Sexo char(9)not null,
Puesto char(10)not null,
Sueldo char(12)not null,
Comision char(4)not null,
Tienda char(12)not null,
Horario char(15)not null,
primary key (Folio));

select * from Empleados

create table Empleados_Sucursales(


Folio char(3)not null,
Sucursal char(20)not null,
nota int not null,
foreign key (Folio) references Empleados(Folio),
foreign key (Sucursal) references Sucursales(Sucursal));

select * from Empleados_Sucursales

create table Sucursales_Proveedores(

Sucursal char(20)not null,


Folio char(5)not null,
nota int not null,
foreign key (Sucursal) references Sucursales(Sucursal),
foreign key (Folio) references Proveedores(Folio));

select * from Sucursales_Proveedores

create table Sucursales_Ventas(


Sucursal char(20)not null,
Ticket char(3)not null,
nota int not null,
foreign key (Sucursal) references Sucursales(Sucursal),
foreign key (Ticket) references Ventas(Ticket));

select * from Sucursales_Ventas

create table Ventas_Producto(


Ticket char(3)not null,
Modelo char(4)not null,
nota int not null,
foreign key (Ticket) references Ventas(Ticket),
foreign key (Modelo) references Producto(Modelo));

select * from Ventas_Producto

create table Proveedores_Producto(


Folio char(5)not null,
Modelo char(4)not null,

nota int not null,


foreign key (Folio) references Proveedores(Folio),
foreign key (Modelo) references Producto(Modelo));

select * from Proveedores_Producto

create table Proveedores_Pedidos(


Folio char(5)not null,
IdPedido char(3)not null,
nota int not null,
foreign key (Folio) references Proveedores(Folio),
foreign key (IdPedido) references Pedidos(IdPedido));

select * from Proveedores_Pedidos

Actividad 5. Agregar Columnas.


Proveedores.
alter table Proveedores add Ciudad char(20)
alter table Proveedores add Codigo_postal char(10)
alter table Proveedores add Director char(30)

Producto.
alter table Producto add Diseador char(30)
alter table Producto add Tipo_calzado char(20)
alter table Producto add Id_pedido char(10)

Sucursales.
alter table Sucursales add Transporte char(10)
alter table Sucursales add Subgerente char(30)
alter table Sucursales add Area_empleado char(20)

Ventas.
alter table Ventas add Existencia char(10)
alter table Ventas add Pago_Meses char(10)
alter table Ventas add Interes char(10)

Pedidos.
alter table Pedidos add Precio_mayoreo char(10)
alter table Pedidos add Precio_menudeo char(10)
alter table Pedidos add Transporte char(10)

Empleados.
alter table Empleados add Producto_comision char(10)
alter table Empleados add Porcentaje_comision char(10)
alter table Empleados add Turno char(10)

Actividad 6. Quitar Columnas.


Proveedores.
alter table Proveedores drop column Ciudad

alter table Proveedores drop column Codigo_postal


alter table Proveedores drop column Director

Producto.
alter table Producto drop column Diseador
alter table Producto drop column Tipo_calzado
alter table Producto drop column Id_pedido

Sucursales.
alter table Sucursales drop column Transporte
alter table Sucursales drop column Subgerente
alter table Sucursales drop column Area_empleado

Ventas.
alter table Ventas drop column Existencia
alter table Ventas drop column Pago_Meses
alter table Ventas drop column Interes

Pedidos.
alter table Pedidos drop column Precio_mayoreo
alter table Pedidos drop column Precio_menudeo
alter table Pedidos drop column Transporte

Empleados.
alter table Empleados drop column Producto_comision
alter table Empleados drop column Porcentaje_comision
alter table Empleados drop column Turno

Actividad 7. Modelo Entidad-Relacin.

Actividad 8. Insertar registros


Proveedores
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00001','Juan','Morales','Court','87846538','Lozano 906','Leon','Terrestre','12,500','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00002','Marcos','Mendez','Pirma Brasil','738765','Ferrocarriles
3','Leon','Terrestre','23,000','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00003','Rosario','Perales','Lobo Solo','65737456','San Miguel
986','Leon','Terrestre','15,876','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)

values ('00004','Luis','Fuentes','Flexi','4783563','Anaya 239','Leon','Terrestre','34,567','3')


insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00005','Isabel','Garcia','Capa de Ozono','82723321','Almiron
345','Leon','Terrestre','34,894','4')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00006','Rodrigo','Sanchez','Sporty Finos','9454653','Fresno
344','Leon','Terrestre','12,500','2')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00007','Samuel','Molina','Karosso','2342837461','Arboledas
342','Leon','Terrestre','11,345','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00008','Jacobo','Canales','Nike','1092834','Losas 906','Leon','Terrestre','18,565','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00009','Sandra','Chavez','Puma','8237434','Lidio 903','Leon','Terrestre','9,875','1')
insert Proveedores
(Folio,Nombre,Apellidos,Empresa,Telefono,Direccion,Ubicacion,Transporte,Costo,Pedidos)
values ('00010','Alejandra','Zarza','Zully','08372342','Marmol 456','Leon','Terrestre','3,400','1')

Producto.
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('3092','Court','Rojo','2','Sintetico','Prim-Ver','12','350','Bodega','Juan')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('2394','Pirma Brasil','Azul','3','Sintetico','Oto-Inv','23','490','Mostrador','Marcos')

insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('1189','Lobo Solo','Mosto','6','Piel','Prim-Ver','15','370','Bodega','Rosario')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('7738','Flexi','Chocolate','9','Piel','Oto-Inv','34','495','Bodega','Luis')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('4732','Capa de Ozono','Gris','5','Sintetico','Prim-Ver','44','430','Mostrador','Isabel')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('4847','Sporty Finos','Cafe','4','Piel','Prim-Ver','16','265','Mostrador','Rodrigo')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('0748','Karosso','Blanco','8','Piel','Oto-Inv','11','398','Mostrador','Samuel')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('9092','Nike','Blanco','7','Piel','Prim-Ver','18','505','Bodega','Jacobo')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('8902','Puma','Verde','10','Piel','Oto-Inv','9','500','Bodega','Sandra')
insert
Producto(Modelo,Marca,Color,Talla,Material,Temporada,Unidades_Almacenadas,Precio,Ubicacion,
Proveedor)
values ('6473','Zully','Hueso','8.5','Piel','Oto-Inv','3','195','Mostrador','Alejandra')

Sucursales.
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('4-C','Manelly','37352','0','Miguel','1','Leon','765','Juan')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('2-T','Manelly','37352','0','Miguel','2','Leon','876','Marcos')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('6-J','California','37352','0','Miguel','1','Leon','466','Rosario')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('13-R','California','37352','365432','Miguel','3','Leon','999','Luis')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('Local 17','San Crispin','37352','123245','Maria','2','Leon','867','Isabel')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('8-Q','Manelly','37352','0','Miguel','1','Leon','765','Rodrigo')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('Local 21','San Crispin','37352','0','Maria','1','Leon','765','Samuel')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('Local 5','San Crispin','37352','0','Maria','1','Leon','675','Jacobo')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)
values('Local 34','Metropolitana','37352','6546333','Patricia','2','Leon','657','Sandra')
insert
Sucursales(Sucursal,Direccion,Codigo_Postal,Telefono,Gerente,Empleados,Ubicacion,Productos,Pr
oveedor)

values('Local 39','Metropolitana','37352','0','Maria','1','Leon','567','Alejandra')

Ventas.
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('001','3092','1','Bodega',2013-09-12,'Efectivo','Sandra','-','no','350')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('002','2394','2','Bodega',2013-09-12,'Efectivo','Miguel','-','no','490')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('003','1189','1','Bodega',2013-09-12,'Tarjeta','Maria','-','no','370')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('004','7738','1','Bodega',2013-09-12,'Tarjeta','Lourdes','-','no','495')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('005','4732','3','Bodega',2013-09-12,'Efectivo','Beatriz','-','no','430')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('006','4847','1','Bodega',2013-09-12,'Efectivo','Patricia','-','no','265')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('007','0748','3','Bodega',2013-09-12,'Efectivo','Sandra','-','no','398')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)

values ('008','9092','2','Bodega',2013-09-12,'Tarjeta','Rocio','-','no','505')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('009','8902','1','Bodega',2013-09-12,'Efectivo','Maria','-','no','505')
insert
Ventas(Ticket,Modelo,Cantidad,Ubicacion,Fecha_Venta,Tipo_Pago,Empleado,Cliente,Descuento,To
tal_Pago)
values ('010','6473','2','Bodega',2013-09-12,'Efectivo','Patricia','-','no','195')

Pedi
dos.
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('001','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('002','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('003','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('004','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('005','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')

insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('006','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('007','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('008','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('009','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')
insert
Pedidos(IdPedido,Producto,Cantidad,Fecha_Pedido,Fecha_Entrega,Mayoreo,Sucursal,Lote,Corrida,
Total_Pago)
values ('010','3092','24',2013-08-12,2013-09-12,'si','13-R','678','25-30','45,000')

Empleados.
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('001','Miguel','Cruz','Jerez 675','3472581','Masculino','Gerente','1,000','1%','13-R','10-20
hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('002','Patricia','Hernandez','Jerez 676','68655','Femenino','Gerente','1,000','1%','Local
34','10-20 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)

values('003','Maria','Vazquez','Feliciano 567','34725','Femenino','Gerente','1,000','1%','Local
17','10-20 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('004','Lourdes','Sanchez','Isidro 533','865453','Femenino','Vendedora','950','1%','4-C','1020 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('005','Beatriz','Segoviano','Chipre 764','0854312','Femenino','Vendedora','950','1%','6J','10-20 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('006','Sandra','Ramirez','Aldama 456','98754','Femenino','Vendedora','950','1%','13-R','1020 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('007','Rocio','Rodriguez','Juarez 743','222156','Femenino','Vendedora','950','1%','2-T','1020 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('008','Nayelie','Vazquez','Guanajuato 447','9363743','Femenino','Bodega','450','0','Local
17','10-20 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('009','Luis','Alaman','Galicia 564','87533','Masculino','Bodega','700','0','13-R','10-20 hrs')
insert
Empleados(Folio,Nombre,Apellidos,Direccion,Numero,Sexo,Puesto,Sueldo,Comision,Tienda,Horari
o)
values('010','Armando','Alaman','Monaco 876','1234387','Masculino','Bodega','700','0','2-T','1020 hrs')

Actividad 9. Actualizar registros


Proveedores.
update Proveedores set Nombre='JUAN' where Nombre = 'Juan'
update Proveedores set Apellidos='MORALES' where Apellidos='Morales'
update Proveedores set Empresa='COURT' where Empresa='Court'
update Proveedores set Telefono ='776474' where Telefono='87846538'
update Proveedores set Direccion ='LOZANO 906' where Direccion='Lozano 906'
update Proveedores set Ubicacion ='LEON' where Ubicacion='Leon'
update Proveedores set Transporte ='TERRESTRE' where Transporte='Terrestre'
update Proveedores set Nombre='MARCOS' where Nombre = 'Marcos'
update Proveedores set Apellidos='MENDEZ' where Apellidos='Mendez'
update Proveedores set Empresa='PIRMA BRASIL' where Empresa='Pirma Brasil'
update Proveedores set Direccion ='FERROCARRILES 3' where Direccion='Ferrocarriles 3'
update Proveedores set Nombre='ROSARIO' where Nombre = 'Rosario'
update Proveedores set Apellidos='PERALES' where Apellidos='Perales'
update Proveedores set Empresa='LOBO SOLO' where Empresa='Lobo Solo'
update Proveedores set Direccion ='SAN MIGUEL 986' where Direccion='San Miguel 986'

Producto.
update Producto set Marca='KAROSSO' where Marca='Karosso'
update Producto set Marca='LOBO SOLO' where Marca='Lobo Solo'
update Producto set Marca='PIRMA BRASIL' where Marca='Pirma Brasil'

update Producto set Color ='BLANCO' where Color='Blanco'


update Producto set Color ='MOSTO' where Color='Mosto'
update Producto set Color ='AZUL' where Color='Azul'
update Producto set Material ='PIEL' where Material='Piel'
update Producto set Material ='SINTETICO' where Material='Sintetico'

Sucursales.
update Sucursales set Direccion='PLAZA MANELLY' where Direccion='Manelly'
update Sucursales set Direccion='PLAZA CALIFORNIA' where Direccion='California'
update Sucursales set Direccion='PLAZA S.CRISPIN' where Direccion='San Crispin'
update Sucursales set Gerente='MIGUEL CRUZ' where Gerente='Miguel'
update Sucursales set Telefono='78655675' where Direccion='PLAZA S.CRISPIN'

Ventas.
update Ventas set Ubicacion='Mostrador' where Ubicacion='Bodega'
update Ventas set Fecha_Venta=2011-08-01 where Ubicacion='Mostrador'
update Ventas set Cliente='xxxxx' where Ubicacion='Mostrador'

Pedidos.
update Pedidos set Producto='1189' where IdPedido='001'
update Pedidos set Producto='8902' where IdPedido='002'
update Pedidos set Producto='6473' where IdPedido='003'

update Pedidos set Cantidad='45' where IdPedido='001'


update Pedidos set Cantidad='80' where IdPedido='002'
update Pedidos set Cantidad='67' where IdPedido='003'

Empleados.
update Empleados set Nombre='MIGUEL' where Nombre = 'Miguel'
update Empleados set Apellidos='CRUZ' where Apellidos='Cruz'
update Empleados set Direccion ='JEREZ' where Direccion='Jerez 675'
update Empleados set Nombre='PATRICIA' where Nombre = 'Patricia'
update Empleados set Apellidos='HERNANDEZ' where Apellidos='Hernandez'
update Empleados set Direccion ='JEREZ 676' where Direccion='Jerez 676'
update Empleados set Nombre='MARIA' where Nombre = 'Maria'
update Empleados set Apellidos='VAZQUEZ' where Apellidos='Vazquez'
update Empleados set Direccion ='FELICIANO' where Direccion='Feliciano 567'

Actividad 10. Eliminar relaciones


drop table Empleados_Sucursales
drop table Proveedores_Pedidos
drop table Proveedores_Producto
drop table Sucursales_Proveedores
drop table Sucursales_Ventas
drop table Ventas_Producto

Actividad 11. Eliminar registros


Con las sentencias en SQL Server
Inserta 3 nuevas filas completas.
Elimina las 3 filas completas

Actividad 12. Eliminar base de datos


Mostrar el resultado

Debe cambiar de qu base est usando, o si no, no podr eliminar la base


de datos.

drop database CalzadoPatris;

Conclusin
La empresa se puede satisfacer por medio de la base de datos, que se le entrega para poder
ayudar a ser ms organizada y llevar un mejor control del almacn, este programa pude ser
empleada en otra zapatera solo se tiene que poner los datos de la nueva empresa.

Das könnte Ihnen auch gefallen