Saint Xavier University
Presented at CCSC: Midwest, 29 September 2018
This assignment is for a course on relational databases, for students with some programming background. It requires both SQL and Java skills. The instructor provides the students with source code for a score-based video game. The students construct the SQL queries necessary to insert scores into a database and retrieve lists of high scores. The students then embed the queries into the provided game source code. I used this assignment at the end of a junior-level databases course. It took about 2 weeks, concurrent with other activities.
I have developed my own twist on the classic
video game Space Invaders. It’s like the original, but the player chooses a
hero to fight the invaders. Each hero has different gameplay. The heroes are
the classic video game archetypes: strong fighter, rogue archer, and
intelligent wizard. The Java source code is available here:
The assignment is split into three tasks. For Task 1, the student works on figuring out the SQL queries necessary to build a high score table and a leaderboard (a list of high-scoring players) for each hero. In Task 2, the student creates the database and uses Java and SQL to implement the insertion of scores. Finally, in Task 3, the student combines the queries from Task 1 into the Java code from Task 2. The program displays the high scores and the leaderboards so the players can see how they stack up to the competition.
The queries in Task 1 offer a range of
challenge, so students at different levels can participate as they are able.
For Task 3 I provide solutions to Task 1 so that everyone can gain experience
embedding SQL into Java.