Ejemplo base de datos
Enviado por D̴͓̩ͥ̔̏̚i͈̖͎͎̼͍̙ͪ̽̒ͨ̔ͦͣ̀ẹ͈̝͇̤̮ͩ̓̕g̫̟̑̒͊ͤ͂o̥̤̠̙ͮͣ͐ͩ̀ͅ ̷̪͍̺͍͓̦̈̒ͥͣ̋E̗̰ͭ̀ḍ̻͇̘͈͎͑g̖̝̹͐̿̈́ͪ̕å̸̮̍̚r̭̯̼͔̥͎̉ͣ͛ͨͧ̚ J̞̖̙̠̉̃̒ͯ̕.͕̻̟͉̪̥̗̂̔̂̑̉̐̕ ̯͈͇̞̞͍̔é̸. • 24 de Octubre de 2018 • Trabajo • 3.189 Palabras (13 Páginas) • 127 Visitas
create database Control_Escolar
use ControlEscolar
create table Alumno
(
No_control_al varchar (15) not null,
Nom_alumno varchar (20) not null,
ApeP_alumno varchar (20) not null,
ApeM_alumno varchar (20) not null,
Sexo varchar (15) not null,
Email varchar (40) not null,
T_Sangre varchar (5) not null,
Nom_tutor varchar (50) not null,
Tel_tutor bigint not null,
No_seguro_social bigint not null,
Primary key (No_control_al),
Foreign key (No_seguro_social) references Datos_Escolares(No_seguro_social)
)
insert into Alumno values ('14320931','Alexander','Cipriano','Arreola','Masculino','aca@hotmail.com','B+','Rafael Cipriano Bibiano','7444527961','103423')
insert into Alumno values ('14325843','Jos�','Hernandez','Vazquez','Masculino','jhv@hotmail.com','O+','Antonio Hernandez Herrera','7444211267','940392')
insert into Alumno values ('14322354','Mar�a','Flores','Cequeida','Femenino','mfc@hotmail.com','O+','Mar�a Cequeida Lopez','7447888754','482930')
insert into Alumno values ('15322345','Hazel','Mej�a','Rom�n','Femenino','hmr@hotmail.com','A-','Fernando Mej�a Guzman','7443234524','438103')
create table Datos_Escolares
(
No_seguro_social bigint not null,
Semestre varchar (15) not null,
Carrera varchar (10) not null,
Especialidad varchar (40) null,
Clave_esp varchar (15) not null,
Clave_plan_estudios varchar (20) not null,
primary key (No_seguro_social)
)
insert into Datos_Escolares values ('103423','Octavo','I.S.C.','Tecnolog�a de redes de datos','TRD-2910','ADC-10-23')
insert into Datos_Escolares values ('940392','Octavo','I.S.C.','Tecnolog�a de redes de datos','TRD-2910','ADC-10-23')
insert into Datos_Escolares values ('482930','Octavo','L.A.','Recursos Humanos','RH-8321','ADC-10-23')
insert into Datos_Escolares values ('438103','Octavo','L.A.','Recursos Humanos','RH-8321','ADC-10-23')
create table Materia
(
Clave_mat varchar (15) not null,
Nom_mat varchar (50) not null,
Creditos int not null,
Carrera_mat varchar (15) not null,
Semestre_mat varchar (15) not null,
No_control_al varchar (15) not null,
Matricula_prof varchar (15) not null
Primary key (Clave_mat),
Foreign key (No_control_al) references Alumno (No_control_al),
Foreign key (Matricula_prof) references Profesor (Matricula_prof)
)
insert into Materia values ('PE9832','Principios El�ctricos','5','I.S.C.','S�ptimo','14320931','EML129330')
insert into Materia values ('AC8324','Arquitectura De Computadoras 2','4','I.S.C.','Octavo','14320931','EMV839201')
insert into Materia values ('FI8321','Finanzas','5','L.A.','Sexto','14322354','MMP909212')
insert into Materia values ('RH5674','Recursos Humanos','5','L.A.','Octavo','14322354','MMP909212')
create table Profesor
(
Matricula_prof varchar (15) not null,
Nom_prof varchar (15) not null,
ApeP_prof varchar (20) not null,
ApeM_prof varchar (20) not null,
Nivel_academico varchar (15) not null
primary key (Matricula_prof)
)
insert into Profesor values ('EML129330','Eduardo','Marti��n','Lopez','Licenciatura')
insert into Profesor values ('EMV839201','Eloy','Martinez','Valdez','Maestr�a')
insert into Profesor values ('MMP909212','Mar�a','Monzalvo','Parra','Licenciatura')
insert into Profesor values ('AGL091238','Andr�s','Guzm�n','Loera','Doctorado')create database Control_Escolar
use ControlEscolar
create table Alumno
(
No_control_al varchar (15) not null,
Nom_alumno varchar (20) not null,
ApeP_alumno varchar (20) not null,
ApeM_alumno varchar (20) not null,
Sexo varchar (15) not null,
Email varchar (40) not null,
T_Sangre varchar (5) not null,
Nom_tutor varchar (50) not null,
Tel_tutor bigint not null,
No_seguro_social bigint not null,
Primary key (No_control_al),
Foreign key (No_seguro_social) references Datos_Escolares(No_seguro_social)
)
insert into Alumno values ('14320931','Alexander','Cipriano','Arreola','Masculino','aca@hotmail.com','B+','Rafael Cipriano Bibiano','7444527961','103423')
insert into Alumno values ('14325843','Jos�','Hernandez','Vazquez','Masculino','jhv@hotmail.com','O+','Antonio Hernandez Herrera','7444211267','940392')
insert into Alumno values ('14322354','Mar�a','Flores','Cequeida','Femenino','mfc@hotmail.com','O+','Mar�a Cequeida Lopez','7447888754','482930')
insert into Alumno values ('15322345','Hazel','Mej�a','Rom�n','Femenino','hmr@hotmail.com','A-','Fernando Mej�a Guzman','7443234524','438103')
create table Datos_Escolares
(
No_seguro_social bigint not null,
Semestre varchar (15) not null,
Carrera varchar (10) not null,
Especialidad varchar (40) null,
Clave_esp varchar (15) not null,
Clave_plan_estudios varchar (20) not null,
primary key (No_seguro_social)
...