Creación de tablas de bases de datos postulante
Patricia Arrivasplata PonticelTrabajo24 de Noviembre de 2015
4.472 Palabras (18 Páginas)122 Visitas
create database BDProyecto
go
create table Datos_Postulante
(
codPos char(8) not null,
codPuesto char(8) not null,
resumenProfesional varchar(60) ,
apellido_paterno varchar(30) not null,
apellido_materno varchar(30) not null,
nombres varchar(30) not null,
fecha_nac date,
lugar_nac varchar(30) not null,
codNacionalidad char(8) not null,
codSexo char(1) not null,
codEstadoCivil char(8) not null,
domicilio varchar(50) not null,
codDepartamento char(8) not null,
codProvincia char(8) not null,
codDistrito char(8) not null,
codCiudad char(8) not null,
codPais char(8) not null,
telefono varchar(10) not null,
telefono2 char(9) ,
Email varchar(30) ,
dni char(8) not null,
codBrevete char(8) ,
categoria varchar(30) not null,
codAntecedentes char(8) not null,
codSpensiones char(8) not null,
N_CUSPP char(10) not null
primary key(codPos)
);
create table Puesto
(
codPuesto char(8) not null,
Puesto varchar(30) not null
primary key(codPuesto)
);
Alter table Puesto
Add Foreign Key (codPuesto)
References Datos_Postulante
-------------------------------------------------------------
create table Nacionalidad
(
codNacionalidad char(8) not null,
Nacionalidad varchar(30) not null
primary key(codNacionalidad)
);
Alter table Nacionalidad
Add Foreign Key (codNacionalidad)
References Datos_Postulante
-------------------------------------------------------------
create table Sexo
(
codSexo char(8) not null,
Sexo varchar(10) not null
primary key(codSexo)
);
Alter table Sexo
Add Foreign Key (codSexo)
References Datos_Postulante
------------------------------------------------------------
create table Estado_Civil
(
codEstadoCivil char(8) not null,
Estado_Civil varchar(30) not null
primary key (codEstadoCivil)
);
Alter table Estado_Civil
Add Foreign Key (codEstadoCivil)
References Datos_Postulante
--------------------------------------------------------
create table Departamento
(
codDepartamento char(8) not null,
Departamento varchar(30) not null
primary key(codDepartamento)
);
Alter table Departamento
Add Foreign Key (codDepartamento)
References Datos_Postulante
-----------------------------------------------
create table Provincia
(
codProvincia char(8) not null,
Provincia varchar(30) not null
primary key(codProvincia)
);
Alter table Provincia
Add Foreign Key (codProvincia)
References Datos_Postulante
----------------------------------------------------
create table Distrito
(
codDistrito char(8) not null,
Distrito varchar(30) not null
primary key(codDistrito)
)
Alter table Distrito
Add Foreign Key (codDistrito)
References Datos_Postulante
-------------------------------------------------
create table Ciudad
(
codCiudad char(8) not null,
...