EDAF75: Database Technology

Preparation for lecture 1

To prepare yourself for this course, and the first two lectures specifically, try to answer the questions below.

Problem: We've been asked to write code to handle students and their college applications. Each student has a name, a student id (stil), and an average grade. The students apply for various majors at colleges, where each college has a name, is situated in a given state, and has a given enrollment. Each application is for a specific major at a specific college, and it can be accepted, rejected, or pending.

  1. What classes and/or data structures would you use to keep track of this data in Python or Java?
  2. How do you list all applications for a given student?
  3. How do you list all applications for a given major at a given college?
  4. Approximately how many lines of Python/Java code do you need to list the three programs (major@college) with the highest grade average for the 'last' accepted student (assuming the students are accepted in order of decreasing grade averages)?
  5. How would you persist your data, so it doesn't get lost if we have to restart the program?
  6. Can you come up with a way to let several programs access the data simultaneously?
  7. If you solve the previous problem, and want to allow several programs to update the data simultaneously, how do you make sure the data isn't corrupted?

After this first week, the solutions to problems 1-6 will be almost trivial (using SQL) – in week 3 we'll see how to use our SQL solutions from Python/Java code, and after week 5, problem 7 will also be trivial.