PROBLEMA 5 DE LA UNIDAD 3
UNIDAD 3
RELACIONES Y GRAFOS
PROBLEMA # 5
Describe usando las 3 operaciones, cómo encontrar el nombre y dirección de los estudiantes femeninos encontrando en ambos el menor a B de matemáticas básicas matemáticas discretas.
SOLUCION
Una secuencia de operaciones es la siguiente:
R1= Seleccionar (T1, sexo=F)
R2=Seleccionar (T2, matematicas discretas=A o matemáticas discretas=B)
R3=Seleccionar (R2, matematicas básicas= A o matemáticas básicas=B)
R4= Unir (R1, R3)
R=Proyectar (R4. {Nombre, dirección})
R1= Seleccionar (T1, sexo=F).
|
Student number |
Names |
Sex |
Date of birth |
Marital status |
Address |
|
4000123 |
Jones |
F |
1.2.8.3 |
Single |
2 The Motte,Newtown |
|
5112392 |
Smith |
F |
21.3.84 |
Single |
17 The Crescent,Seaforth |
|
5196236 |
Mckay |
F |
21.3.84 |
Single |
133 Uff Ruad,Reading |
|
493601 |
French |
F |
7.10.77 |
Married |
11 Finn Road,Newtown |
R2=seleccionar (T2, Matematicas discretas=A o Matemáticas discretas= B)
|
Name
|
Basic mathematics |
Programming |
Discrete mathematics |
Computer systems |
|
Jones |
B |
C |
B |
D |
|
Grant |
C |
B |
A |
C |
|
Singh |
C |
B |
A |
D |
|
Mckay |
A |
A |
B |
A |
|
Cookson |
C |
A |
A |
B |
R3 = seleccionar (R2, Matematicas básicas=A o Matemáticas básicas=B)
|
Name
|
Basic mathematics |
Programming |
Discrete matemáticos |
Computer systems |
|
Jones |
B |
C |
B |
D |
|
Mckay |
A |
A |
B |
A |
R4= Unir (R1, R3)
|
Student number |
Names |
Sex |
Date of birth |
Marital status |
Address |
Basic Mthem. |
Progra. |
Discrete Mathem |
Computer systems |
|
4000123 |
Jones |
F |
1.2.8.3 |
Single |
2 The Motte,Newt |
B |
C |
B |
D |
|
5196236 |
Mckay |
F |
21.3.84 |
Single |
133 Uff Ruad,Read. |
A |
A |
B |
D |
R=PROJECT (R4. {Name, Address})
|
Names |
Address |
|
Jones |
2 The Motte,Newtown |
|
Mckay |
133 Uff Ruad,Reading |