SQL - procedimiento alamcenado

 
Vista:

procedimiento alamcenado

Publicado por david (1 intervención) el 31/05/2013 10:02:56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Create Database Matricula
go
Use Matricula
go
 
create table Alumnos
(
	codigo char(3)not null,
	nombre varchar(50)not null
)
 
create table Cursos
(
	codigo char(2)not null,
	nombre varchar(50)not null,
	ciclo int not null,
	creditos int not null,
	capacidad int not null
)
 
create table PreRequisitos
(
	curso char(2)not null,
	prerequisito char(2)not null
)
 
create table Horarios
(
	id int not null,
	curso char(2) not null,
	dia varchar(20) not null,
	horainicio int not null,
	duracion int not null,
	aula char(3) not null
)
 
create table Notas
(
	id int identity(1,1) not null,
	ciclo nvarchar(7) not null,
	alumno char(3) not null,
	curso char(2) not null,
	nota int not null
)
 
create table Matricula
(
	id int identity (1,1) not null,
	alumno char(3) not null,
	curso char(2) not null
)
 
--- DML : Lenguaje de Manipulacion de Datos
 
insert into Alumnos values('001','BANCES ROJAS LUIS ANTONIO')
insert into Alumnos values('002','ROJAS DIAZ ANA CECILIA')
insert into Alumnos values('003','RUIZ PAREDES LUIS CARLOS')
insert into Alumnos values('004','PALACIOS DIAZ JUAN ALBERTO')
insert into Alumnos values('005','ZEÑA ROJAS CARLOS JORGE')
 
insert into Cursos values('01','LENGUAJE DE PROGRAMACION',4,6,60)
insert into Cursos values('02','MASE DE DATOS',4,8,65)
insert into Cursos values('03','TALLER DE PROGRAMACION',5,6,55)
insert into Cursos values('04','ANALISIS Y DISEÑO DE SISTEMAS',5,8,60)
insert into Cursos values('05','PROYECTOS DE SOFTWARE',6,8,60)
 
insert into PreRequisitos values('03','01')
insert into PreRequisitos values('03','02')
insert into PreRequisitos values('05','03')
insert into PreRequisitos values('05','04')
 
insert into Horarios values(1,'01','LUNES',1,2,'350')
insert into Horarios values(2,'01','MIERCOLES',3,2,'350')
insert into Horarios values(3,'01','VIERNES',2,2,'350')
insert into Horarios values(4,'02','MARTES',3,4,'450' )
insert into Horarios values(5,'02','VIERNES',6,4,'450')
insert into Horarios values(6,'03','LUNES',3,2,'320')
insert into Horarios values(7,'03','MARTES',5,2,'320' )
insert into Horarios values(8,'03','JUEVES',8,2,'320')
insert into Horarios values(9,'04','LUNES',6,4,'310')
insert into Horarios values(10,'04','VIERNES',5,4,'310')
insert into Horarios values(11,'05','MARTES',4,4,'290')
insert into Horarios values(12,'05','JUEVES',5,4,'290')
 
insert into Notas values('2010-II','001','01',8)
insert into Notas values('2010-II','001','02',12)
insert into Notas values('2010-II','003','01',15)
insert into Notas values('2010-II','003','02',18)
insert into Notas values('2010-II','005','01',11)


Nececito ayuda con este ejercicio: Formule un procedimiento almacenado que permita el registro
de la matricula de un alumno en un curso, teniendo en consideración que un
alumno sólo se puede matricular en un curso si ha aprobado (nota >= 11)
los cursos prerequisitos, existe capacidad disponible en el mismo, no
presenta cruce de horarios con los cursos en los cuales ya se encuentra
matriculado y sólo se permite matricular en un total de 14 créditos. Debe
tenerse en consideración el acceso concurrente por parte de los alumnos
para realizar su matrícula en los diferentes cursos.

Urgente.. Agradeceria su respuesta inmediata !!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder