Rodex_ icon

Exam_Exercise_2

Rodex_ | PRO | 06/21/17 01:28:16 PM UTC | 0 ⭐ | 7389 👁️ | Never ⏰ | []
PostgreSQL |

850 B

|

None

|

0 👍

/

0 👎

-- Aufgabe2-Testdaten.sql
------------------------
 
-- Fügen Sie hier Ihre INSERT...SELECT Statements lt. Angabe ein
 
insert into autoren(vorname, nachname, geschlecht)
select v.vorname, n.nachname, v.geschlecht
from vornamen v, nachnamen n;
 
 
insert into buecher(titel, isbn)
select 'Buch von ' || a.vorname || ' ' || a.nachname, to_char(a.autor_id, 'FM00000')
from autoren a
limit 50; 
 
 
 
insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
select autor_id, 1, 55
from autoren 
limit 50; 
 
 
 
insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
select autor_id, 2, 2
from autoren 
where autor_id > 51
limit 2; 
 
 
 
insert into autoren_buecher(fk_autoren_autor_id, fk_buecher_buch_id, anteil)
select autor_id, 5, 1
from autoren 
where autor_id > 55 and geschlecht = 'w' 
limit 10;

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