Please disable Adblockers and enable JavaScript for domain CEWebS.cs.univie.ac.at! We have NO ADS, but they may interfere with some of our course material.
[Info]
Assignment 3
Assignment 3a - Extraction
Create 4 SQLXML queries, each with the following properties:
NY!!!! kein sql mehr nötig?
- Yield at least 30 rows
- Involve at least 3 tables (each query has to involve at least 3 tables)
- Return at least 7 result columns (each query has to return at least 7 result columns)
Further rules:
- No query is allowed to use the same 3 tables
- Two queries have to use the XML columns
- The results have to be formatted in proper «XML»
- Use xmlelement, xmlagg and xmlforest (all three mandatory) within each query or overall?
Each XML result has to contain at least 5 levels of elements (including root element) and at least 3 different attributes. E.g.:
<address> <-- level 1-->
<name>
<given_name>Chuck</given_name>
<family_name>Norris</family_name>
</name>
<address zip="1190" country="AT">
<street> <-- level 3-->
<name>Waehringerstrasse</name> <-- level 4-->
<number type="main">29</number>
<number type="internal">4</number>
<number type="internal">4.49</number>
</street>
<city>Vienna</city>
</address>
</address>
Submission
- 1 file dump.sql - created with pg_dump command line tool than can be imported with pg_restore.
- 1 file doc.pdf which contains the (revised) data model picture.
- 1 file code.pdf which contains each query (SQL and SQLXML), for each SQL query the 19 first lines of the result as a table.
- 1 file code.zip including the xmls resultX.xml, where X is the number from 1 to 4.
Hints
- If the filenames are not correct, you will get no points.
- If your dump can not be imported with pg_restore (TEST IT!), you will get no points.
- If your model/db does no longer conform to the rules in assignment 2, you will get no points.
- If you violate any rules you will get no points.
Assignment 3b - Schema
Create handwritten RNGs for each XML output (4 schemas in total). Each of the four XML outputs of your SQL queries should be matched by one of the Schemas.
Rules:
- All schemas have to be different (through more than whitespace).
- Use grammar, start for each schema
- Use at least 4 <define>'s in each schema
- Use at least (zeroOrMore OR oneOrMore), interleave, choice (for values), choice (for elements or attributes), optional and list.
Submission
- 1 file dump.sql - created with pg_dump command line tool than can be imported with pg_restore.
- 1 file doc.pdf which contains the (revised) data model picture.
- 1 file code.pdf which contains each query, for each query the 19 first lines of the result as a table.
- 1 file code.zip which 4 files resultX.xml, and 4 files resultX.rng. X is number from 1 to 4 (or higher if you have more than 5 queries).
Hints
- If the filenames are not correct, you will get no points.
- If your dump can not be imported with pg_restore (TEST IT!), you will get no points.
- If your model/db does no longer conform to the rules in assignment 2, you will get no points.
- If you violate any rules you will get no points.
Assignment 3c - Queries
Create 3-6 XPath 1.0 (without extensions) queries that extract information from each of your XML Files (at least 19 in total).
Rules:
- At least 5 queries have to return nodes while considering information from descendants that are not children of these nodes to do so.
- At least 5 queries have to consider information that is stored in attributes.
- At least 5 queries have to use aggregate functions.
- At least 5 queries have to deal with text and text related functions.
- At least 5 queries have to return nodes while considering information from ancestors of these nodes to do so.
- At least 2 queries have to union result sets.
- At least 1 query has to find the maximum or minimum of something (beware, the maximum aggregate function is not part of XPATH 1.0)
Submission
- 1 file dump.sql - created with pg_dump command line tool than can be imported with pg_restore.
- 1 file doc.pdf which contains the (revised) data model picture.
- 1 file code.pdf which contains each query, for each query the 19 first lines of the result as a table, and for each query an extract of the XML result not longer than 1 page.
- 1 file code.zip which 4 files resultX.xml, and 4 files resultX.rng. X is number from 1 to 4 (or higher if you have more than 5 queries).
- 1 file queries.zip with 19 files queryXx.txt which contains just the XPath queries, and 19 files resultXx.txt that describe what your query is supposed to do.
- The big X denotes the resultX.xml that the query is to be applied on.
- The small x is a counter from 1 to 6.
Hints
- If the filenames are not correct, you will get no points.
- If your dump can not be imported with pg_restore (TEST IT!), you will get no points.
- If your model/db does no longer conform to the rules in assignment 2, you will get no points.
- If you violate any rules you will get no points.
Letzte Änderung: 16.05.2019, 15:12 | 890 Worte