From 3c5a09ef620a9256fb3cf85d5d913fc2507515b0 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 6 Feb 2021 20:35:22 +0100 Subject: course: databases --- Year_2/Databases/README.md | 4 +++ Year_2/Databases/university_marks.dtd | 14 +++++++++++ Year_2/Databases/university_marks.xml | 43 ++++++++++++++++++++++++++++++++ Year_2/Databases/university_marks.xquery | 11 ++++++++ 4 files changed, 72 insertions(+) create mode 100644 Year_2/Databases/README.md create mode 100644 Year_2/Databases/university_marks.dtd create mode 100644 Year_2/Databases/university_marks.xml create mode 100644 Year_2/Databases/university_marks.xquery diff --git a/Year_2/Databases/README.md b/Year_2/Databases/README.md new file mode 100644 index 0000000..5af8687 --- /dev/null +++ b/Year_2/Databases/README.md @@ -0,0 +1,4 @@ +# XQuery +XQuery files are compiled by xqilla. + +[debian](https://packages.debian.org/bullseye/xqilla) | [ubuntu](https://packages.ubuntu.com/focal/xqilla) diff --git a/Year_2/Databases/university_marks.dtd b/Year_2/Databases/university_marks.dtd new file mode 100644 index 0000000..caab080 --- /dev/null +++ b/Year_2/Databases/university_marks.dtd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/Year_2/Databases/university_marks.xml b/Year_2/Databases/university_marks.xml new file mode 100644 index 0000000..fcd0eb5 --- /dev/null +++ b/Year_2/Databases/university_marks.xml @@ -0,0 +1,43 @@ + + + + + + Luke + Don + + + + Algebra + 2021-02-02 + 30 + + + + + + John + Doe + + + + Databases + 2021-02-06 + 18 + + + + + + Mark + Zuck + + + + Databases + 2021-02-06 + 30 + + + + diff --git a/Year_2/Databases/university_marks.xquery b/Year_2/Databases/university_marks.xquery new file mode 100644 index 0000000..e2f0e4e --- /dev/null +++ b/Year_2/Databases/university_marks.xquery @@ -0,0 +1,11 @@ + +{ +for $student in doc("university_marks.xml")//libretto +where $student/esami//voto/text()=30 +return + {$student/studente/nome/text()} + { ' ' } + {$student/studente/cognome/text()} + +} + -- cgit v1.2.3-18-g5258