You are on page 1of 1

Hello I going to explain

Basics concepts of database

Database is a collection of data organized in some manner so that information within the database can be
easily retrieved.

A simple example of database is a telephone directory

The databases are composed of the following structure

Field (Column) .- Is a single piece of information


Record (Row).- Is a collection of related fields
Table (File): A collection of related records

When we start thinking of constructing the various tables that our database requires, we need to consider how
we will organize these tables and relate them to one another. For the most part, this will be done using keys.
There are 2 types of keys in a table.
Primary Key: a value that is unique to each record
Foreign Key: a primary key of one table included in another table

Type of data

CHAR: Fixed occupation with a length of 1 to 255 characters.

VARCHAR: Variable occupation whose length comprises of 1 to 255 characters.

DATE: Valid to store a date with year, month and day, its range is between '1000-01-01' and '9999-12-31'.

DATETIME: Stores a date (year-month-day) and an hour (hours-minutes-seconds), its range is between '1000-
01-01 00:00:00' and '9999-12-31 23:59: 59 '.

TIME: Valid to store one hour (hours-minutes-seconds). Its range of hours ranges from -838-59-59 and 838-
59-59. The stored format is 'HH: MM: SS'.

INT (INTEGER): 4 bit occupation with values between -2147483648 and 2147483647 or between 0 and
4294967295.

DECIMAL (NUMERIC): Stores floating-point numbers as strings or string.

FLOAT (m, d): Stores floating-point numbers, where 'm' is the number of digits in the integer part and d is the
number of decimal places.

DOUBLE (REAL): Stores floating-point number with double precision. Like FLOAT, the difference is the range
of possible values.

BIT (BOOL, BOOLEAN): Integer with value 0 or 1

Exercise

Creating a database to store the personal information of the BIS campus students, which contains two tables,
the first one must contain the data such as name, employee number, telephone number and current address.
The sencond must contain degree of studies, place of origin and school where graduated

You might also like