Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- problema1
- select al.rut,al.nombre_alum,count(*)as cantidad
- from alumno al, inscribe ins
- where al.rut=ins.rut
- group by al.rut,al.nombre_alum*/
- --problema 2
- --select nombre_asig from asignatura where creditos=(select max(asi.creditos)as maximo from asignatura asi);
- --problema 3
- --select distinct asi.nombre_asig from asignatura asi,alumno al,inscribe ins,carrera car
- --where al.rut=ins.rut and asi.cod_asignatura=ins.cod_asignatura and car.cod_carrera=al.cod_carrera
- --and al.cod_carrera=(select cod_carrera from carrera where nombre_carrera='arquitectura');
- --problema 4
- --select ins.rut,al.nombre_alum,count(*) as cantidad from alumno al,asignatura asi,inscribe ins
- --where al.rut=ins.rut and asi.cod_asignatura=ins.cod_asignatura
- --group by ins.rut,al.nombre_alum having count(*)>2;
- --prblema 5
- --select avg(asi.creditos) as promedio_creditos from asignatura asi;
- --problema 6
- --select prof.rut_p,count(*) as cantidad_asig from profesor prof, dicta dic where prof.rut_p=dic.rut_p group by prof.rut_p;
- --problema 7
- select /*prof.rut_p,*/dep.nombre_depto,count(*) as cantidad_profesores from departamento dep, profesor prof
- where dep.cod_depto=prof.cod_depto
- group by prof.rut_p,dep.nombre_depto,prof.cod_depto;
- --problema8 (incompleto)
- --select nombre_profe from profesor where edad=(select max(prof.edad)as edad from profesor prof);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement