• Keine Ergebnisse gefunden

Datenbanken II

N/A
N/A
Protected

Academic year: 2022

Aktie "Datenbanken II"

Copied!
3
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Datenbanken II

Wintersemester 2019/20

Praktische Aufgabe 1

Der Inhalt dieser ¨ubung wird im1. Quizuberpr ¨¨ uft.

1 Introduction

For the purpose of practical exercises (Praktische Aufgaben)PostgreSQLhas to be in- stalled locally on your machine. Then, you need to create a database and populate it with data.

The knowledge of this exercise’s contents will be verified onQuiz 1.

1.1 Seeking Help

When you have any problems with exercises, you can seek help in the following chan- nels:

1. Proseminar

2. Slack Channel#db21

3. Tutorium (Martin Fischer, T.B.A.)

Start working on the practical exercises in advance. You may face obstacles that need help solving. The earlier you post your questions, the earlier the Proseminar-Team will give you an answer and act if needed.

1https://dbteaching.slack.com

(2)

2 PostgreSQL Installation and Preperation

2.1 PostgreSQL Installation

The first step is to install PostgreSQL-Server locally on your machine. Afterwards, you can create a database and import data. Details of how to install PostgreSQL you can find in the Internet2. Details for Debian can be found in the Debian Wiki3.

2.2 Data Preparation

In most exercises, we will operate on parts of the IMDB Database4. We have already prepared the preprocessed data and a script that creates the tables (https://kitten.

cosy.sbg.ac.at/index.php/s/zP69GHaiyW9KpHA) for you.

We create three tables with the following schemas:

Tabellenname:titles tconst CHAR(9) PRIMARY KEY titleType TEXT

primaryTitle TEXT originalTitle TEXT isAdult BOOLEAN startYear INTEGER endYear INTEGER

runtimeMinutes INTEGER genres TEXT[]

Tabellenname:names nconst CHAR(10) PRIMARY KEY primaryName TEXT

birthYear INTEGER deathYear INTEGER

primaryProfession TEXT[]

knownForTitles CHAR(9)[]

Tabellenname:principals tconst CHAR(9)

ordering INTEGER nconst CHAR(10) category TEXT job TEXT

characters TEXT

2https://www.postgresql.org/download/

3https://wiki.debian.org/PostgreSql

4https://www.imdb.com/interfaces/

(3)

To create the tables, you can use the downloaded SQL scriptcreate db.sql. Execute it with \i <path-to-create db.sql> in the psql-console. To import the data, we propose to use the PostgreSQL \copycommand by executing the following lines in thepsql-console:

\copy titles FROM title.basics_no_header_array_format.tsv WITH DELIMITER E'\t'

\copy names FROM name.basics_no_header_array_format.tsv WITH DELIMITER E'\t'

\copy principals FROM title.principals_no_header.tsv WITH DELIMITER E'\t'

After you have imported the data (it may take a while), you can view the table details with the\d <tablename>command. It shows the schema with attributes, constraints, indexes, and possible sorting (CLUSTER).

Referenzen

ÄHNLICHE DOKUMENTE

Tulemuste tõlgendamisel tuleks arvestada lapse sotsiaalse taustaga, sarnaste testide täitmise kogemust ja kõne arengut, mis võib olla takistavaks teguriks lapse ja testija

Seine Präsentation enthält Informationen zum Anwendungsbereich und Inhalt der DSGVO, zu den Ausnahmen für Archivzwecke sowie zu einzelnen Maßnahmen die Archive ergreifen müssen,

A program written on JOVIAL coding paper is shown below. The coding sheet is simply an array of little squares. The 80 columns on the paper correspond to the 80 columns on

When the editor is called with no file names specified, a temporary file in the user's current directory is created into which the information is written as

Da die Bcdcutungsglcichhcit der beiden markierten Einheiten in (223) als fast absolut zu charakterisieren ist, steht ihrer gegenseitigen Austauschbarkeit nichts

Filter Wie können die Dokumente in puren Text umgewandelt werden. Lexer Welche Sprache soll

Oracle8i interMedia Text erlaubt es unstrukturierte Daten (Texte) zu verwalten, indizieren und danach zu suchen.. • Die Freitextsuche erlaubt es Dokumente innerhalb und außerhalb

” Mit dem Terminus Text Mining werden computergest¨ utzte Verfahren f¨ ur die semantische Analyse von Texten bezeichnet, welche die automatische bzw1. semi-automatische