Lab 13
comp 125-609, Goldwasser
Tuesday, 30 November 1999

Purpose: Relational Databases and SQL
Before beginning the lab, you will want to save the file www.cs.luc.edu/~mhg/comp125/labs/MEGACTY2.MDB to a local disk.

Also, you will use the Microsoft FlexGrid Control in this program. The FlexGrid control does not initially appear in your Toolbox. To add the control, click on the Components in the Project menu, click the Controls tab, and click on the check box to the left of "Microsoft FlexGrid Control 6.0." Then press the OK button.


There are two parts to this lab. In the first part, you are to create a program similar to the one used during lecture. Start by setting the following properties:
Control Property Setting
Form Width 8295
Height 3810
Data Name datCities
Visible False
DatabaseName MEGACTY2.MDB
FlexControl DataSource datCities
FixedCols 0
Width 7935
Height 2775
Top 120
Left 120
CommandButton Caption Update
Width 1215
Height 285
Top 3000
Left 120
TextBox Name txtQuery
Text "SELECT * FROM Cities"
Width 6615
Height 285
Top 3000
Left 1440


Then create an event handler for the command button with the following two commands:
  datCities.RecordSource = txtQuery.text
  datCities.Refresh

In the second part of the lab, you are to solve Exercises 19-28 of chapter 5.4 (see page 296). You should use your program to verify your answers. Please record the solutions to each problem below:

19. ____________________________________________________

20. ____________________________________________________

21. ____________________________________________________

22. ____________________________________________________

23. ____________________________________________________

24. ____________________________________________________

25. ____________________________________________________

26. ____________________________________________________

27. ____________________________________________________

28. ____________________________________________________


This lab is due before leaving class today. When you are done, please call me over to check your answers.
For your convenience, here are the two tables which are included in the database Megacty2.

city country pop1995 pop2015
Beijing China 12.4 19.4
Bombay India 15.1 27.4
Calcutta India 11.7 17.6
Los Angeles USA 12.4 14.3
Mexico City Mexico 15.6 18.8
New York USA 16.3 17.6
Sao Paulo Brazil 16.4 20.8
Shanghai China 15.1 23.4
Tianjin China 10.7 17.0
Tokyo Japan 26.8 28.7

country pop1995 currency
Brazil 155.8 real
China 1185.2 yuan
India 846.3 rupee
Indonesia 195.3 rupiah
Japan 125.0 yen
Mexico 85.6 peso
Nigeria 95.4 naira
Russia 148.2 ruble
USA 263.4 dollar