Professional Documents
Culture Documents
USE BD_Proyectos
-- Creacin de la tabla EMPLEADO
-- Crear la tabla EMPLEADO
Create Table EMPLEADO (
Cedula Char (10) not null unique,
CURP Char (18) not null unique,
RFC Char (13) not null unique,
Nombre Char (45) not null,
ApellidoP Char (45) not null,
ApellidoM Char (45) not null,
Iniciales Char (6) not null,
Sexo Char (1) not null,
FechaNac DateTime not null,
Salario Money,
Supervisor char (10) not null ,
Primary key (Cedula) )
-- Creacin de la tabla Municipio
Create table MUNICIPIO (
idMpio Char (10) not null unique,
NombreMpio Char (60) not null,
Primary Key (idMpio)
)
-- Creacin de la tabla ESTADO
Create table ESTADO (
idEdo Char (10) not null unique,
NombreEdo Char (60) not null,
Primary Key (idEdo)
)
-- Creacin de la tabla DIRECCIN
Create table Direccion (
Cedula Char (10) not null unique references EMPLEADO (Cedula),
Calle Char (60) not null,
Colonia char (40) not null,
Localidad Char (60) not null,
idMpio Char (10) not null references MUNICIPIO (idMpio),
idEdo Char (10) not null references ESTADO (idEdo),
CP char (6) not null )
-- Creacin de la tabla FAMILIAR
Create table FAMILIAR (
Cedula char (10) not null references EMPLEADO (Cedula),
CURP char (18) not null unique,
Nombre char (45) not null,
ApellidoP char (45) not null,
ApellidoM char (45) not null,
Sexo Char (1) not null,
FechaNac DateTime not null,
Parentesco Char (20) not null,
Primary Key (CURP),
)
into
into
into
into
into
into
into
into
TrabajaEn
TrabajaEn
TrabajaEn
TrabajaEn
TrabajaEn
TrabajaEn
TrabajaEn
TrabajaEn
values
values
values
values
values
values
values
values
(
(
(
(
(
(
(
(
'999901',
'999902',
'999903',
'999904',
'999905',
'999906',
'999907',
'999908',
'0001',8)
'0002',6)
'0003',8)
'0004',6)
'0005',8)
'0002',8)
'0004',6)
'0003',8)
into
into
into
into
into
Asignado
Asignado
Asignado
Asignado
Asignado
values
values
values
values
values
('999901','0102','02/07/10')
('999902','0102','02/07/10')
('999904','0101','02/07/10')
('999903','0101','02/07/10')
('999906','0103','02/07/10')
into
into
into
into
into
Jefe
Jefe
Jefe
Jefe
Jefe
values
values
values
values
values
('999901','0101','02/07/10')
('999903','0102','02/07/10')
('999905','0103','02/07/10')
('999907','0104','02/07/10')
('999908','0105','04/08/10')
01/02/69','Padre')
insert into FAMILIAR
01/72','Madre')
insert into FAMILIAR
03/70','Madre')
insert into FAMILIAR
'01/08/72','To')
insert into FAMILIAR
10/70','Padre')
insert into FAMILIAR
,'01/08/62','Madre')
insert into FAMILIAR
/80','Hermano')
into
into
into
into
into
into
into
into
ESTADO
ESTADO
ESTADO
ESTADO
ESTADO
ESTADO
ESTADO
ESTADO
values
values
values
values
values
values
values
values
('01001','Guerrero')
('01002','Jalisco')
('01003','Sonora')
('01008','Chihuahua')
('01004','Aguascalientes')
('01005','Puebla')
('01006','Colima')
('01007','Durango')
select
insert
insert
insert
insert
insert
insert
insert
insert
*from MUNICIPIO
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
into MUNICIPIO values
('11001','Acapulco de Jurez')
('11002','Guadalajara')
('11003','Tamazula')
('11004','Rosario')
('11005','Ajalpan')
('11006','La Cruz')
('11007','Coso')
('11008','Armera')
( '999901','Calle 23','Progreso','Acapulco','11001'
( '999902','Plan de Iguala','Morelos','Guadalajara'
( '999903','Calle 12','Mozimba','Tamazula','11003',
( '999904','Calle 8','El mirador','Rosario','11004'
( '999905','Alta Miramar','Vaquero','Ajalpan','1100
( '999906','Calle 7','Andador','La Cruz','11006','0
( '999907','Andador Marcos','Libertadores','Coso','1
( '999908','Las torres','E.Zapata','Armera','11008',
insert
insert
insert
insert
insert
ible')
into
into
into
into
into
MAQUINARIA
MAQUINARIA
MAQUINARIA
MAQUINARIA
MAQUINARIA
update
update
update
update
'1003'
update
update
update
MAQUINARIA
MAQUINARIA
MAQUINARIA
MAQUINARIA
select
insert
insert
insert
insert
insert
*from DEPTO
into DEPTO
into DEPTO
into DEPTO
into DEPTO
into DEPTO
set
set
set
set
values
values
values
values
values
Descripcion=
Descripcion=
Descripcion=
Descripcion=
values
values
values
values
values
(
(
(
(
(
'0102','Recursos humanos')
'0101','Recursos financieros')
'0103','Sistemas')
'0104','Fabricacin')
'0105','Mantenimiento')
into
into
into
into
into
mAsignada
mAsignada
mAsignada
mAsignada
mAsignada
values
values
values
values
values
(
(
(
(
(
'0001','1000','02/12/14','09/12/14','Hecho')
'0002','1004','01/12/14','08/12/14','Hecho')
'0003','1005','07/12/14','12/12/14','Pendiente')
'0004','1001','01/12/14','07/12/14','Hecho')
'0005','1003','02/12/14','09/12/14','Hecho')