-- This file is part of the End-to-End Ajax development article in -- the IBM developerWorks. This file contains a simple DB script to -- create a database and populate it with the data. -- -- Last Modified: May/10/2007 -- -- To execute the following statements in MySQL, do the following steps. -- 1) Start MySQL command line client. -- 2) Enter your MySQL admin password. -- 3) Type the following line by substituting <YOUR_SQL_FILE_DIR> with the -- directory name where the file is stored. -- source <YOUR_SQL_FILE_DIR>\bankdb.sql -- -- Table structure for table 'BankDB' -- DROP DATABASE BankDB; CREATE DATABASE BankDB; USE BankDB; CREATE TABLE account ( AccountHolderName VARCHAR(20) NOT NULL, AccountNumber INTEGER NOT NULL, CheckingBalance DOUBLE NOT NULL, StockName VARCHAR(6), StockQuantity INTEGER, StockValue DOUBLE, PRIMARY KEY(AccountHolderName, AccountNumber) ); -- -- Populating data for table 'account' -- insert into ACCOUNT values ('Frodo', 435245, 2344.45, 'GOOG', 100, 3453.32); insert into ACCOUNT values ('Sam', 928462, 7583.32, 'CSCO', 200, 5323.43); insert into ACCOUNT values ('Pippin', 234233, 3444.62, 'INTC', 300, 4213.76); insert into ACCOUNT values ('Merry', 642445, 1005.32, 'MSFT', 250, 1353.32); insert into ACCOUNT values ('Aragorn', 972321, 6424.24, 'HPQ', 525, 12043.94); insert into ACCOUNT values ('Gandalf', 432134, 5392.23, 'IBM', 400, 10043.78); insert into ACCOUNT values ('Legolas', 590134, 4313.82, 'DELL', 325, 5926.62); |