- Create a new mySQL database on igor and and add a table to your database and insert
some rows into your database.
- Adapt seb1.java
so it works with your database. It should print out the table of your database.
- Adapt seb2.java
so it inserts a row into your table.
- Adapt seb2.java
so it allows the user to enter new rows at the command line.
- Create a table with two columns a name and an age.
Write a program which works out the average age of all the people in the table.
- Write a program which sorts the table into descending order of age.
- You cannot access the mySQL server on igor on from outside as it is behind the firewall.
Create a copy of the above database on igor
(read this.
to find out how to do it).
- (Easy Assignment)
Create a Postgres or a MySQL database with a table with two fields: Name (String) and age (int) and write a program
that prints out the average age of all people in the database. (You are not allowed
to use the SQL 'average' or 'sum' functions.)
- (Hard Assignment)
- Create a Postgres or a MySQL database with a table with two fields: Name (String) and age (int) and write a program
that converts the table to TreeMap <String,Integer>,
add a new pair to the map and then use Object serialization
to store the TreeMap in a file.
- Write another program which takes the file converts it to a TreeMap <String,Integer> and updates the table with the contents of the TreeMap.
s.danicic@gold.ac.uk
Sebastian Danicic BSc MSc PhD (Reader in Computer Science)
Dept of Computing, Goldsmiths, University of London, London SE14 6NW
Last updated 2015-09-04