Posted by : ghel domingo, 25 de mayo de 2014

Base de Datos Hotel

Esta base de datos tiene 5 tablas, todas relacionadas.




/*Estableciendo el formato de fecha en SQL en el formato dia, mes y año*/
set dateformat dmy;
/*Poniendo en uso la base de datos master*/
use master
go
/*Eliminando la base de datos bdHotel*/
drop database bdHotel;
go
/*Creando la base de datos bdHotel*/
create database bdHotel;
go
/*Activando o poniendo en usando bdHotel*/
use bdHotel;
go
/*Dar autorización general a la base de datos, util para activar la creación de diagramas y otros*/
alter authorization on database::bdHotel to sa;
go
/*Creando la tabla tTipo y otras*/
create table tTipo
(
 idTipo char(4) primary key,
 nombre varchar(30)
)
go
create table tCliente
(
 idCliente int primary key identity,
 documento varchar(12),
 nombre varchar(max),
 fechaNacimiento datetime,
 lugarNacimiento varchar(max),
 sexo char(1),
 observacion text
);
go
create table tVendedor
(
 idVendedor char(4) primary key,
 nombre varchar(max),
 direccion varchar(max),
 telefono varchar(20),
 observacion text,
 sueldo money
);
go
/*Creando las tablas con claves foraneas*/
go
create table tHabitacion
(
 IdHabitacion int primary key,
 numeroCamas int,
 descripcion varchar(max),
 precio money,
 fkTipo char(4),
 observacion text,
 foreign key (fkTipo) references tTipo(idTipo)
);
create table tAlquiler
(
 idAlquiler int identity,
 precio money,
 fechaEntrada datetime,
 fechaSalida datetime,
 estado char(1),
 observacion text,
 fkVendedor char(4),
 fkCliente int,
 fkHabitacion int,
 foreign key(fkHabitacion) references tHabitacion(idHabitacion),
 foreign key(fkCliente) references tCliente(idCliente),
 foreign key(fkVendedor) references tVendedor(idVendedor),
);
go
/*Insersión de registros elementos*/
Insert into tTipo values('SIMP','HABITACIONES SIMPLES');
Insert into tTipo values('DOBL','HABITACIONES DOBLES');
Insert into tTipo values('SUIT','SUITE VISTA AL MAR');
go
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:4564565','Juan Rodriguez','28/01/1993','Cusco','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:9879865','Maria del Carpio','14/01/1994','Abancay','M','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:9546876','Rosmery Meneses','09/02/1995','Abancay','M','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:7563453','Richard Jimenez','07/02/1996','Abancay','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:4535445','Abel Martinez','22/03/1997','Abancay','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:9808975','Ruben Alata','19/03/1998','Lima','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:6786786','Ricardo Meneses','11/04/1999','Lima','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:2342834','Jose Llosa','19/05/2000','Cusco','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:5645345','Lucio Medrano','18/06/2001','Lima','V','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:3242344','Margoth Fernandez','30/03/2002','Lima','M','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:2646567','Angela Leiva','15/07/2003','Lima','M','');
Insert into tCliente(documento,nombre,fechaNacimiento,lugarNacimiento,sexo,observacion)
 values('DNI:2646567','Yoni Guzman','15/08/2003','Lima','M','');    
go
Insert into tVendedor values('V001','Saul Guzman','Av. Sol','RPC: 159156','Ninguna',1200);
Insert into tVendedor values('V002','Gerardo Soto','Av. La Cultura','RPC: 456545','De Confianza',1500);
Insert into tVendedor values('V003','Manuel Martiarena','Av. Peru','RPC: 545655','Eventual',1000);
Insert into tVendedor values('V004','Maribel Mendes','Jr. Arequipa','RPC: 5646785','Eventual',1000);
go
Insert into tHabitacion values(101,2,'Con baño, agua caliente y cable',60,'SIMP','');
Insert into tHabitacion values(102,3,'Con baño, agua caliente y cable',75,'DOBL','');
Insert into tHabitacion values(103,1,'Con cable',40,'SIMP','');
Insert into tHabitacion values(104,1,'Con cable',40,'SIMP','');
Insert into tHabitacion values(201,1,'Con Baño y Cable',50,'SIMP','');
Insert into tHabitacion values(202,3,'Con Baño',60,'DOBL','');
Insert into tHabitacion values(203,2,'Con Baño y Cable',100,'SUIT','');
Insert into tHabitacion values(204,1,'Con baño, agua caliente y cable',55,'SIMP','');
go
insert into tAlquiler values(50,'01/01/2016','03/01/2016','O','Ninguna','V003',9,101);
insert into tAlquiler values(40,'01/01/2016','03/01/2016','O','Ninguna','V002',2,102);
insert into tAlquiler values(35,'01/01/2016','03/01/2016','O','Ninguna','V001',7,103);
insert into tAlquiler values(40,'01/01/2016','03/01/2016','O','Ninguna','V002',9,104);
insert into tAlquiler values(45,'01/01/2016','03/01/2016','O','Ninguna','V003',6,201);
insert into tAlquiler values(40,'01/01/2016','03/01/2016','O','Ninguna','V002',8,202);
insert into tAlquiler values(100,'01/01/2016','03/01/2016','O','Ninguna','V003',4,203);
insert into tAlquiler values(40,'01/01/2016','03/01/2016','O','Ninguna','V003',10,204);
insert into tAlquiler values(70,'04/01/2016','20/06/2016','O','Ninguna','V001',7,102);
insert into tAlquiler values(35,'04/01/2016','10/06/2016','O','Ninguna','V002',4,103);
insert into tAlquiler values(50,'05/01/2016','06/01/2016','O','Ninguna','V002',8,101);
insert into tAlquiler values(40,'05/01/2016','05/06/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(100,'05/01/2016','01/10/2016','O','Ninguna','V001',5,203);
insert into tAlquiler values(40,'05/01/2016','06/06/2016','O','Ninguna','V003',10,204);
insert into tAlquiler values(40,'06/01/2016','29/06/2016','O','Ninguna','V001',5,104);
insert into tAlquiler values(45,'06/01/2016','05/06/2016','O','Ninguna','V001',8,201);
insert into tAlquiler values(50,'08/01/2016','09/01/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'11/01/2016','13/01/2016','O','Ninguna','V002',4,101);
insert into tAlquiler values(50,'16/01/2016','18/01/2016','O','Ninguna','V001',8,101);
insert into tAlquiler values(50,'19/01/2016','21/01/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'24/01/2016','27/01/2016','O','Ninguna','V003',4,101);
insert into tAlquiler values(50,'30/01/2016','01/02/2016','O','Ninguna','V003',8,101);
insert into tAlquiler values(50,'02/02/2016','04/02/2016','O','Ninguna','V002',2,101);
insert into tAlquiler values(50,'07/02/2016','08/02/2016','O','Ninguna','V002',9,101);
insert into tAlquiler values(50,'09/02/2016','10/02/2016','O','Ninguna','V001',4,101);
insert into tAlquiler values(50,'12/02/2016','14/02/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'17/02/2016','20/02/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'23/02/2016','26/02/2016','O','Ninguna','V002',1,101);
insert into tAlquiler values(50,'27/02/2016','28/02/2016','O','Ninguna','V001',10,101);
insert into tAlquiler values(50,'02/03/2016','04/03/2016','O','Ninguna','V002',9,101);
insert into tAlquiler values(50,'05/03/2016','06/03/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'09/03/2016','10/03/2016','O','Ninguna','V002',11,101);
insert into tAlquiler values(50,'13/03/2016','16/03/2016','O','Ninguna','V002',3,101);
insert into tAlquiler values(50,'18/03/2016','21/03/2016','O','Ninguna','V002',6,101);
insert into tAlquiler values(50,'23/03/2016','26/03/2016','O','Ninguna','V003',5,101);
insert into tAlquiler values(50,'29/03/2016','30/03/2016','O','Ninguna','V001',6,101);
insert into tAlquiler values(50,'02/04/2016','05/04/2016','O','Ninguna','V002',9,101);
insert into tAlquiler values(50,'07/04/2016','09/04/2016','O','Ninguna','V002',5,101);
insert into tAlquiler values(50,'11/04/2016','13/04/2016','O','Ninguna','V002',4,101);
insert into tAlquiler values(40,'06/06/2016','09/06/2016','O','Ninguna','V001',8,202);
insert into tAlquiler values(40,'07/06/2016','09/06/2016','O','Ninguna','V003',5,204);
insert into tAlquiler values(45,'08/06/2016','06/06/2016','O','Ninguna','V001',11,201);
insert into tAlquiler values(45,'09/06/2016','10/06/2016','O','Ninguna','V003',3,201);
insert into tAlquiler values(45,'10/06/2016','11/06/2016','O','Ninguna','V003',1,201);
insert into tAlquiler values(40,'10/06/2016','09/06/2016','O','Ninguna','V003',1,202);
insert into tAlquiler values(45,'12/06/2016','09/06/2016','O','Ninguna','V002',6,201);
insert into tAlquiler values(40,'12/06/2016','21/06/2016','O','Ninguna','V002',4,202);
insert into tAlquiler values(40,'12/06/2016','12/06/2016','O','Ninguna','V003',2,204);
insert into tAlquiler values(40,'13/06/2016','15/06/2016','O','Ninguna','V002',5,103);
insert into tAlquiler values(45,'13/06/2016','21/06/2016','O','Ninguna','V001',11,201);
insert into tAlquiler values(35,'15/06/2016','15/06/2016','O','Ninguna','V002',4,204);
insert into tAlquiler values(35,'16/06/2016','21/06/2016','O','Ninguna','V001',9,204);
insert into tAlquiler values(35,'18/06/2016','22/06/2016','O','Ninguna','V001',4,103);
insert into tAlquiler values(40,'22/06/2016','23/06/2016','O','Ninguna','V001',9,202);
insert into tAlquiler values(40,'23/06/2016','02/07/2016','O','Ninguna','V002',11,102);
insert into tAlquiler values(45,'23/06/2016','24/06/2016','O','Ninguna','V003',6,201);
insert into tAlquiler values(40,'23/06/2016','24/06/2016','O','Ninguna','V001',5,204);
insert into tAlquiler values(40,'24/06/2016','22/06/2016','O','Ninguna','V003',2,103);
insert into tAlquiler values(45,'24/06/2016','22/06/2016','O','Ninguna','V003',4,201);
insert into tAlquiler values(40,'24/06/2016','27/06/2016','O','Ninguna','V003',8,202);
insert into tAlquiler values(35,'25/06/2016','29/06/2016','O','Ninguna','V001',6,103);
insert into tAlquiler values(45,'25/06/2016','25/06/2016','O','Ninguna','V003',6,201);
insert into tAlquiler values(35,'27/06/2016','28/06/2016','O','Ninguna','V001',9,204);
insert into tAlquiler values(45,'28/06/2016','27/06/2016','O','Ninguna','V001',6,201);
insert into tAlquiler values(45,'28/06/2016','03/07/2016','O','Ninguna','V003',7,201);
insert into tAlquiler values(35,'29/06/2016','30/06/2016','O','Ninguna','V002',11,204);
insert into tAlquiler values(35,'30/06/2016','02/07/2016','O','Ninguna','V003',4,104);
insert into tAlquiler values(40,'30/06/2016','04/07/2016','O','Ninguna','V003',3,202);
insert into tAlquiler values(40,'01/07/2016','04/07/2016','O','Ninguna','V002',4,103);
insert into tAlquiler values(40,'01/07/2016','30/06/2016','O','Ninguna','V001',5,204);
insert into tAlquiler values(70,'03/07/2016','07/07/2016','O','Ninguna','V003',3,102);
insert into tAlquiler values(40,'03/07/2016','02/07/2016','O','Ninguna','V002',6,204);
insert into tAlquiler values(45,'04/07/2016','06/07/2016','O','Ninguna','V003',6,201);
insert into tAlquiler values(40,'05/07/2016','08/08/2016','O','Ninguna','V001',9,104);
insert into tAlquiler values(40,'05/07/2016','09/07/2016','O','Ninguna','V001',7,204);
insert into tAlquiler values(40,'06/07/2016','09/07/2016','O','Ninguna','V002',8,103);
insert into tAlquiler values(40,'06/07/2016','08/07/2016','O','Ninguna','V003',1,202);
insert into tAlquiler values(45,'07/07/2016','06/07/2016','O','Ninguna','V001',6,201);
insert into tAlquiler values(45,'08/07/2016','07/07/2016','O','Ninguna','V003',9,201);
insert into tAlquiler values(70,'09/07/2016','12/07/2016','O','Ninguna','V003',6,102);
insert into tAlquiler values(45,'09/07/2016','06/07/2016','O','Ninguna','V003',2,201);
insert into tAlquiler values(45,'09/07/2016','12/07/2016','O','Ninguna','V001',11,201);
insert into tAlquiler values(40,'10/07/2016','16/07/2016','O','Ninguna','V001',9,103);
insert into tAlquiler values(40,'10/07/2016','16/07/2016','O','Ninguna','V001',7,204);
insert into tAlquiler values(40,'11/07/2016','08/07/2016','O','Ninguna','V001',8,202);
insert into tAlquiler values(40,'11/07/2016','10/07/2016','O','Ninguna','V003',1,202);
insert into tAlquiler values(40,'12/07/2016','12/07/2016','O','Ninguna','V001',6,202);
insert into tAlquiler values(45,'13/07/2016','13/07/2016','O','Ninguna','V001',7,201);
insert into tAlquiler values(40,'13/07/2016','19/07/2016','O','Ninguna','V001',9,202);
insert into tAlquiler values(70,'14/07/2016','19/07/2016','O','Ninguna','V002',4,102);
insert into tAlquiler values(40,'15/07/2016','12/07/2016','O','Ninguna','V003',5,102);
insert into tAlquiler values(45,'16/07/2016','14/07/2016','O','Ninguna','V003',2,201);
insert into tAlquiler values(45,'17/07/2016','23/07/2016','O','Ninguna','V002',4,201);
insert into tAlquiler values(40,'17/07/2016','19/07/2016','O','Ninguna','V002',9,204);
insert into tAlquiler values(35,'19/07/2016','18/07/2016','O','Ninguna','V002',5,103);
insert into tAlquiler values(40,'19/07/2016','15/07/2016','O','Ninguna','V001',7,204);
insert into tAlquiler values(35,'20/07/2016','19/07/2016','O','Ninguna','V002',4,103);
insert into tAlquiler values(70,'21/07/2016','02/08/2016','O','Ninguna','V001',8,102);
insert into tAlquiler values(35,'21/07/2016','27/07/2016','O','Ninguna','V002',11,103);
insert into tAlquiler values(40,'22/07/2016','03/08/2016','O','Ninguna','V001',4,202);
insert into tAlquiler values(40,'22/07/2016','20/07/2016','O','Ninguna','V003',6,204);
insert into tAlquiler values(40,'22/07/2016','22/07/2016','O','Ninguna','V003',1,204);
insert into tAlquiler values(35,'23/07/2016','27/07/2016','O','Ninguna','V003',6,204);
insert into tAlquiler values(45,'24/07/2016','26/07/2016','O','Ninguna','V002',9,201);
insert into tAlquiler values(45,'27/07/2016','03/08/2016','O','Ninguna','V003',11,201);
insert into tAlquiler values(35,'28/07/2016','26/07/2016','O','Ninguna','V001',3,103);
insert into tAlquiler values(40,'28/07/2016','28/07/2016','O','Ninguna','V002',1,103);
insert into tAlquiler values(40,'28/07/2016','28/07/2016','O','Ninguna','V001',8,204);
insert into tAlquiler values(40,'29/07/2016','31/07/2016','O','Ninguna','V003',3,204);
insert into tAlquiler values(35,'30/07/2016','10/08/2016','O','Ninguna','V003',11,103);
insert into tAlquiler values(35,'03/08/2016','07/08/2016','O','Ninguna','V001',10,204);
insert into tAlquiler values(45,'04/08/2016','08/08/2016','O','Ninguna','V003',2,201);
insert into tAlquiler values(40,'05/08/2016','18/08/2016','O','Ninguna','V003',6,102);
insert into tAlquiler values(45,'06/08/2016','03/08/2016','O','Ninguna','V003',9,201);
insert into tAlquiler values(40,'06/08/2016','09/08/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(40,'07/08/2016','01/09/2016','O','Ninguna','V001',4,104);
insert into tAlquiler values(45,'09/08/2016','17/08/2016','O','Ninguna','V003',5,201);
insert into tAlquiler values(40,'09/08/2016','09/08/2016','O','Ninguna','V002',3,204);
insert into tAlquiler values(35,'10/08/2016','20/08/2016','O','Ninguna','V003',6,103);
insert into tAlquiler values(40,'10/08/2016','07/08/2016','O','Ninguna','V002',5,204);
insert into tAlquiler values(35,'11/08/2016','10/08/2016','O','Ninguna','V001',9,103);
insert into tAlquiler values(35,'11/08/2016','06/08/2016','O','Ninguna','V003',11,104);
insert into tAlquiler values(35,'12/08/2016','09/08/2016','O','Ninguna','V003',5,103);
insert into tAlquiler values(40,'12/08/2016','12/08/2016','O','Ninguna','V001',6,202);
insert into tAlquiler values(40,'12/08/2016','11/08/2016','O','Ninguna','V003',2,204);
insert into tAlquiler values(40,'13/08/2016','13/08/2016','O','Ninguna','V003',1,204);
insert into tAlquiler values(40,'14/08/2016','15/08/2016','O','Ninguna','V003',1,202);
insert into tAlquiler values(40,'14/08/2016','15/08/2016','O','Ninguna','V001',4,204);
insert into tAlquiler values(40,'17/08/2016','18/08/2016','O','Ninguna','V001',10,202);
insert into tAlquiler values(40,'17/08/2016','27/08/2016','O','Ninguna','V003',8,204);
insert into tAlquiler values(40,'18/08/2016','18/08/2016','O','Ninguna','V002',6,202);
insert into tAlquiler values(45,'19/08/2016','28/08/2016','O','Ninguna','V003',6,201);
insert into tAlquiler values(40,'20/08/2016','26/08/2016','O','Ninguna','V001',7,102);
insert into tAlquiler values(40,'20/08/2016','17/08/2016','O','Ninguna','V003',3,202);
insert into tAlquiler values(40,'20/08/2016','20/08/2016','O','Ninguna','V001',3,202);
insert into tAlquiler values(40,'23/08/2016','27/08/2016','O','Ninguna','V001',9,103);
insert into tAlquiler values(40,'23/08/2016','23/08/2016','O','Ninguna','V003',4,202);
insert into tAlquiler values(40,'26/08/2016','29/08/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(70,'28/08/2016','29/08/2016','O','Ninguna','V002',6,102);
insert into tAlquiler values(40,'28/08/2016','28/08/2016','O','Ninguna','V002',6,204);
insert into tAlquiler values(35,'29/08/2016','01/09/2016','O','Ninguna','V002',7,103);
insert into tAlquiler values(45,'30/08/2016','02/09/2016','O','Ninguna','V001',5,201);
insert into tAlquiler values(40,'31/08/2016','01/09/2016','O','Ninguna','V002',6,102);
insert into tAlquiler values(45,'31/08/2016','29/08/2016','O','Ninguna','V001',9,201);
insert into tAlquiler values(40,'31/08/2016','01/09/2016','O','Ninguna','V001',2,204);
insert into tAlquiler values(40,'01/09/2016','31/08/2016','O','Ninguna','V001',10,202);
insert into tAlquiler values(40,'02/09/2016','02/09/2016','O','Ninguna','V003',2,102);
insert into tAlquiler values(35,'02/09/2016','08/09/2016','O','Ninguna','V001',9,103);
insert into tAlquiler values(40,'02/09/2016','02/09/2016','O','Ninguna','V002',6,204);
insert into tAlquiler values(45,'03/09/2016','09/09/2016','O','Ninguna','V002',8,201);
insert into tAlquiler values(40,'03/09/2016','05/09/2016','O','Ninguna','V003',1,202);
insert into tAlquiler values(40,'04/09/2016','07/09/2016','O','Ninguna','V001',4,204);
insert into tAlquiler values(70,'05/09/2016','06/09/2016','O','Ninguna','V002',10,102);
insert into tAlquiler values(40,'08/09/2016','15/09/2016','O','Ninguna','V001',2,102);
insert into tAlquiler values(40,'08/09/2016','08/09/2016','O','Ninguna','V001',4,202);
insert into tAlquiler values(40,'08/09/2016','09/09/2016','O','Ninguna','V003',10,204);
insert into tAlquiler values(40,'09/09/2016','09/09/2016','O','Ninguna','V003',11,103);
insert into tAlquiler values(40,'10/09/2016','12/09/2016','O','Ninguna','V002',6,202);
insert into tAlquiler values(35,'11/09/2016','21/09/2016','O','Ninguna','V001',9,103);
insert into tAlquiler values(45,'11/09/2016','11/09/2016','O','Ninguna','V003',4,201);
insert into tAlquiler values(40,'11/09/2016','10/09/2016','O','Ninguna','V003',4,204);
insert into tAlquiler values(40,'12/09/2016','09/09/2016','O','Ninguna','V001',7,103);
insert into tAlquiler values(40,'13/09/2016','13/09/2016','O','Ninguna','V003',1,204);
insert into tAlquiler values(45,'14/09/2016','13/09/2016','O','Ninguna','V003',7,201);
insert into tAlquiler values(45,'14/09/2016','15/09/2016','O','Ninguna','V001',7,201);
insert into tAlquiler values(40,'14/09/2016','16/09/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(100,'15/09/2016','19/09/2016','O','Ninguna','V003',3,204);
insert into tAlquiler values(45,'16/09/2016','18/09/2016','O','Ninguna','V003',4,201);
insert into tAlquiler values(70,'18/09/2016','18/09/2016','O','Ninguna','V001',9,102);
insert into tAlquiler values(45,'19/09/2016','20/09/2016','O','Ninguna','V002',2,201);
insert into tAlquiler values(40,'19/09/2016','18/09/2016','O','Ninguna','V003',3,202);
insert into tAlquiler values(40,'19/09/2016','22/09/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(45,'20/09/2016','17/09/2016','O','Ninguna','V002',6,201);
insert into tAlquiler values(70,'21/09/2016','19/09/2016','O','Ninguna','V003',2,102);
insert into tAlquiler values(40,'21/09/2016','19/09/2016','O','Ninguna','V003',1,102);
insert into tAlquiler values(40,'21/09/2016','28/09/2016','O','Ninguna','V003',7,204);
insert into tAlquiler values(70,'22/09/2016','25/09/2016','O','Ninguna','V001',3,102);
insert into tAlquiler values(45,'22/09/2016','22/09/2016','O','Ninguna','V002',9,201);
insert into tAlquiler values(35,'23/09/2016','25/09/2016','O','Ninguna','V003',3,103);
insert into tAlquiler values(45,'25/09/2016','25/09/2016','O','Ninguna','V001',11,201);
insert into tAlquiler values(40,'25/09/2016','24/09/2016','O','Ninguna','V003',2,202);
insert into tAlquiler values(45,'26/09/2016','26/09/2016','O','Ninguna','V003',7,201);
insert into tAlquiler values(40,'26/09/2016','02/10/2016','O','Ninguna','V003',6,202);
insert into tAlquiler values(70,'27/09/2016','29/09/2016','O','Ninguna','V003',4,102);
insert into tAlquiler values(45,'27/09/2016','26/09/2016','O','Ninguna','V001',8,201);
insert into tAlquiler values(45,'27/09/2016','28/09/2016','O','Ninguna','V001',1,201);
insert into tAlquiler values(40,'29/09/2016','06/10/2016','O','Ninguna','V002',5,204);
insert into tAlquiler values(45,'30/09/2016','02/10/2016','O','Ninguna','V003',4,201);
insert into tAlquiler values(45,'03/10/2016','06/10/2016','O','Ninguna','V002',11,201);
insert into tAlquiler values(100,'03/10/2016','02/10/2016','O','Ninguna','V003',9,203);
insert into tAlquiler values(100,'03/10/2016','07/10/2016','O','Ninguna','V002',2,203);
insert into tAlquiler values(40,'04/10/2016','04/10/2016','O','Ninguna','V002',11,202);
insert into tAlquiler values(40,'09/10/2016','07/10/2016','O','Ninguna','V001',8,204);
/*Consultas básicas de cada tabla*/
select * from tVendedor;
select * from tCliente;
select * from tTipo;
select * from tHabitacion;
select * from tAlquiler;

{ 2 comentarios ... read them below or Comment }

  1. una pregunta porque no lleva llave primaria la tabla de alquiler

    ResponderEliminar
  2. por esa tala es auxiliar es decir no senecita crear una llave.. por que no se relaciona con con otro tabla al contrario las otras tablas se relacionan con ella.

    ResponderEliminar

Bienvenido a mi Blog

ZONA DE TRABAJO

DOCUMENTOS
...............................................
Archivos Compartidos
...............................................
Elementos Gráficos
...............................................
Video y Captura de Pantalla

Angel

Contenidos Populares

About

Angel Moreano Terrazas.