Database Basics

 

Relational databases are made up of a collection of tables which store data.  It's helpful to think of each table as being similar to a spreadsheet.  When you design your table, you define the columns or fields that it will contain.

 

For example, the staff table design shown above will contain information about employees of a company. Each row will store the information for one employee. Below, is the Staff table filled with sample data:

 

 

Staff_ID

Staff_Name

1

Joe Smith

2

Amy Davis

3

Ahmed Aziz

 

How do I create a new database in my Visual Case project?
How do I set up a table?
How do I set up columns?

Primary Keys:

A well-designed table always has a primary key consisting of one or more columns that are unique to each row in the table. In the staff table above, the Staff_ID is the primary key column.  This means that each record in the table will be uniquely defined by a Staff_ID.

 

In the case above, the Staff_ID is set up as an autonumber field which means that the database system will be responsible for assigning unique values for each record.

 

How do I set up a primary key?

Indexes:

Indexes make it faster to find and sort the information stored in a table.

 

How do I set up an index?
Tell me more about indexes.

Referential Integrity

By correctly applying referential integrity rules in your database design, you can prevent inconsistent data from being entered into the database. This is accomplished by setting up a relationship, called a foreign key, between two tables.

 

How do I set up a foreign key?
Tell me more about foreign keys.

 

Related Topics: