Bsp 18 & 20 ??
Results 1 to 2 of 2

Thread: Bsp 18 & 20 ??

  1. #1

    Title
    Veteran
    Join Date
    Jun 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Bsp 18 & 20 ??

    Irgendwie komme ich bei Sql Bsp 18, und 20 auf
    keinen grünen Zweig.
    Wie zur Hölle gehen die?

  2. #2
    dose's Avatar
    Title
    Dipl.Ing
    Join Date
    Feb 2002
    Location
    Meidllling
    Posts
    1,037
    Thanks
    1
    Thanked 0 Times in 0 Posts
    20 is eines der drei schwierigsten (mit 12 und 17 gemeinsam, auch sehr beliebt bei den Tutoren), 18 is da eher schon die Family Edition
    Code:
    /* 18. */;
    SELECT e.invnr,e.isbn FROM exemplar e,
      (SELECT isbn,count(isbn) as anzahl FROM exemplar GROUP BY isbn) as x
      WHERE x.anzahl>1 AND e.isbn=x.isbn;
    
    /* 20. */;
    SELECT k2.vorname,k2.nachname,k2.telefon FROM kunde k2,
      /* Anzahl Karl May Bücher pro Kunde */
      (SELECT y.knr,count(y.isbn) AS karlmaybuecher FROM
        (SELECT DISTINCT k.knr,isbn FROM kunde k,ausleihe a,exemplar e WHERE k.knr=a.knr AND e.invnr=a.invnr AND e.isbn IN 
          (SELECT isbn FROM autor WHERE vorname='Karl' AND nachname='May')
        ) AS y GROUP BY y.knr
      ) AS z
      WHERE z.karlmaybuecher=(SELECT count(isbn) AS anzahl FROM autor WHERE vorname='Karl' AND nachname='May') AND k2.knr=z.knr;
    ...hab ich, ohne Gewähr...
    yast, SuSEconfig, apt-get and rpm - the 4 horsemen of the apocalypse

    Platform of insanity :: www.dose-xp.org

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •