0% found this document useful (0 votes)
64 views3 pages

Script de Creacion de Cubo

The document contains the SQL code to create several database tables: Persona, TipoServicio, Tipo, Participantes, EPS, Evento, HistorialPersona, ServicioEPS, Participante_Evento, and Hechos. The tables create fields to store information about people, types of services, types, participants, health insurance providers, events, personal histories, health insurance services, participant-event relationships, and facts. Primary keys are defined for each table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views3 pages

Script de Creacion de Cubo

The document contains the SQL code to create several database tables: Persona, TipoServicio, Tipo, Participantes, EPS, Evento, HistorialPersona, ServicioEPS, Participante_Evento, and Hechos. The tables create fields to store information about people, types of services, types, participants, health insurance providers, events, personal histories, health insurance services, participant-event relationships, and facts. Primary keys are defined for each table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

CREATE TABLE [dbo].

[Persona](
[idPersona] [bigint] NOT NULL,
[tipoidentificacion] [int] NOT NULL,
[nombre] [varchar](20) NOT NULL,
[apellido] [varchar](20) NOT NULL,
[fechaNacimiento] [datetime] NOT NULL,
[sexo] [char](1) NOT NULL,
CONSTRAINT [PK_Persona] PRIMARY KEY CLUSTERED
(
[idPersona] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla TipoServicio

CREATE TABLE [dbo].[TipoServicio](


[idTipoServicio] [int] IDENTITY(1,1) NOT NULL,
[descripcion] [varchar](35) NOT NULL,
CONSTRAINT [PK_TipoServicio] PRIMARY KEY CLUSTERED
(
[idTipoServicio] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla Tipo

CREATE TABLE [dbo].[Tipo](


[CodTipo] [int] IDENTITY(1,1) NOT NULL,
[NomTipo] [varchar](30) NOT NULL,
CONSTRAINT [PK_Tipo] PRIMARY KEY CLUSTERED
(
[CodTipo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla Participantes

CREATE TABLE [dbo].[Participante](


[CodPar] [int] IDENTITY(1,1) NOT NULL,
[NomPar] [varchar](30) NOT NULL,
[ApePar] [varchar](30) NOT NULL,
[IdPar] [varchar](30) NOT NULL,
[EdadPar] [smallint] NOT NULL,
CONSTRAINT [PK_Participante] PRIMARY KEY CLUSTERED
(
[CodPar] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

Tabla EPS

CREATE TABLE [dbo].[EPS](


[ideps] [int] IDENTITY(1,1) NOT NULL,
[nombre] [varchar](30) NOT NULL,
CONSTRAINT [PK_EPS] PRIMARY KEY CLUSTERED
(
[ideps] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla Evento

CREATE TABLE [dbo].[Evento](


[CodEve] [int] IDENTITY(1,1) NOT NULL,
[NomEve] [varchar](60) NOT NULL,
[CodTipo] [int] NOT NULL,
[FechIni] [datetime] NOT NULL,
[FechFin] [datetime] NOT NULL,
CONSTRAINT [PK_Evento] PRIMARY KEY CLUSTERED
(
[CodEve] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla HistorialPersona

CREATE TABLE [dbo].[HistorialPersona](


[idhistorialpersona] [int] IDENTITY(1,1) NOT NULL,
[idpersona] [bigint] NOT NULL,
[fechaingreso] [datetime] NOT NULL,
[fecharetiro] [datetime] NULL,
[ideps] [int] NOT NULL,
CONSTRAINT [PK_HistorialPersona] PRIMARY KEY CLUSTERED
(
[idhistorialpersona] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Tabla ServicioEPS

CREATE TABLE [dbo].[ServicioEps](


[ideps] [int] NOT NULL,
[idtiposervicio] [int] NOT NULL
) ON [PRIMARY]

Tabla Participante_Evento

CREATE TABLE [dbo].[Participante_Evento](


[CodEve] [int] NOT NULL,
[CodPar] [int] NOT NULL
) ON [PRIMARY]

Tabla Hechos

CREATE TABLE [dbo].[Hechos](


[CodEve] [int] NULL,
[IdHistorialPersona] [int] NULL,
[FecIniServicio] [date] NULL,
[FecFinServicio] [date] NULL,
[FecIniEvento] [date] NULL,
[FecFinEvento] [date] NULL,
[Documento] [bigint] NULL,
[Eps] [varchar](30) NULL,
[NomEve] [varchar](60) NULL
) ON [PRIMARY]

You might also like