Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

The Basic Elements of Database:

DATABASE - is a collection of information that is organized so that it can easily be


accessed, managed, and updated.

Sample of Database name: "PSBA Database"

This database name contains school information like students, teachers,


books, department, etc.

1. TABLE - every database consist of one or more tables, which stores


databases data/ information. Each table has its own unique name and
consists of columns and rows.

C
R O W

Ex.: Table name: "student table"

This table contains information about students and books.

2. FIELD The database table columns (called also table fields) have their own
unique names and pre-defined data types.

Example: Column or fields for the table name students are given below.

Student ID, First name, Last Name, Address, City

STUDENT TABLE
Student ID First Name Last Name Address City

3. RECORDS The table records contain the actual data for the colmuns

Ex.: 001, Marlon, Angelo, #125 St. Manila

Student ID First Name Last Name Address City


001 Marlon Angelo #125 St. Manila
002
003
4. DATA TYPES determine the type of data that can be stored in a database
column.

THREE (3) COMMONLY USED DATA TYPES:

Alpha numeric used to store characters, numbers, special


characters or nearly any combination.
Numeric used to store only numeric data/ values.
Data type used to store date and time value.

5. KEYS is a column value in a table that is used to either uniquely identify a


row of data in a table, or establish a re;ationship with one another table.

TWO (2) TYPES OF KEYS

Primary key are typically used to join related tables.


Foreign key used as a reference of a primary key in another table.

Illustration:

AUTHORS TABLE
Authors Name Email Biograph
ID y

BOOKLIST TABLE
Book ID Title Authors Cost Category Descripti
ID on

6. RELATIONSHIPS are established through the use of primary and foreign


keys.

Three types of table relationships that can be derived are as follows:

One-to-one one record in a table is related to only one record in


another table.
One-to-many one record in a table can be related to many
records in another table.
Many-to-many one record in a table can be related to one or
more records in another table, and one or more records in the
second table can be related to one or more records in the first
table.

ONE-TO-ONE

Table 1 Table 2
ID Value ID Value
1 A 1 A
2 B 2 B

ONE-TO-MANY

Table 1 Table 2
ID Value ID Value
1 A 1 A
2 B 2 B

MANY-TO-MANY

Table 1 Table 2
ID Value ID Value
1 A 1 A
2 B 2 B

You might also like