HPlogo Getting Started with HP IMAGE/SQL: HP 3000 MPE/ iX Computer Systems > Chapter 2 Basic Concepts

What Is a Relational Database?

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

A relational database is a collection of data arranged in tables, also known as relations. Tables are subject to the following relational operations, each of which lets you retrieve data in a specific way:

  • Selection, which lets you extract a subset of rows.

  • Projection, which lets you extract a subset of columns.

  • Joining, which lets you extract from more than one table at a time.

In practice, these operations frequently appear together. An SQL statement that uses these operations is known as a query. Three queries that use the SQL SELECT statement to illustrate selection, projection, and joining are shown in Figure 2-1.

Figure 2-1 Relational Operations

[Relational Operations]

Rows and Columns

When you look at data in relational terms, you can assume several things:

  • Tables are arranged in rows and columns, which are like records and fields in an ordinary file.

  • Each column has a specific data type and size.

  • Each row contains one element for every column.

Sample Database Table

The following is a portion of a database table consisting of names and account balances for an employee credit union:

Table 2-1 Employee Accounts

Last NameFirst NameTelephoneEmployee NumberBalance
HarrisonGerald72332432099142.59
AbelsonAnnette431235100442345.09
StanleyPeter12353540011321.98
WaltersGeorgia255491247721230.10

 

Each column can accept data of a specific type and size. Refer to Chapter 3, "Moving from TurboIMAGE/XL to IMAGE/SQL," for more details on data types.

Using Several Tables

You can put the same data into several different tables, as shown below:

Table 2-2 Table 1. Employees Table

Last NameFirst NameEmployee Number
HarrisonGerald2432099
AbelsonAnnette3510044
StanleyPeter3540011
WaltersGeorgia9124772

 

Table 2-3 Table 2. Telephone Table

Last NameFirst NameTelephone
HarrisonGerald7233
AbelsonAnnette4312
StanleyPeter1235
WaltersGeorgia2554

 

Table 2-4 Table 3. Accounts Table

Employee NumberAccount Balance
2432099142.59
35100442345.09
3540011321.98
91247721230.10

 

You decide which arrangements of data work best for you by using the processes of data analysis and database design.

In data analysis, you investigate the various ways your data can be used. In database design, you create specific table structures based on your analysis. The design phase results in a set of table descriptions, known as a schema, for your database.