Tentamen DATABASTEKNIK - 1DL116, 1MB025

Relevanta dokument
Tentamen DATABASE TECHNOLOGY - 1MB025

Tentamen DATABASTEKNIK - 1DL116

Tentamen DATABASTEKNIK - 1DL116, 1MB025

Tentamen DATABASTEKNIK - 1DL116, 1MB025

Tentamen DATABASTEKNIK - 1DL116, 1MB025, 1DL124

Final Exam DATABASE TECHNOLOGY - 1DL300

Database course summary

Tentamen DATABASTEKNIK - 1DL116

Svar till tentamen DATABASTEKNIK - 1DL poäng

Isometries of the plane

Materialplanering och styrning på grundnivå. 7,5 högskolepoäng

Rättningsmall tenta den 25e oktober Uppgift 1. Uppgift 2. se slides

Preschool Kindergarten

Support Manual HoistLocatel Electronic Locks

Introduktion till Entity Framework och LINQ. Källa och läs mer

Pulsen IAM: Del 2 Trender och teknik för morgondagens utmaningar. Tobias Ljunggren, PULSEN

Module 1: Functions, Limits, Continuity

Styrteknik: Binära tal, talsystem och koder D3:1

Vässa kraven och förbättra samarbetet med hjälp av Behaviour Driven Development Anna Fallqvist Eriksson

VHDL Basics. Component model Code model Entity Architecture Identifiers and objects Operations for relations. Bengt Oelmann -- copyright

Grafisk teknik IMCDP IMCDP IMCDP. IMCDP(filter) Sasan Gooran (HT 2006) Assumptions:

Isolda Purchase - EDI

Module 6: Integrals and applications

This exam consists of four problems. The maximum sum of points is 20. The marks 3, 4 and 5 require a minimum

Viktig information för transmittrar med option /A1 Gold-Plated Diaphragm

RUP är en omfattande process, ett processramverk. RUP bör införas stegvis. RUP måste anpassas. till organisationen till projektet

SVENSK STANDARD SS-EN ISO 19108:2005/AC:2015

Swedish adaptation of ISO TC 211 Quality principles. Erik Stenborg

Schenker Privpak AB Telefon VAT Nr. SE Schenker ABs ansvarsbestämmelser, identiska med Box 905 Faxnr Säte: Borås

Documentation SN 3102

LARS. Ett e-bokningssystem för skoldatorer.

TDDB 48 Database technology

Annonsformat desktop. Startsida / områdesstartsidor. Artikel/nyhets-sidor. 1. Toppbanner, format 1050x180 pxl. Format 1060x180 px + 250x240 pxl.

Authentication Context QC Statement. Stefan Santesson, 3xA Security AB

Grafisk teknik IMCDP. Sasan Gooran (HT 2006) Assumptions:

(D1.1) 1. (3p) Bestäm ekvationer i ett xyz-koordinatsystem för planet som innehåller punkterna

Datasäkerhet och integritet

8 < x 1 + x 2 x 3 = 1, x 1 +2x 2 + x 4 = 0, x 1 +2x 3 + x 4 = 2. x 1 2x 12 1A är inverterbar, och bestäm i så fall dess invers.

CHANGE WITH THE BRAIN IN MIND. Frukostseminarium 11 oktober 2018

6 th Grade English October 6-10, 2014

Beijer Electronics AB 2000, MA00336A,

Adding active and blended learning to an introductory mechanics course

Grafisk teknik. Sasan Gooran (HT 2006)

Examensarbete Introduk)on - Slutsatser Anne Håkansson annehak@kth.se Studierektor Examensarbeten ICT-skolan, KTH

Taking Flight! Migrating to SAS 9.2!

Labb LIVE. Exempelkod från föreläsningen. Plushögskolan Frågeutveckling inom MSSQL - SU14

Biblioteket.se. A library project, not a web project. Daniel Andersson. Biblioteket.se. New Communication Channels in Libraries Budapest Nov 19, 2007

1. Varje bevissteg ska motiveras formellt (informella bevis ger 0 poang)

UML use cases. Mikael Söderström Institutionen för informatik Umeå universitet

1. Compute the following matrix: (2 p) 2. Compute the determinant of the following matrix: (2 p)

Om oss DET PERFEKTA KOMPLEMENTET THE PERFECT COMPLETION 04 EN BINZ ÄR PRECIS SÅ BRA SOM DU FÖRVÄNTAR DIG A BINZ IS JUST AS GOOD AS YOU THINK 05

