Anhang C. Lösungen der Übungen

Kapitel 3-1

Fragen Sie die Personalnummer (Employee ID), den Vornamen und den Nachnamen aller Bankangestellten ab. Sortieren Sie die Daten zuerst nach Nachnamen und dann nach Vornamen.

mysql> SELECT emp_id, fname, lname
    -> FROM employee
    -> ORDER BY lname, fname; +--------+----------+-----------+ | emp_id | fname | lname | +--------+----------+-----------+ | 2 | Susan | Barker | | 13 | John | Blake | | 6 | Helen | Fleming | | 17 | Beth | Fowler | | 5 | John | Gooding | | 9 | Jane | Grossman | | 4 | Susan | Hawthorne | | 12 | Samantha | Jameson | | 16 | Theresa | Markham | | 14 | Cindy | Mason | | 8 | Sarah | Parker | | 15 | Frank | Portman | | 10 | Paula | Roberts | | 1 | Michael | Smith | | 7 | Chris | Tucker ...

Get Einführung in SQL now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.