BASE DE DATOS DE UNA HISTORIA CLINICA

Ver el tema anterior Ver el tema siguiente Ir abajo

BASE DE DATOS DE UNA HISTORIA CLINICA

Mensaje  fabian camacho el Mar Mar 15, 2011 10:33 pm

CREATE DATABASE HISTORIA_CLINICA

USE HISTORIA_CLINICA

CREATE TABLE MEDICOS

(MEDICOD NUMERIC (20) ,
MEDINOM CHAR (35)NOT NULL,
MEDIAPE CHAR (35)NOT NULL,
MEDICEDU NUMERIC (20)NULL,
MEDIESPECI CHAR (2)NOT NULL,
MEDIDIR CHAR (50)NOT NULL,
MEDITEL CHAR (15)NOT NULL,
PACICOD NUMERIC (35),
TRATACODI NUMERIC (35),

PRIMARY KEY ( MEDICOD )
);
INSERT INTO MEDICOS VALUES
(01,'HERNANDO','LEON',4544465,'GI','CRA 26 K # 45 K 9','4795465',111,001)
INSERT INTO MEDICOS VALUES
(02,'MARCELA','GUTIERREZ',77777989,'PE','CRA 52 L # 8 O 41','7977744',112,002),
(03,'CARLOS','PIZARRO',45111211,'OD','CALLE 39 B # 42 H 10 ','6644441',113,003),
(04,'LUISA','MARIN',1444544,'NE','DIAGONAL 23 # 36 L 11','4444549',114,004),
(05,'HECTOR','POSADA',25455554,'OR','CALLE 45 U # 56 Ñ 3','5465446',115,005),
(06,'PAOLA','SANCHEZ',511213212,'OP','CRA 36 C # 5 G 31','3465454',116,006),
(07,'JAIME','ESCOBAR',344446547,'OF','DIAGONAL 5A # 87 F 6','6578651',117,007),
(08,'LILIANA','VELASCO',41454654,'CI','TRANSVERSAL 4 # 45 B 12','4444849',118,008),
(09,'HOLMES','NARANJO',465465454,'OD','CALLE 12 C # 65 L 32','5444772',119,009),
(10,'ANDREA','MORALES',547787778,'PE','CRA 5 # 6 I 31','6544454',120,010);

SELECT * FROM MEDICOS

CREATE TABLE TRATAMIENTOS
(TRATACODI numeric (15),
TRATANOM varchar (20) NOT NULL,
TRATAVALOR numeric(12, 2)NOT NULL,
PRIMARY KEY (TRATACODI)
);
INSERT INTO TRATAMIENTO VALUES
(001,'OIDOS',14000),
(002,'ODONTOLOGIA',20000),
(003,'GINECOLOGIA',64500),
(004,'PEDIATRIA',80000),
(005,'OFTAMOLOGIA',100000),
(006,'NEUROLOGIA',15000),
(007,'ODONTOLOGIA',30000),
(008,'PEDIATRIA',24000),
(009,'CIRUJIA PLASTICA',2000000),
(010,'NEUROLOGIA',65000);

SELECT * FROM TRATAMIENTO


CREATE TABLE SEDE
(SEDECOD numeric(20),
SEDENUM NUMERIC(10) NOT NULL,
PRIMARY KEY (SEDECOD)
);

INSERT INTO SEDE VALUES
(101,3),
(102,4),
(103,1),
(104,2),
(105,5),
(106,3),
(107,1),
(108,2),
(109,4),
(110,1);

SELECT * FROM SEDE

CREATE TABLE PACIENTE
(PACICOD numeric(20),
PACINOM char(35)NOT NULL,
PACIAPE char(35)NOT NULL,
PACICEDU numeric(20),
PACIDIR char(50) NOT NULL,
PACITEL char(15) NOT NULL,
PACIBARRIO char(15) NOT NULL,
PACICIUDAD char(15) NOT NULL,
PACIEPS char(20) NOT NULL,
PACISEDE NUMERIC(10) NOT NULL ,
MEDICOD NUMERIC (10),
TRATACODI NUMERIC (10),
EPSCOD NUMERIC (10),

PRIMARY KEY (PACICOD)
);

INSERT INTO PACIENTE VALUES
(111,'HECTOR','SOTO',151121111,'CRA 45 L # 7 L 46','5545444','LA ESTRELLA','CALI','COMFANDI',2,111,001,11),
(112,'GISELA','ARIAS',4154544544,'CALLE 55 P # 5 K 41','2111514144','LA UNION','CALI','SALUD TOTAL',1,112,002,12),
(113,'RICHARD','RAMIREZ',445154411,'DIAGONAL 9 # 8 Ñ 32','5445444','CALIMA','CALI','COMFANDI',3,113,003,13),
(114,'CRISTIAN','NAVIA',222322334,'TRANSVERSAL 103 # 4 M 15','7414411','LOPEZ','CALI','COMFANDI',4,114,004,14),
(115,'CAROLINA','LEAL',7878787874,'CRA 5 # 45 G 3','4111111','CHIMINANGOS','CALI','COMFANDI',2,115,005,15),
(116,'FRANKLIN','OROZCO',411100144,'DIAGONAL 4 J # 65 J 4','5555555','DECEPAZ','CALI','COMFANDI',2,116,006,16),
(117,'EMILIO','RIASCOS',6221144585,'DIAGONAL T # 78 O 96','4444444','LA BRETAÑA','CALI','COMFANDI',2,117,007,17),
(118,'LINDA','FLOREZ',1111445545,'TRANSVERSAL 9B # 47 N 34','33333335','EL RODEO','CALI','COMFANDI',2,118,008,18),
(119,'FERNANDO','MUÑOZ',94114452,'CALLE 6 # 12 H 47','7541144','BELISARIO','CALI','COMFANDI',2,119,009,19),
(120,'CARLOS','MERA',7445154412,'AVENIDA 3N # 12 F 41','3914785','COLON','CALI','COMFANDI',2,010,20);

SELECT * FROM PACIENTE

CREATE TABLE ESPECIALIDAD
(ESPECOD numeric(20),
ESPENOM varchar(35)NOT NULL
PRIMARY KEY (ESPECOD)
);

INSERT INTO ESPECIALIDAD VALUES
(1,'ODONTOLOGO'),
(2,'GINECOLOGO'),
(3,'CIRUJANA PLASTICA'),
(4,'PEDIATRA'),
(5,'OFTAMOLOGO'),
(6,'NEUROLOGO'),
(7,'PSICOLOGO'),
(8,'PEDIATRA'),
(9,'NEUROLOGO'),
(10,'GINECOLOGA');

SELECT * FROM ESPECIALIDAD

CREATE TABLE EPS
(EPSCOD numeric(20),
EPSNOM varchar(15) NOT NULL,
PRIMARY KEY (EPSCOD)
);

INSERT INTO EPS VALUES
(11,'COMFANDI'),
(12,'SALUD TOTAL'),
(13,'HOSPITAL PSIQUIATRICO'),
(14,'NUESTRA SEÑORA DE LOS REMEDIOS'),
(15,'COMFENALCO'),
(16,'SISBEN'),
(18,'CLUB NOEL'),
(19,'VERSALLES'),
(20,'DEPARTAMENTAL');

SELECT * FROM EPS


CREATE TABLE CITA
(CITAPACIEN char(50)NOT NULL,
CITANUM numeric(20),
CITAFECHA date
CITAMEDICO char(30)NOT NULL,
CITACONSUL NUMERIC(20)NOT NULL
PRIMARY KEY (CITANUM)
);

INSERT INTO CITA VALUES
('HECTOR',1,'15/03/2011','HERNANDO','1'),
('GISELA',2,'15/03/2011','MARCELA','6'),
('RICHARD',3,'15/03/2011','CARLOS','4'),
('CRISTIAN',4,'15/03/2011','LUISA','9'),
('CAROLINA',5,'15/03/2011','HECTOR','15'),
('FRANKLIN',6,'15/03/2011','PAOLA','7'),
('EMILIO',7,'15/03/2011','JAIME','5'),
('LINDA',8,'15/03/2011','LILIANA','2'),
('FERNANDO',9,'15/03/2011','HOLMES','10'),
('CARLOS',10,'15/03/2011','ANDREA','8');
SELECT * FROM CITA



avatar
fabian camacho

Mensajes : 9
Fecha de inscripción : 11/02/2011

Ver perfil de usuario

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.