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.

Assignment 2 (up)

 
Create a postgres SQL database for your model and fill each table with at least 777 rows.  
 
Include the following data types in your tables («https://www.postgresql.org/docs/8.4/static/datatype.html»):  
The XML in the xml columns hast to contain at least 3 levels of elements (including root element) and at least 2 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>
 
The database has to be in 3rd normal form. Please change the data model to fulfill the above requirements and submit the changed data model. 
 
The contents of the tables should be random, but make sense. I will be pleased if the contents are funny. Tips to create the content: 
 
Use pg_dump -Fc mydb > dump.sql to export the db. 
Reference «here». 
 
Method B should be easier to do and test. 

Submission (up)

Hints (up)

Just a hint what I did to install Postgres and get started: 
 
sudo -s
dnf install postgresql postgresql-server
postgresql-setup --initdb
service postgresql start
su - postgres
createuser mangler -P
createdb --owner=mangler mydb
exit
exit
psql # interactive console where I wrote create table ...
pg_dump -Fc mydb > dump.sql
Letzte Änderung: 13.03.2018, 20:28 | 497 Worte