You are on page 1of 11

Database Management System I

Microsoft SQL Server - Querying


Course for IT2
Lesson 1 Introduction
(Database Concepts)

Prepared by: Mr. Dan Chua

What is a Database?
The definition of a database
- it is a structured collection of records or data that is stored in a computer system.
- it is a tool for collecting and organizing information.
- In other words, it serves as a container of objects, think of it as an electronic filing
cabinet
Main Characteristics:
It can store large amounts of records such as information about people, products, orders,
or anything in textual or image form.
It allows users to retrieve or access data or information easily and quickly.
It can provide data security or protection.
Basic Structure of a database
field or attribute smallest unit of information
records collection of fields related to a particular object
files or tables collection of related records.
Example:

Fields (name, course, address)


Record Student information
File or Table Student List

Relational Database Management System (RDBMS)


- Invented by Edgar (Ted) F. Codd,
father of Relational Database (Relational Model of Data),
at IBM Research Laboratory at San Jose, Calif., 1923-2003
- It is a two-dimensional table, which consists of a unique set of rows (tuple)
and columns (attributes)
- Codd introduced Database Normalization (1st to 3rd Normal Form)
- Data are stored in tables and that relationships would exist between the
different data sets or tables.
- Stored data is manipulated using a programming language called SQL,
Structured Query Language
- SQL Operations (DMLs) include Select, Insert, Update and Delete
- Major companies that developed and implemented RDBMS
Oracle Oracle RDBMS (1979)
IBM DB2 (1982)
Microsoft SQLServer (1992)

Characteristics of a Relational Models


Relational databases are organized as tables
Each table can have many rows
Each row can have many columns/attributes
Each table has its own primary key
A primary key must be unique
Keys are commonly used to join or combine data from
two or more tables.

Primary Key
To qualify as a primary key, an attribute must have
the following properties:

It must have a non-null (not empty) value


for each instance of the entity
The value must be unique for each
instance of an entity
The values must not change or become
null during the life of each entity instance

Candidate Key
Any key or minimum set of keys that could be a
primary key is called a candidate key.
Example:

Employee ID, SSS No., TIN


Candidate keys not chosen as PK is known as
Alternate Keys

Foreign Key
It completes a relationship by identifying the
parent entity.
It provides a method for maintaining integrity in
the data
(called referential integrity)
Every relationship in the model must be
supported by a foreign key.

Example of Relationships showing PKs & FKs


PK
PK

FK

FK
FK

PK
FK

PK

Table Relationships
To prevent the duplication of information in
a database by repeating fields in more
than one table
Table relationships can be established to
link fields of tables together.

Types of Relationships
One-to-One Relationship
(one student, one course)

One-to-Many Relationship
(one course, many students)

Many-to-Many Relationship
(many teachers, many students)

End of Lesson 01
(Introduction Database Concepts)

You might also like