22 lines
No EOL
733 B
SQL
22 lines
No EOL
733 B
SQL
CREATE VIEW prof_dsic AS SELECT
|
|
cod_pro, nombre, telefono
|
|
FROM
|
|
profesor
|
|
WHERE
|
|
cod_dep = 'DSIC';
|
|
|
|
CREATE VIEW docencia_dsic AS SELECT
|
|
prof_dsic.cod_pro, prof_dsic.nombre AS nombre_pro, asignatura.cod_asg,
|
|
asignatura.nombre AS nombre_asg, gteo, gprac
|
|
FROM
|
|
prof_dsic, asignatura, docencia
|
|
WHERE
|
|
prof_dsic.cod_pro = docencia.cod_pro AND
|
|
docencia.cod_asg = asignatura.cod_asg;
|
|
|
|
CREATE VIEW asg_dsic AS SELECT
|
|
asignatura.cod_asg, nombre_asg as nombre, semestre, teoria, prac,
|
|
COUNT(DISTINCT cod_pro) AS profesores, SUM(gteo + gprac) AS creditos
|
|
FROM
|
|
docencia_dsic JOIN asignatura ON docencia_dsic.cod_asg = asignatura.cod_asg
|
|
GROUP BY nombre_asg, semestre, teoria, prac, asignatura.cod_asg; |