2
0

add task two of today

This commit is contained in:
cwikladaniel
2025-12-11 12:30:05 +01:00
parent 576d664240
commit 3a3c99701f
3 changed files with 57 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,4 @@
SELECT ProductID, SUM(Quantity) AS orderAnzahl
FROM OrderDetails
GROUP BY ProductID
ORDER BY orderAnzahl ASC;

View File

@@ -0,0 +1,47 @@
# 2.2 XML
## 2.2.1
- Namen sind klar und deutlich
- inhaltlich korrekt geordnet
## 2.2.2
````xml
<?xml version="1.0" encoding="utf-8"?>
<data>
<buch>
<bibNr> </bibNr>
<title> </title>
<zustand> </zustand>
<seitenanzahl> </seitenanzahl>
</buch>
<avmedium>
<bibNr> </bibNr>
<title> </title>
<zustand> </zustand>
<dauer> </dauer>
</avmedium>
</data>
````
### 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!