diff --git a/Zweites Jahr/aufgaben/saveLibaryDataInXml/getBooksRentIn2015.sql b/Zweites Jahr/aufgaben/saveLibaryDataInXml/getBooksRentIn2015.sql new file mode 100644 index 0000000..c9c2535 --- /dev/null +++ b/Zweites Jahr/aufgaben/saveLibaryDataInXml/getBooksRentIn2015.sql @@ -0,0 +1,6 @@ +SELECT book.bibNr, book.titel, COUNT(book.bibNr) AS ausleihAnzahl +FROM buch as book +LEFT JOIN Ausleihe as rent ON book.bibNr = rent.bibNr + AND YEAR(rent.ausleihdatum) = 2015 +GROUP BY book.bibNr, book.titel +ORDER BY ausleihAnzahl ASC \ No newline at end of file diff --git a/Zweites Jahr/aufgaben/saveLibaryDataInXml/getRentCountAbove10.sql b/Zweites Jahr/aufgaben/saveLibaryDataInXml/getRentCountAbove10.sql new file mode 100644 index 0000000..97ec8d6 --- /dev/null +++ b/Zweites Jahr/aufgaben/saveLibaryDataInXml/getRentCountAbove10.sql @@ -0,0 +1,4 @@ +SELECT ProductID, SUM(Quantity) AS orderAnzahl +FROM OrderDetails +GROUP BY ProductID +ORDER BY orderAnzahl ASC; \ No newline at end of file diff --git a/Zweites Jahr/aufgaben/saveLibaryDataInXml/task.md b/Zweites Jahr/aufgaben/saveLibaryDataInXml/task.md new file mode 100644 index 0000000..cd9020f --- /dev/null +++ b/Zweites Jahr/aufgaben/saveLibaryDataInXml/task.md @@ -0,0 +1,47 @@ +# 2.2 XML + +## 2.2.1 + +- Namen sind klar und deutlich +- inhaltlich korrekt geordnet + +## 2.2.2 + +````xml + + + + + + + + + + + + + + + +```` + +### 2.3 SQL + +## 2.3.1 + +```sql +SELECT book.bibNr, book.titel, COUNT(book.bibNr) AS wieOftAusgeliehen +FROM buch AS book +LEFT JOIN Ausleihe AS rent ON book.bibNr = rent.bibNr + AND YEAR(rent.ausleihdatum) = 2015 +GROUP BY book.bibNr, book.titel +ORDER BY wieOftAusgeliehen ASC +``` + +## 2.3.2 + +X + +## 2.3.3 + +Gute Frage, frag chatgpt! \ No newline at end of file