6. /*
Created 10/14/2009
Modified 10/14/2009
Project laboratorio
Model entidad relaciom
Company Particular
Author Equipo6
Version 2.0
Database MS SQL 7
*/
Create table [Doctor] (
[Nombre] Char(20) NOT NULL,
[Apellidop] Char(20) NOT NULL,
[Apellidom] Char(20) NULL,
[Direccion] Char(20) NOT NULL,
[Telefono] Char(20) NULL,
[clavedoc] Integer NOT NULL
)
go
Create table [Quimico] (
[Nombre] Char(20) NOT NULL,
[Apellidop] Char(20) NOT NULL,
[Apellidom] Char(20) NULL,
[Direccion] Char(20) NOT NULL,
[Telefono] Char(20) NULL,
[clavequi] Integer NOT NULL,
Primary Key ([clavequi])
)
go
7. Create table [Administrador] (
[Nombre] Char(20) NOT NULL,
[Apellidop] Char(20) NOT NULL,
[Apellidom] Char(20) NULL,
[Direccion] Char(20) NOT NULL,
[Telefono] Char(20) NULL,
[clavedoc] Integer NOT NULL,
Primary Key ([clavedoc])
)
go
Create table [Paciente] (
[Nombre] Char(10) NULL,
[Apellidom] Char(10) NULL,
[Apellidop] Char(10) NULL,
[Telefono] Char(10) NULL,
[Direccion] Char(10) NULL,
[Edad] Char(10) NULL,
[Clave_de_Cliente] Integer NOT NULL,
Primary Key ([Clave_de_Cliente])
)
go
Create table [Estudio] (
[nombre] Char(10) NULL,
[claveest] Integer NOT NULL,
[parametros] Char(10) NULL,
[resultados] Char(10) NULL,
8. Alter table [Paciente] add foreign key() references [Doctor] ()
go
Alter table [Estudio] add foreign key([clavequi]) references [Quimico]
([clavequi])
go
Alter table [Estudio] add foreign key([Clave_de_Cliente]) references
[Paciente] ([Clave_de_Cliente])
go
Set quoted_identifier on
go
Set quoted_identifier off
go
/* Roles permissions */