Advertisement
franciscominajas

Consultas P1 BDD

Feb 16th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.66 KB | None | 0 0
  1. 1 Mostrar el no de tt y el nombre de tt,
  2. donde el profesor EULER es director.
  3.  
  4.  
  5. select t.* from tt t, dirige d, profesor p
  6. where t.nott= d. nott and d.idprof= p.idprof
  7. and p.nombre = "EULER"
  8. and p.apPaterno like "HERN%";
  9.  
  10.  
  11. 2 Mostrar l afecha de presentacion de aquellos tts
  12. dirigidos por el profesor IDALIA
  13.  
  14. select p.fecha, p.nott
  15. from presentacion p, tt x, dirige d, profesor w
  16. where p.nott = x.nott
  17. and x.nott = d.nott
  18. and d.idprof = w.idprof
  19. and w.nombre like "Andr_%"
  20. and w.apPaterno like "Orti%"
  21. order by x.nott;
  22.  
  23. 3 Mostrara la calidficacion de los sinodales de aquellso tts
  24. que han sido dirigidos por el profesor Zagal
  25.  
  26. select p.nott, p.CalifSinodales, x.titulo
  27. from presentacion p, tt x, dirige d, profesor w
  28. where p.nott = x.nott
  29. and x.nott = d.nott
  30. and d.idprof = w.idprof
  31. and w.nombre like "Robert%"
  32. and w.apPaterno like "Zaga%";
  33.  
  34. 4 Mostrar el nombre del director de aquellos tts que
  35. tengan como titulo la palabra REDES
  36.  
  37.  
  38. select t.nott, t.titulo,p.nombre,
  39. p.apPaterno, p.apMaterno
  40. from tt t, profesor p, dirige d
  41. where p.idprof = d.idprof
  42. and d.nott = t.nott
  43. and t.titulo like "%BASES DE DATOS%"
  44. order by p.apPaterno;
  45.  
  46. 5 Cuantos TTs (en numero ) es director el profesor barranco
  47.  
  48. select count(*)
  49. from profesor p, dirige d
  50. where p.idprof= d.idprof
  51. and p.nombre="Fabiola"
  52. and p.apPaterno like "Ocampo%";
  53.  
  54. 6 mostrar el tipo de tt,  ademas el dictamen de
  55. aquellos tts, donde la profesora Fabiola Ocampo a sido sinodal
  56.  
  57. select p.tipo, p.dictamen, p.nott
  58. from presentacion p, tt t, sinodalia s, profesor x
  59. where p.nott=t.nott
  60. and t.nott=s.nott
  61. and ( s.s1 = x.idProf
  62. or s.s2 = x.idProf
  63. or s.s3 = x.idProf)
  64. and x.nombre like "fabiola%";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement