19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TABLE 11.5(B)<br />

TABLE 11.5(C)<br />

course section time<br />

CS102 1001 MWF 8–9<br />

CS102 1002 MWF 1–2<br />

CS102 1003 MWF 2–3<br />

CS102 1004 MWF 3–4<br />

CS105 1001 MWF 1–2<br />

course name credits prerequisite<br />

CS102 Intro to Databases 3 CS101<br />

CS105 <strong>Visual</strong> <strong>Basic</strong> 4 CS200<br />

Avoid tables with intentionally blank entries.<br />

Tables with entries that are intentionally left blank waste space <strong>and</strong> are inefficient to use.<br />

Table 11.6, which serves as a directory of faculty <strong>and</strong> students, has an excessive number of<br />

blank entries. The table should be split into two tables, each dealing with just one of the<br />

groups.<br />

TABLE 11.6<br />

A Table with an Excessive Number of Blank Entries<br />

name ssn classifi- date office credits<br />

cation hired dept number gpa earned<br />

Sarah Brown 816-34-9012 student 3.7 78<br />

Pat Riley 409-22-1234 faculty 9/1/90 biology Y-3014<br />

Joe Russo 690-32-1108 faculty 9/1/88 math T-2008<br />

Juan Lopez 509-43-4110 student 3.2 42<br />

Strive for table clarity.<br />

Each table should have a basic topic <strong>and</strong> all the data in the table should be connected to that<br />

topic.<br />

Don’t let a table get unnecessarily large.<br />

A bookstore might keep a permanent record of each purchase for the purpose of targeting<br />

mailings. A better solution is to add a couple of extra fields to the customer table that identify<br />

the types of books of interest to the customer.<br />

Avoid fields whose values can be calculated from existing fields.<br />

A calculated field is one whose value can be determined from other fields. For instance, if a<br />

table has fields for both the population <strong>and</strong> area of a state, then there is no need to include a<br />

field for the population density.<br />

COMMENTS<br />

Creating <strong>and</strong> Designing Databases 349<br />

1. <strong>Visual</strong> Data Manager can not create foreign keys.<br />

2. You can add additional fields to a database table, but you cannot rename, modify,<br />

or delete fields without deleting the entire table <strong>and</strong> rebuilding each field.<br />

For this reason, design your tables carefully.<br />

3. The total length of a record in a table is limited to 2000 bytes.<br />

4. Be careful if you create a database with empty tables. If you pull it into a program<br />

<strong>and</strong> try to move through it with the navigator arrows, an error will be generated.<br />

You must add at least one record before starting to navigate.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!