BaseNow

 

  Search
   

  Help

Screen shots

Compare editions

Online help

Quick-start videos

System requirements

License agreement

Known issues

  Support

 Forums

Technical support

Feedback

 About the author

 Company

Contact

Privacy policy

  Features

BaseNow architecture

Database tools

BaseNow Agent

Tables and views

SQL Query Builder

Import/export data

  Subscribe

Stay informed about any major changes. Click here to subscribe

 

How to create relationships between tables

Every table should describe only one type of objects. For instance, the Employees table contains the data about employees, their names, addresses, telephone numbers, and any other relevant data. The Customers table contains only the data that are logically related to customers. It goes without saying that the data about employees will not be kept in the Customers table. In case it is necessary to have some link between the employees and the customers, the best solution would be to create a brand new table called CustomersEmployees. Instead of complete records, this new table will contain only unique IDs from both tables.

The same logic can be applied to the example below. In this case, the Orders table should contain data about orders. The data about the customer and about the employee who has sold the product to the customer should be entered into this table.

Tables

Columns

Employees

EmployeeID
FirstName
LastName
HireDate
Title

Customers

CustomerID
ContactName
Address
Country
Phone

Orders

OrderID
CustomerID
EmployeeID
OrderDate

The data about every order will be entered in the Orders table. All three tables need to be connected so that the data from ID (primary key) columns from each table are kept in the Orders table, without entering all the data about customers and employees. This is achieved by setting the relationships between the tables. The Relationships Manager tool is used to accomplish this task. For the purpose of simplicity, the number of columns in each of the tables in the figure above has been reduced to minimum.

Create relationships.avi  (cannot see the video? click here)


Related Topics:

About relationships in a database

About Relationships Manager

About primary keys

How to create a table

How to change columns in an existing table

How to index a column

[Home] [Download] [Screen Shots] [Details] [Support] [Purchase]

Copyright © 1997-2005 Gate Comm Software. All Rights Reserved.

 

 

News
7/13/2004
COMDLG32.OCX error at startup
6/29/2004
Opening FoxPro and dBase databases
1/11/2024
Version 1.1.7 Relased (1/11/2024)
11/18/2002
Version 1.1.0 Relased (11/16/2002)
10/20/2002
HotFix 1 for Windows XP SP1

Forums
8/10/2024
removing duplicate records
8/8/2024
data validation and BaseNow
1/24/2007
Outlook 2003
1/12/2024
BASENOW AND FOXPRO DATE FORMATS
11/6/2024
Need help in Sybase Anywhere database
10/19/2006
need help! mysql query
6/21/2006
Compare SQl fields
6/8/2024
Error