Solutions to exam in SF1811 Optimization, June 3, 2014

Kursplan. MT1051 3D CAD Grundläggande. 7,5 högskolepoäng, Grundnivå 1. 3D-CAD Basic Course

Calculate check digits according to the modulus-11 method

Regler Övriga regler:

Tentamen. TDDB38 - Databasteknik

Disposition. 1. Kopplingen mellan Processanalys (DFDdiagram) 2. Treskikts Client-Server arkitektur (Fig 1.8) 3. Data layer

Writing with context. Att skriva med sammanhang

Alias 1.0 Rollbaserad inloggning

Service och bemötande. Torbjörn Johansson, GAF Pär Magnusson, Öjestrand GC

Installation av F13 Bråvalla

Translation Changes in Swedish EBSCOhost Interface

Kursplan. IK1051 Behörighetsgivande kurs i databassystem för masterprogram i Business Intelligence. 7,5 högskolepoäng, Grundnivå 1

A metadata registry for Japanese construction field

Stiftelsen Allmänna Barnhuset KARLSTADS UNIVERSITET

Högskolan i Skövde (SK, JS) Svensk version Tentamen i matematik

EVALUATION OF ADVANCED BIOSTATISTICS COURSE, part I

Kursplan. IK1004 Java - Grafiska användargränssnitt med Swing. 7,5 högskolepoäng, Grundnivå 1. Java - GUI Programming with Swing - Undergraduate Level

electiaprotect GSM SEQURITY SYSTEM Vesta EZ Home Application SMART SECURITY SYSTEMS! SVENSKA ios Android

Creo Customization. Lars Björs

Affärsmodellernas förändring inom handeln

Support for Artist Residencies

Kursplan. AB1029 Introduktion till Professionell kommunikation - mer än bara samtal. 7,5 högskolepoäng, Grundnivå 1


Vyer, Prepared Statements, Triggers

State Examinations Commission

Förändrade förväntningar

SÖ 2005:10. Agreement in the Form of an Exchange of Letters on the Taxation of Savings Income

Övning 5 ETS052 Datorkommuniktion Routing och Networking

1. Find an equation for the line λ which is orthogonal to the plane

Hur integrera Active Directory och DNS? Rolf Åberg, Simplex System

LUNDS TEKNISKA HÖGSKOLA Institutionen för Elektro- och Informationsteknik

denna del en poäng. 1. (Dugga 1.1) och v = (a) Beräkna u (2u 2u v) om u = . (1p) och som är parallell

Introduction to the Semantic Web. Eva Blomqvist

Typografi, text & designperspektiv

12.6 Heat equation, Wave equation

Make a speech. How to make the perfect speech. söndag 6 oktober 13

Problem som kan uppkomma vid registrering av ansökan

ASSEMBLY INSTRUCTIONS SCALE SQUARE - STANDARD


WCMS-15, Webbutvecklare CMS

Digitalteknik och Datorarkitektur 5hp

Scalable Dynamic Analysis of Binary Code

Kurskod: TAMS28 MATEMATISK STATISTIK Provkod: TEN1 05 June 2017, 14:00-18:00. English Version

Vad kännetecknar en god klass. Vad kännetecknar en god klass. F12 Nested & Inner Classes

Tentamen i Matematik 2: M0030M.

Säkerhetsfunktioner rstå varandra? Finns behov av att avvika från normal säkerhetsfunktion s vissa betingelser under uppstart, ändringar i processen

Webbregistrering pa kurs och termin

Transkript:

Uppsala universitet Institutionen för informationsteknologi Kjell Orsborn, Tore Risch Tentamen 2004-12-20 DATABASTEKNIK - 1DL116, 1MB025 Datum...Måndagen den 20 December, 2004 Tid...14:00-19:00 Jourhavande lärare...kjell Orsborn, tel. 471 11 54 eller 070 425 06 91 Hjälpmedel...miniräknare Anvisningar: Läs igenom hela skrivningen och notera eventuella oklarheter innan du börjar lösa uppgifterna. Förutom anvisningarna på skrivningsomslaget så gäller följande: Skriv tydligt och klart. Lösningar som inte går att läsa kan naturligtvis inte ge några poäng och oklara formuleringar kan dessutom misstolkas. Antaganden utöver de som står i uppgiften måste anges. Gjorda antaganden får förstås inte förändra den givna uppgiften. Skriv endast på en sida av papperet och använd ett nytt papper för varje uppgift för att underlätta rättning och minska risken för missförstånd. För godkänt krävs det cirka 50% av maxpoäng. 1

