Weekly notes / Slides
|Slides||01.02.2012 02.02.2012||08.02.2012||15.02.2012 16.02.2012||22.02.2012||01.03.2012 02.03.2012||lab 06.03.2012 07.03.2012||14.03.2012 15.03.2012|
|Note||The slides are in parts based on slides by Jeffrey D. Ullman and Hector Garcia-Molina.|
Information about the project is now available in the project description.
Access from Java and Python
In the directory dbconnect/ you find two programs dbtest.py and
DBTest.Java. The files contain information on how to run them. They use small libraries dbconnector.py
and DBConnector.java that handle the setup of a database connection. The libraries are smart enough to
figure out when an SSH tunnel is need and set that one automatically up. The test programs contain a minimal
example of how to perform an SQL query.
Thanks go to Jesper Lund who implemented a far pre-cursor of DBConnector.java.
Accounts for the database server can be obtained by sending me an e-mail with your IMADA account and a password (not necessarily your IMADA password). If you are unable to setup an account before Tuesday's exercise, the teaching assistant should be able to assist you.
The web interface for the database is available at http://lynx.imada.sdu.dk/phppgadmin/.
To access the database you can either use the web interface as described below, a graphical frontend (like pgadmin) or you can use a local client (psql). How to obtain such a local client depends on the operating system:
If psql is not available on your linux system, tell the administrator or use the package manager to install it. Make sure it is able to connect to the server (which runs PostgreSQL 8.4).
- Mac OS X
You can download the full PostgreSQL package from PostgreSQL.org. Note that this gives you both the server and the client. You might want to switch off the server if you are using the course's remote server.
Alternatively you can use MacPorts to install postgresql84.
There is a client-only package available from PostgreSQL Frontend for Windows.
Alternatively, you can download the full PostgreSQL package from PostgreSQL.org. Note that this gives you both the server and the client. You might want to switch off the server if you are using the course's remote server.
Remote Access to the Database
You should be able to access your account from the IMADA terminal room or the IMADA notebook network using a local client (e.g. psql -h 10.110.4.32 -p 5434 -U username username), the address 10.110.4.32 and the port 5434.
The server is not directly accessible from outside IMADA, but you can use an SSH tunnel:
ssh -L 5434:10.110.4.32:5434 firstname.lastname@example.org
Then you can access the database server with a local client (e.g. psql -p 5434 -U dbusername dbusername) as localhost.
You can also have it more comfortable by putting the following lines into ~/.ssh/config:
LocalForward 5434 10.110.4.32:5434
Then simply executing ssh lynx-db will set up the tunnel for you.
In case you are using Windows, you can use the program plink to set up the tunnels:
plink.exe -L 5432:10.110.4.32:5434 email@example.com
|Tue 14-16 (U151)||Exercise||Exercise||Exercise||Exercise||Exercise||Exercise|
|Wed 10-12 (U151)||Lecture||Lecture||Lecture||Lecture||Lecture||Lecture|
|Thu 14-16 (U151)||Lecture||Exercise||Lecture||Exercise||Lecture||Exercise||Lecture|
|Fri 14-16 (U151)||Lecture|
|Fri 12-14 (U151)||Exercise|
Just come to my office. If you want to make sure I'm there, contact me before (by e-mail, jabber, phone).
Obligatory course book:
 Hector Garcia-Molina; Jeffrey D. Ullman; Jennifer Widom: Database Systems: The Complete Book. Prentice Hall, 2008.
The content of DM502 Programming A and DM503 Programmering B must be known.
Project and 1-day take-home exam, for which one combined grade is given. Project and take-home exam count equally in the grade. Grades according to the 7-point marking scale. External examiner.
Examination when the course has been taught. Re-examination after 4th quarter. The re-examination is an oral exam, grades according to the 7-point marking scale, internal examiner.
Withdrawal from the exam must be 7 days before the first exam date.
Lectures (22 hours), discussion sessions (20 hours), project work.
3rd quarter, spring 2012
To give the student theoretical skills and practical experience in the use, design, and implementation of a relational database.
Relational databases, database design (ER-modelling, normal forms), relational algebra, SQL, database access from application programs, basic disk structure, index use and index implementations (hashing based, tree based).
After the course, the student is expected to be able to:
- design a suitable ER-model for a database, on the basis of a problem description
- transform an ER-model for a database into a suitable relational model
- write SQL queries for a relational database
- optimize a relational database through choice of indexes, use of equivalent SQL-expressions, and use of the theory of normal forms
- access a database from an application program
- describe work done on the above subjects in clear and precise language, and in a structured fashion