summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-10-13 18:01:22 +0200
committerErich Eckner <git@eckner.net>2019-10-13 18:01:22 +0200
commitf68f3c9f08aaffde2e7ad54ffbcac98e9d6e33e9 (patch)
tree9fc478a061d6a20c24122dab24737ae34ec7ce2e
downloadSchraubendatenbank-f68f3c9f08aaffde2e7ad54ffbcac98e9d6e33e9.tar.xz
zeige-Inventar neu
-rwxr-xr-xzeige-Inventar38
1 files changed, 38 insertions, 0 deletions
diff --git a/zeige-Inventar b/zeige-Inventar
new file mode 100755
index 0000000..156c9aa
--- /dev/null
+++ b/zeige-Inventar
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+printf 'Schrauben:\n'
+
+mysql -N --raw --batch -e '
+ SELECT *
+ FROM `Schrauben`
+ JOIN `Gewindetypen`
+ ON `Schrauben`.`Gewindetyp`=`Gewindetypen`.`id`
+ JOIN `Materialien`
+ ON `Schrauben`.`Material`=`Materialien`.`id`
+ JOIN `Koepfe`
+ ON `Schrauben`.`Kopf`=`Koepfe`.`id`;
+'
+
+printf '\n'
+
+printf 'Muttern:\n'
+
+mysql -N --raw --batch -e '
+ SELECT *
+ FROM `Muttern`
+ JOIN `Materialien`
+ ON `Muttern`.`Material`=`Materialien`.`id`;
+'
+
+printf '\n'
+
+printf 'Unterlegscheiben:\n'
+
+mysql -N --raw --batch -e '
+ SELECT *
+ FROM `Unterlegscheiben`
+ JOIN `Materialien`
+ ON `Unterlegscheiben`.`Material`=`Materialien`.`id`;
+'
+
+printf '\n'