1. Database terminology: 3pts Explain the following concepts in a database context. (a) database schema Meta data, or the database schema, include data about data, i.e. a description of the database stored in the system catalog. Meta-data consist of information about structure of files, type and storage format of each data item, various constraints on the data and other types of information about data such as authorization privileges and access statistics. For the relational model this include descriptions of the relation names, attribute names, data types, primary keys, secondary keys, foreign keys, other constraints, views, storage structures and indexes, and security and authorization information. (b) aggregation (in data modeling) Aggregation is an abstraction concept to group entities into composite objects from their components. In three cases can aggregation be related to the EER model. The 1st case is an aggregation of attribute values of an object to form the whole object. The 2nd case is the representation of an aggregation relationship using an ordinary relationship. The 3rd case is not explicitly supported in EER but involve the possibility to combine related objects using a particular relationship instance into a higher-level aggregate object. (c) secondary index Sekundärindex är en ordnad fil av dataposter med 2 fält där första fältet är av samma typ som som indexeringsfältet, dvs vilket fält som helst i datafilen. Andra fältet är en blockpekare. Indexeringsfältet kan vara ett icke-nyckelfält eller ett sekundärnyckelfält och datafilen ej sorterad efter indexeringsfältet. Sekundärindex kan vara glesa eller täta. Index ger en avsevärd effetivisering vid sökning av dataposter. Vid updatering av datafilen måste också tillhörande index uppdateras vilket medför en viss ökad kostnad för dessa operationer. 2. Data models: 4pts Explain the three-schema architecture and how it supports two forms of data independence. The three-schema architecture introduces a multi-level architecture where each level represents one abstraction level (in 1978 the ÒstandardÓ architecture (ANSI/SPARC architecture ) for databases was introduced). It consists of 3 levels where each level introduces one abstraction layer and has a schema that describes how representations should be mapped to the next lower abstraction level: 1) The internal level or internal schema - describes storage structures and access paths for the physical database. Abstraction level: files, index files etc. Is usually defined through the data definition language (DDL) of the DBMS. 2) Conceptual level or conceptual schema - an abstract description of the physical database. Constitute one, for all users, common basic model of the logical content of the database. This abstraction level corresponds to Òthe real worldó: object, characteristics, relationships between objects etc. The schema is created in the DDL according to a specific data model. 3) External level, external schemas, or views - a typical DB has several users with varying needs, demands, access privileges etc. External schemas describes different views of the conceptual database with respect to what different user groups would like to/are allowed to se. Some DBMSÕs have a specific language for view definitions (else the DDL is used). 2

Physical data independence: the possibility to change the internal schema without influencing the conceptual schema. E.g. the effects of a physical reorganization of the database, such as adding an access path, is eliminated. Logical data independence: the possibility to change the conceptual schema without influencing the external schemas (views). E.g. add another field to a conceptual schema. 3. SQL: 3pts Suppose that we in a database have two relations (tables) with the following schemas: LINE(LID,P1ID,P2ID) POINT(PID,X,Y) (a) Formulate a relational algebra expression that retrieves all points in the first quadrant, i.e. both coordinates greater than zero. (1pt) (b) Formulate an SQL query that retrieves the length of each line (hint: there is a SQL function SQRT(value expression) that calculates the square root) (2pts) π <P ID> (σ X 0.0 AND Y 0.0 (P OINT )) SELECT L.LID, SQRT(((P2.X - P1.X)*(P2.X - P1.X)) + ((P2.Y - P1.Y)*(P2.Y - P1.Y))) AS LENGTH FROM LINE L, POINT P1, POINT P2 WHERE P1.PID = L.P1ID AND P2.PID = L.P2ID; 4. Normalization: 2pts (a) Explain functional dependency (1pt) (b) Explain full functional dependency (1pt) Ett funktionellt beroende så att X bestämmer Y, X - Y, existerar då om för varje par av tupler t 1, t 2 r(r) och för alla r(r) följande gäller: om t 1 [X] = t 2 [X] så gäller att t 1 [Y ] = t 2 [Y ] Fullt funktionellt beroende anger att för ett funktionellt beroende gäller att det inte finns någon delmängd attribut A X så att (X A)Y. Här gäller att R är ett relationsschema och r(r) är en instans av schemat R med attributen A 1,..., A n och X, Y A 1,..., A n. Alltså ett fullt funktionellt beroende är ett funktionellt beroende som inte innehåller något onödigt attribut i determinanten (vänsterledet i beroendet). 5. Transactions management: 4pts Explain, preferably using a picture, (hint: state transition diagram), the different states that a transaction goes through from the point where it starts 3

