ToyBank has branches spread throughout the country that provide banking services to the public. In particular, customers can open a money account or take out a loan at any of the branches. Money accounts can have multiple owner in which case we say that it is a jointly owned account. Loans can have only one customer who owns it.
This diagram (JPG) provides the UML class diagram and relational database scheme diagram for the ToyBank database.
I provide two database scripts, one to create a MySQL database and one for use to create an Apache Derby database. Both scripts create the tables and insert some data into each table.
In the sample ToyBank queries script (a script to be run with the Derby database, although the SQL statements will work on the MySQL database) you will find some sample queries that retrieve information from the ToyBank database. Additional examples will be provided as we learn new query concepts.
You can load data into tables from a file using MySQL's LOAD DATA command. In this directory, you will find the files that I used to create the ToyBank database tables and to load each of the tables with data. The most important file is ToyBankLoadDataScript.sql as it contains the commands that will load the data from the files to the tables.