Rodex_

Exam_Exercise_2

Jun 21st, 2017
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Aufgabe2-Testdaten.sql
  2. ------------------------
  3.  
  4. -- Fügen Sie hier Ihre INSERT...SELECT Statements lt. Angabe ein
  5.  
  6. insert into autoren(vorname, nachname, geschlecht)
  7. select v.vorname, n.nachname, v.geschlecht
  8. from vornamen v, nachnamen n;
  9.  
  10.  
  11. insert into buecher(titel, isbn)
  12. select 'Buch von ' || a.vorname || ' ' || a.nachname, to_char(a.autor_id, 'FM00000')
  13. from autoren a
  14. limit 50;
  15.  
  16.  
  17.  
  18. insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
  19. select autor_id, 1, 55
  20. from autoren
  21. limit 50;
  22.  
  23.  
  24.  
  25. insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
  26. select autor_id, 2, 2
  27. from autoren
  28. where autor_id > 51
  29. limit 2;
  30.  
  31.  
  32.  
  33. insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
  34. select autor_id, 5, 1
  35. from autoren
  36. where autor_id > 55 and geschlecht = 'w'
  37. limit 10;
Advertisement