diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-12-09 12:41:45 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-12-09 12:41:45 +0100 |
commit | d414ce3baea8202cd832773fbfd48725cef33dd8 (patch) | |
tree | a3a38c93a77a94b9901f196e8770938a0d4c77c3 /ws2015 | |
parent | 99353021c0ff0b0f087be9a1a5289e3f07a02fa8 (diff) | |
download | uni-d414ce3baea8202cd832773fbfd48725cef33dd8.tar uni-d414ce3baea8202cd832773fbfd48725cef33dd8.tar.gz uni-d414ce3baea8202cd832773fbfd48725cef33dd8.tar.bz2 uni-d414ce3baea8202cd832773fbfd48725cef33dd8.tar.xz uni-d414ce3baea8202cd832773fbfd48725cef33dd8.zip |
DBS - 08
Diffstat (limited to 'ws2015')
-rw-r--r-- | ws2015/dbs/blaetter/08/abgabe.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ws2015/dbs/blaetter/08/abgabe.md b/ws2015/dbs/blaetter/08/abgabe.md new file mode 100644 index 0000000..634a07e --- /dev/null +++ b/ws2015/dbs/blaetter/08/abgabe.md | |||
@@ -0,0 +1,30 @@ | |||
1 | --- | ||
2 | header-includes: | ||
3 | - \lstset{frame=single, breaklines=true, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}} | ||
4 | --- | ||
5 | |||
6 | # Anfragen in SQL | ||
7 | |||
8 | a) | ||
9 | |||
10 | ~~~ {.sql} | ||
11 | SELECT L.lnr, L.lname, COUNT(LTP.pnr) FROM L, LTP WHERE L.lnr = LTP.lnr GROUP BY LTP.pnr | ||
12 | ~~~ | ||
13 | |||
14 | b) | ||
15 | |||
16 | ~~~ {.sql} | ||
17 | SELECT LTP.pnr, SUM(LTP.menge) FROM LTP GROUP BY LTP.pnr | ||
18 | ~~~ | ||
19 | |||
20 | c) | ||
21 | |||
22 | ~~~ {.sql} | ||
23 | SELECT L.lnr, L.lname, COUNT(LTP.pnr) FROM L, LTP WHERE L.lnr = LTP.lnr, COUNT(LTP.pnr) > 2 GROUP BY LTP.pnr | ||
24 | ~~~ | ||
25 | |||
26 | d) | ||
27 | |||
28 | ~~~ {.sql} | ||
29 | SELECT L.lnr, L.lname, L.lsitz, T.tname, LTP.menge * L.gewicht / LTPSS.aggr * 100 FROM L, T, LTP JOIN (SELECT SUM(LTPS.menge) * TS.gewicht as aggr FROM LTP as LTPS, T as TS WHERE LTP.tnr = LTPS.tnr AND TS.tnr = LTPS.tnr GROUP BY LTPS.tnr) as LTPSS USING LTP.tnr WHERE L.lnr = LTP.lnr AND T.tnr = LTP.tnr GROUP BY LTP.tnr | ||
30 | ~~~ | ||