Databases: Difference between revisions

From 22112
Jump to navigation Jump to search
(Created page with "{| width=500 style="float:right; margin-left: 10px; margin-top: -56px;" |Previous: [https://teaching.healthtech.dtu.dk/22112/index.php/22112_High_Performance_Computing_in_Life_Science Main page] |Next: MySQL |} == Material for the lesson == Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e3896ea1-ad2c-4815-b9e7-af2701265ff6 Introduction to databases]<br> Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a5a3d669-f11c-4e8a-b3ed-af2701263593 How...")
 
No edit summary
Line 8: Line 8:
Powerpoint: [https://teaching.healthtech.dtu.dk/material/36612/HPCLife11-Database.ppt Databases]<br>
Powerpoint: [https://teaching.healthtech.dtu.dk/material/36612/HPCLife11-Database.ppt Databases]<br>
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=37bd2458-4367-4e87-803f-af17006f5c14 Computer Communication, file transfer, terminal]<br>
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=37bd2458-4367-4e87-803f-af17006f5c14 Computer Communication, file transfer, terminal]<br>
Powerpoint: [https://teaching.healthtech.dtu.dk/material/36612/HPCLife01-Communication.ppt Communication]<br>
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/HPCLife01-Communication.ppt Communication]<br>
<!-- PDF: [https://teaching.healthtech.dtu.dk/material/36612/MysqlComputerome.pdf Using MySQL on Computerome] This only needed when accessing a database from Computerome.<br -->
<!-- PDF: [https://teaching.healthtech.dtu.dk/material/22112/MysqlComputerome.pdf Using MySQL on Computerome] This only needed when accessing a database from Computerome.<br -->
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=b8500c9f-d31e-48d4-bc68-af170071f219 Exercises]
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=b8500c9f-d31e-48d4-bc68-af170071f219 Exercises]



Revision as of 11:48, 6 March 2024

Previous: Main page Next: MySQL

Material for the lesson

Video: Introduction to databases
Video: How to design a relational database
Powerpoint: Databases
Video: Computer Communication, file transfer, terminal
Powerpoint: Communication
Video: Exercises

Exercises

1) Logging in to a server
In the course we will change between using our personal laptop, Computerome, and the student server: pupil1.healthtech.dtu.dk
In the database exercises we use pupil1. Log into pupil1:

ssh -X s123456@pupil1.healthtech.dtu.dk
Remember to replace s123456 with your s-number or DTU username
Use your DTU password when asked - no chars will be displayed when writing the password
You will then be asked to enter the MFA code you set up with DTU mail.

The -X means you can use X on unix which may only be relevant for you if you run a X-server on your own computer.

Run the ’mysql’ command as described in the powerpoint. Do ’show databases;’ for fun or just ’quit’.

The text editors available on pupil1 are:

geany     X11-based
gedit     X11-based
jedit     X11-based
nano      text-based
vim       text-based

This entire exercise is just proof of concept and will make you ready for next week.

2) Design your own relational database
Design what tables you should use. That includes the names of the fields and the types of the fields. Which fields are primary keys and which are foreign keys. How the tables relate to each other. No programming is involved.

Your database/tables must be able to model this scenario:
Model people. People get married and divorced. People have kids, not necessarily with their spouses. People get sick with zero or more diseases. The diseases start a a given time. You must be able to keep track of their diseases, so it is possible to track heritable diseases. You can obviously be sick from the same disease more than once.

Think about the reality - described in above two lines - that you must model.

Just to be nice, I will not throw polygamy, homosexual marriages, group marriages or 2D marriages into the model. You can also assume that every disease can be identified and is not just a bunch of symptoms.

3) Change the database model
Let us be modern and creative so people can marry in other ways than just single male to single female - follow the times...
Also, people actually die. Put that fact into the model. Explain what constraints that will put on your data?
Here is an example of what I mean by constraints: Joe and Jane are married. Joe dies. Who is Jane married to?
The database must be able to reflect and contain this kind of changes.