You are on page 1of 31

AY 2021-2022

INFORMATION
MANAGEMENT

Prepared By:

Prof. Jomariss B. Plan, MSIT, SMRIIT


CCS Faculty
Data Types and
Database Principles
Learning Outcome
At the end of the topic session, the students should be
able to:

• Identify data types and explain the design view and


primary keys.
• Analyze the database design principles.
 Data types define what type of data a column can
contain.
 Each column in a database table is required to have a
name and a data type.
CHARACTER [(length)] or CHAR [(length)]
 The CHARACTER data type accepts
character strings, including Unicode, of
a fixed length. The length of the
character string should be specified in
the data type declaration; for example,
CHARACTER(n) where n represents the
desired length of the character string.
If no length is specified during the
declaration, the default length is 1.
CHAR(10) or CHARACTER(10)
•Valid
'Race car'
'RACECAR'
'24865'
'1998-10-25'
'1998-10-25 ' (Blank characters are truncated)
•Invalid
24865
1998-10-25
'Date: 1998-10-25'
VARCHAR (length)
 The VARCHAR data type accepts character
strings, including Unicode, of a variable length is
up to the maximum length specified in the data
type declaration.
 A VARCHAR declaration must include a positive
integer in parentheses to define the maximum
allowable character string length. For example,
VARCHAR(n) can accept any length of character
string up to n characters in length.
Varchar Examples:
VARCHAR(10) or CHARACTER(10)
•Valid
'Race car'
'RACECAR'
'24865'
'1998-10-25'
'1998-10-25 ' (Blank characters are truncated)
•Invalid
24865
1998-10-25
'Date: 1998-10-25'
Boolean
 The BOOLEAN data type supports the storage of
two values: TRUE or FALSE. No parameters are
required when declaring a BOOLEAN data type.

Valid Invalid
TRUE 1
true 0
True Yes
False No
Integer or int
 The INTEGER data type accepts numeric values
with an implied scale of zero.
 It stores any integer value between the range 2^
-31 and 2^31 -1
Valid Invalid
-2147483648 -1,025,234,000,367
-1025 -2147483649
2147483648
0
1,025,234,000,367
1025.98 (digits to the
right of the decimal
point are truncated)
2147483647
Date
 The DATE data type accepts date values. No
parameters are required when declaring a DATE
data type. Date values should be specified in the
form: YYYY-MM-DD.
 Month values must be between 1 and 12, day
values should be between 1 and 31 depending
on the month and year values should be
between 0 and 9999.
Examples

Valid
DATE '1999-01-01'
DATE '2000-2-2'
date '0-1-1'

Invalid
DATE '1999-13-1'
date '2000-2-30'
'2000-2-27'
date 2000-2-27
Time
 The TIME data type accepts time values. No
parameters are required when declaring a TIME
data type. Time values should be specified in
the form: HH:MM:SS
 The minutes and seconds values must be two
digits. Hour values should be between zero 0
and 23, minute values should be between 00
and 59 and second values should be between 00
and 61.999999.
Examples

Valid
TIME '00:00:00'
TIME '1:00:00'
TIME '23:59:59'
time '23:59:59.99'
Invalid
TIME '00:62:00'
TIME '00:3:00'
TIME '23:01'
'24:01:00'
Design View
Most Access objects are displayed in
Design view, which allows you to work with
the underlying structure of your tables,
queries, forms, and reports. To create a
new table in Design view, you define the
fields that will comprise the table before
you enter any data.
In Design view for tables, each row
corresponds to a field. You can edit, insert,
and delete fields in your database tables in
Design view. You insert a field by adding a
row, while you delete a field by removing a
row. You can also change field order by
dragging a row selector to a new position.
How to Create a Table in Design View
in Access 2016
Database Design
Designing a database is a process that
involves developing and refining a
database structure based on the
requirements of your business.
Database design includes the following
three stages:
1. Conceptual
2. Logical
3. Physical
Conceptual Design
The purpose of the conceptual design
phase is to build a conceptual model
based upon the previously identified
requirements, but closer to the final
physical model. A commonly-used
conceptual model is called an entity-
relationship model.
Entities and Attributes
Entities are basically people, places, or
things you want to keep information
about.
For example, a library system may have
the book, library and borrower entities
The following are examples of entities
involving a university with possible attributes
in parentheses.
Course (name, code, course prerequisites)
Student (first_name, surname, address, age)
Book (title, ISBN, price, quantity in stock)
Logical Design
This is the process of deciding how to
arrange the attributes of the entities in
a given business environment into
database structures, such as the tables
of a relational database.
Physical Design
Physical ERD represents the actual design
blueprint of a relational database. It
represents how data should be structured
and related in a specific DBMS so it is
important to consider the convention and
restriction of the DBMS you use when you
are designing a physical ERD.
References:

http://www.cs.toronto.edu/~nn/csc309-
20085/guide/pointbase/docs/html/htmlfiles/dev_datatypesandconversionsFIN.html

https://www.quackit.com/microsoft_access/microsoft_access_2016/tutorial/create_a
_lookup_table_in_microsoft_access.cfm

https://www.visual-
paradigm.com/support/documents/vpuserguide/3563/3564/85378_conceptual,l.html

E-BOOK: Database Concepts

You might also like