until it is finished (the difference between a transaction carried out fully and if it is instead aborted should be included). See for instance Elmasri/Navathe 4ed., Figure 17.4) En transaktion går in i ett aktivt tillstånd (eng. active state) direkt den startar där den kan utfärda läs- och skrivoperationer. När transaktionen avslutas övergår den i ett partiellt överlämnat tillstånd (eng. partially comitted state). I detta tillstånd behöver man kontrollera att inget kan förhindra att transaktionen permanentas (vissa transaktionsprotokoll möjliggör detta genom att att förändringar av databasen registreras i loggen). Om allt är OK så har transaktionen nått sin överlämningspunkt (eng. commit point) och kan övergå i ett överlämnat tillstånd (eng. comitted state). En transaktion kan också övergå i ett falerat tillstånd (eng. failed state) från sitt partiella överlämnade tillstånd eller från sitt aktiva tillstånd om någon kontroll gått fel eller om transaktionen avbrutits. En falerad transaktion kan behöva rullas tillbaka för att eleminera dess effekt. överlämnade och falerade transaktioner lämnar slutligen systemet genom att övergå i ett avslutat tillstånd (eng. terminated state). 6. Object-Oriented Databases: 4pts What are the important differences between File systems, Relational Databases, Object-Oriented Databases, and Object-Relational Databases and for what kind of applications are each kind suitable? Draw diagram. ^ Query support +----------------------+---------------------+ Relational Object Relational eg. Business eg. Multimedia search Well structured Advanced search +----------------------+---------------------+ File systems Object Oriented DB eg. Text editor eg. CAD system No schema Object Store +----------------------+---------------------+-> Data complexity 7. Query Optimization: 4pts (a) What are the three most important join algorithms called? (1pt) (b) Outline their functioning through pseudo code. (3pts) 7a) Nested loop join, sort-merge join, hash join 7b) 4

Nested loop join: Stream T, U, R; Tuple t, u; open(r, o ); open(t, i ); while (not(eof(t))) t = next(t); open(u, i ); while (not(eof(u)) u = next(u); if(t.k == u.k) emit(t + u, R); close(u); close(t); close(r); Sort-merge join: Stream T, U, R; Tuple t, u; open(r, o ); // open result stream R open(t, i ); // open 1st input stream open(u, i ); // open 2nd input stream t = next(t); // read 1st row to t u = next(u); // the same for u while (not(eof(t)) and not(eof(u))) // as long as both input // streams have more data if(t.k > u.k) u = next(u); // if the key field less in u then // move U forward else if(t.k < u.k) t = next(t); // the same for T else emit(t + u, R); // send t and u concatenated as // next result row close(t); close(u); close(r); // close all streams Hash join: Stream T, U, R; Tuple t, u; HashTable h; open(r, o ); h = createhashtable(); open(t, i ); while (not(eof(t))) t = next(t); puthash(h,t.k,t); 5

open(u, i ); while (not(eof(u)) u = next(u); tm = gethash(ht, u.k); if(tm!= NULL) emit(tm + u, R); close(u); close(t); close(r); 8. Active Databases: 4pts (a) What are the components of ECA in a relational database trigger? (3pts) (b) Why is it often difficult to implement complex integrity constraints with triggers? (1pt) 8a) Event: An insert, update, or delete operation Condition: A query over the database Action: A set of database update operations. 8b) It is difficult to identify all possible event situations that might violate the constraint. 9. Multi-Media Databases: 4pts (a) What is feature extraction and how is it used for querying multi-media databases? (2pts) (b) What kind of database API primitives are needed for BLOBs? (2pts) 9a) Feature extraction is the process of extracting features from multi-media objects before they are inserted into the database. A feature can be, e.g., color spectrum of an image, sharpness, lightness, etc. The features are stored in the database together with the multi-media object. When searching the database the features are extracted also from searched multi-media objects and used for finding similar multi-media objects stored in the database. 9b) Since a BLOB can be very large we cannot read it into the application s memory. Instead there must be a streamed interface with operations such as: open(blob) read(blob,pos) write(blob,pos,len,section) delete(blob,pos,len) close(blob) 6

Good luck and a Merry, Merry Christmas! / Kjell och Tore 7