EDAF75: Database Technology – Spring 2025

Announcements

Observera!

I läsvecka 2 skall laborationsgrupperna anmälas, senast 23:59 på fredag (31 januari), och man måste vara 2 eller 3 i gruppen. Ni kan anmäla gruppen här – det är viktigt att ni verkligen följer anvisningarna noga.

Ni kan även anmäla er för ett 10-minuter långt redovisningspass för laboration 1 i läsvecka 3 här (man måste ha anmält sin grupp enligt länken ovan först).

Jag hjälpte gärna dem som vill hitta någon att arbeta med, men de har alla nu fått någon att arbeta med, och jag kan därför inte para ihop fler (ansökan om någon att arbeta med skulle varit skickad senast klockan 23:59 på fredagen i läsverka 1).

Welcome to EDAF75!

This course will be given in Swedish (lectures and most of the supervision), but we sometimes have graduate students from abroad in our teaching staff, so some of the text (such as this) will be in English.

The course begins on Monday, January 20, at 13:15, with a lecture in E:A – attendance is NOT required (see below for more information), but you must register for the course in Ladok no later than 23:59 on Monday, January 20 (if you don't, you will not be able to sign up for the labs and project – see below).

Some important things to know as we start:

  • You must register in Ladok no later than 23:59 on Monday i week 1. Those who fail to do so will not be able to do the labs or the project (we must know in advance how many supervisors to allocate).
  • The course rules (see the links below) applies to everyone, not knowing them is never an excuse.
  • All lectures are scheduled to be in E:A – below is a link to a detailed schedule. Attendance at lectures is not required, and after each lecture I'll put out notes with a summary of what I said, so you don't have to worry if you miss a lecture. That said, the notes are not meant to be a substitute for attending in real life – over the last few years, many courses have seen a pretty dramatic drop in student attendance (fortunately not this one, though), and my impression is that this has negatively impacted student learning severely.

    At LTH you'll get the opportunity to spend a few years together with lots of people with essentially the same interests as yourself (and, hopefully, some with different interests). You'll meet many people who you'll become friends with for life, and I'd strongly recommend that you take the opportunity to spend time with them, and work with them while you're here. Exchanging ideas with others is a very important part of studying at a university.

  • I will have QA sessions on lunches (probably Tuesdays or Wednesdays), where you can ask about anything relating to the course – we'll schedule the QA sessions for each week during the lectures.
  • You will have to do the labs and the project in groups of 2 or 3 students (see the course rules). I'll be happy to help you find people to work with, either if you have no one to work with (that usually applies to about half the class), or if you are a group of two, and want a third group member (that's optional though, it's OK to be a group of two). In week 2 I'll publish a web page where you can register your group. If you want me to help you finding people to work with, you must send me (Christian) an email with the header "EDAF75 – söker grupp" no later than 23:59 on Friday in week 1 – you must send the email from your stil account, so I know for sure who you are.
  • For each of the three labs, your group will have to sign up for a meeting (IRL) with a supervisor, where you will discuss your solutions (you're supposed to have solved the lab exercises before the meetings – if you encounter problem solving them, you're more than welcome to the QA sessions).

En kommentar om mail till LU

Mail på LU fungerar tyvärr numera väldigt dåligt, det finns lite mer information om det längst ner på denna sida.

Course overview

The main focus of this course is relational databases (RDBMS), but we'll also briefly touch upon alternatives (NoSQL) and technologies used in conjunction with databases. Looking at old exams, approximately 80% is about designing, normalizing and querying SQL databases, the remaining 20% is a mix of other things.

The course is divided into 11 sessions, where most sessions consist of one lecture, and some recommended homework – some of the homework will be discussed either during the lectures, or during QA-sessions.

We'll also have three lab exercises, at which you will get the opportunity to discuss your solutions to some homework problems with a teaching assistant.

Finally we have a project where you'll have to:

  • attend a design meeting (you and your group will peer review other groups' designs, and at the same time have your own design reviewed by other groups), and
  • hand in a working program and some documentation.

Schedule, spring 2025

There is a detailed schedule in TimeEdit.

The course is a work in progress, so I'll add material below as we go along.

Observe that the links below often stray way outside the boundaries of this course – the links are there to give you some context, they're not required reading.

Course week 1 (Jan 20 - Jan 24)

We'll talk about how to use SQL – it is a programming language which is specifically designed to make it easy to add, find and update information in relational databases.

  • Session 1 Introduction to the Relational Model, Relational Algebra, and SQL.
    • To prepare you for this session, I suggest you ponder a couple of questions.
    • The notebook I'll use can be fetched here (just unzip it into a directory in which you can run jupyter notebooks).
    • Here's the notebook as it looked afterwards, first as a notebook (copy it into the same directory in which you unzipped the original notebook), and then as a html page (if you just want to look at it, without running the cells). The few slides I used can be found here.
  • QA session: On Moodle you can sign up for a QA session on Wednesday, 12:15-… (I'll post the location of the QA session on Moodle once I've booked a room for it).
  • Session 2 Introduction to dependencies, redundance and anomalies in tables, splitting data into separate tables, and joining tables together. Different kinds of joins (inner, outer, cross, equijoins).
    • Before the lecture, you can try some of the exercises in the notebook for lecture 1.
    • The notebook I'll use can be fetched here (just unzip it into a directory in which you can run jupyter notebooks).
    • Here's the notebook as it looked afterwards, first as a notebook (copy it into the same directory in which you unzipped the original notebook), and then as a html page (if you just want to look at it, without running the cells).

Course week 2 (Jan 27 - Jan 31)

You need to sign up your lab/project group before 23:59 on Friday this week – see the top of this page for instructions on how to do it.

This week we'll look into how to create models of everyday systems, and translate those models into relational databases.

  • Session 3: E/R modelling using UML
    • The lecture will be held on Monday, 13:15 - 15:00 in E:A – to prepare for it you can read through some text here.
    • The slides I'll use for the lecture are here.
    • You can find some notes from the lecture here.
  • QA session: On Moodle you can sign up for a QA session on Tuesday, 12:15-… (I'll post the location of the QA session here once I've booked a room for it).
  • Session 4: Converting E/R models into database schemes using SQL/DDL
    • The lecture will be held on Thursday, 13:15 - 15:00 in E:A – to prepare, I suggest you try to finish the example we began on Tuesday.
    • The slides I'll use for the lecture are here.
    • You can find some notes from the lecture here.

Course week 3 (Feb 3 - Feb 7)

You need to book a meeting with a TA, so you can hand in Lab 1 this week – see the top of this page for instructions on how to do it.

We'll see how we can use SQL databases from other languages (Python and Java), we'll also see how to create a REST service, which can be used to serve various front ends with data.

  • Session 5: Calling SQL from other languages (Java and Python)
    • The lecture will be held on Monday, 13:15 - 15:00 in E:A – I'll talk about how we can use SQL from Java and Python.
    • There are no special preparations for this lecture, other than that it would be good to brush up on your Python skills, if you want to use Python for lab 3 and the project (see link above).
  • QA session: On Moodle you can sign up for a QA session on Tuesday, 12:15-… (I'll post the location of the QA session here once I've booked a room for it).
  • Session 6: Databases and REST API:s
    • The lecture will be held on Thursday, 13:15 - 15:00 in E:A – I'll talk about REST services, and how we can write database-backed REST services in Java and Python.
  • Lab 1: SQL queries

Course week 4 (Feb 5 - Feb 9)

You need to book a meeting with a TA, so you can hand in Lab 1 this week – during the week, I'll publish a link to a website where you can do it.

This week it's time to get a better understanding of fundamental concepts such as dependencies and redundancies, and learn ways to categorize tables, and transform (normalize) them into a better shape.

  • Session 7: Normalization
    • To prepare you for this session, I suggest you try to answer a couple of questions.
    • The lecture will be held on Monday, 13:15 - 15:00 in E:A – I'll talk about functional dependencies and normalization.
  • QA session: On Moodle you can sign up for a QA session on Tuesday, 12:15-… (I'll post the location of the QA session here once I've booked a room for it).
  • Session 8: More normalization
    • The lecture will be held on Thursday, 13:15 - 15:00 in E:B. I'll talk more about normalization.
  • Lab 2: Database modeling

Remaining weeks

A schedule for the remainding weeks will be published as we go along.

En kommentar om mail till LU

Normalt skickar vi veckan före kursstart ut ett mail med information till alla som anmält sig till kursen, men det fungerar dessvärre inte längre.

I början av 2024 stängde nämligen Lunds universitet av de IMAP(s) och SMTP(s) servrar man tidigare hade, och tvingade istället på oss ett helt hopplöst webmail-GUI som kostar oss massor av extra tid, och dramatiskt ökar både risken att vi missar inkommande mail och att vi skickar mail till fel mottagare. Tidigare år kunde jag skicka mail till samtliga grupper med hjälp av enkla Python-scripts, det går inte längre – när jag i en kurs i höstas skulle skicka mail till projektgrupperna var jag tvungen att klicka 17 gånger för var och en av de drygt 50 grupperna, och minst ett av mailen kom aldrig fram (jag missade förmodligen något av de 850 musklick som jag behövde göra).

Det nya klick-baserade mail-systemet gör det dessutom väldigt mycket svårare att hålla koll på mail-kedjor – tidigare kunde jag läsa och skriva mina mail inifrån Emacs, och då var det enkelt att automatisera hantering/arkivering av mail-kedjor för projektgrupperna, och enkelt att hålla koll på vilka mail som hade besvarats. Idag måste jag klicka runt i ett GUI som kanske skulle fungera för någon som vill skicka mail till sina närmaste kollegor, men som absolut inte fungerar för att hantera studenter i en kurs med nära 200 deltagare i 50 grupper. Dessutom varnar det nya systemet inte om era mail inte kommer fram (ni får inget meddelande om ni skulle använda en felaktig adress), och periodvis kan jag inte komma åt min inkorg.

Jag beklagar verkligen de problem som det nya mail-systemet riskerar att medföra (missade mail, felskickade mail och fördröjd återkoppling) – institutionen har bett att få tillbaka IMAP och SMTP, men ingenting har hänt hittills.

Det är dessutom inte ovanligt att studenter skickar mail till mig med frågor om innehållet i EDAF75. Jag skulle verkligen önska att jag hade möjlighet att svara på individuella mail-frågor om kursinnehållet, men att skriva mail-svar tar mycket längre tid än att svara på frågor direkt (i synnerhet med det nya mailsystemet) – dessutom är mail en väldigt dålig kanal att förklara på, både för att det är lätt att missförstå nyanser i frågor, och för att det är omöjligt att se om ni förstår svaret, och vilken del av svaret som kanske behöver förtydligas.

Så en kurs med ca 200 kursdeltagare per lärare skalar väldigt vädigt dåligt för mail-undervisning – om jag bara lägger 10-15 minuter på att läsa en mailfråga och skriva ett svar, så skulle det ändå bli mer än en arbetsvecka för en fråga per student.

Du är hjärtligt välkommen med frågor antingen till våra frågestunder (se Moodle), eller i samband med föreläsningar (både i pausen och efteråt).