Review Questions


What is a database?


A database is a collection of related data.


What is the general structure of a database?


Think of a database as a shell within which are one or more tables. Each table is comprised of columns , called fields. Each field represents a data item. Common field names might be SSN , FirstName , LastName , Address , City , State , and Zip . If you fill in each field for one row of the table, that row becomes a database record. Usually, the data that comprise each record is unique.


What is a primary key and what is its purpose?


A primary key is a field that has an unduplicated value for each record in the table. In some cases, the primary field is actually two fields. By having a unique primary key in one table, it's possible to use that key in other, related tables for purposes of searching the related tables. A common example of a primary key is a customer ID number in a Customer table, which can then be used to identify all purchases by the customer in the Orders table. In other words, the primary key in the Customer table is used to define a relationship between that table and the Orders table.


Explain what the lines are that appear between the tables shown in Figure 24.1.


The lines between the tables show how the primary keys are used in other tables. In each case, the primary key is displayed in boldface print. The lines represent how the tables are related to each other. For example, the field named Customer ID is the primary key in the Customer table. However, the Customer ID field is also present in the Orders table, and a line connects the field in the two tables. Therefore, we can search the Orders table and find who placed the order by following the Customer ID number in the Orders table back to the Customer table.


Write an SQL statement that selects every customer from the Customers table who lives in the 46220 ZIP Code and presents them in alphabetical order based on their last name . You can assume that the field names are LastName and ZipCode .


The SQL statement would be

 SQL = "SELECT LastName,ZipCode FROM Customers WHERE "  SQL += "ZipCode = 46220 ORDER BY LastName" 

What is the primary purpose of the Connection object?


The purpose of the Connection object is to provide the information necessary to establish a link between Visual Basic .NET and the database. The two most important properties of the Connection object are the Provider and Data Source parameters of the connect string. These two parameters tell the type of database being used and where to find it.


What is the purpose of the Data Adapter object?


The Data Adapter object enables us to control the data associated with the database. It is from the Data Adapter that we derive the datasets that contain the actual data used in a program.

Visual Basic .NET. Primer Plus
Visual Basic .NET Primer Plus
ISBN: 0672324857
EAN: 2147483647
Year: 2003
Pages: 238
Authors: Jack Purdum

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: