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

DATABASE MANAGEMENT SYSTEM

Introduction

▪ Database has a data model that determines the manner in which data can be
stored,

organized, and manipulated in the database.

3.1 Overview of Relational Database Management System

▪ The term Relational Database Management System (RDBMS) usually refers to

various types of software systems developed in order to manage databases.

▪ RDBMS is used to create, maintain, and provide controlled access to a relational

database.

▪ A relational database is based on a relational data model.

▪ Data are stored in a two-dimensional table, which contains columns or fields and

rows or records.

▪ Each column of a table represents an attribute or data value, and each row in a
table

represents a tuple or record.

▪ Attributes are the set of properties to describe the instances of the entity.

For example, a student can be an entity.

▪ The attributes of a student can be described in terms of student id, name, age,
grade

level and sex.

▪ A record is a row or a tuple in the table.

▪ It contains a single data value in each column.


▪ Each field in a table has to be given a name and data type.

▪ A data type is the type of data value you want to store in the field.

Examples of data types include CHAR,TEXT, INTEGER(INT), DATETIME,

CURRENCY. COUNTER, Yes/No

▪ In the database, the data type best describes the fields in the table.

▪ All Database Management System(DBMS) provide data types from which to select

and use to define the data type for fields of a table.

▪ In relational database, each table that has a key field (primary key) uniquely

identifies each record.

▪ This key field can be used to create relationship and link one table of data to
another.

▪ Relational databases are the most popular databases have been widely used for
more

than four decades.

Examples of popular RDBMs include Microsoft Access, Oracle, Microsoft SQL Server,

MySQL, SQLite, IBM DB2, and PostgreSQL.

3.2 Database Manipulation Using SQL

▪ SQL (Structured Query Language) is a standard language for accessing and

manipulating a database.
SQL is a special-purpose query language meant for interacting with relational

databases such as Microsoft Access

Based on their purposes, three categories of SQL commands are presented

I. Data Definition Language (DDL): DDL contains commands that allow you to
create or modify tables and establish relationship between tables in your database

structure.

II. Data Manipulation Language (DML): DML contains commands that are used to

manage the database by performing operations such as inserting, updating,

deleting, and navigating through data.

III. Data Query Language (DQL): is used for querying or selecting all or subsets of

data from a database.

3.2.2 Data Definition Language (DDL)

▪ DDL is part of SQL that is used to create and restructure a database.

Some of the most fundamental DDL commands include :

✓ CREATE TABLE,

✓ ALTER TABLE, and

✓ DROP TABLE

I. CREATE TABLE Command - is used to create a new table in a database.

II. ALTER TABLE Command - Once a table is created, it can be modified using the

ALTER TABLE command.

▪ Using the ALTER command, you can add column(s), drop column(s), and change

column definitions.

▪ It is also used to establish relationship between tables.

III. DROP TABLE Command -

▪ Dropping a table is actually one of the easiest thing to do.

▪ Use the DROP TABLE command to delete the table already created.
▪ Remember that if you delete a table with record, you cannot get it back!

▪ Alternatively, you can create a relationship using graphical database tool in MS

Access.

▪ A relationship in MS Access helps you combine data from two or more different

tables.

▪ Each relationship consists of fields in two tables with corresponding data.

▪ The relationship can be one-to-one, one-to-many, or many-to-many


Note that

▪ all related tables have a common data item (key field) that enables information

stored in one table to be linked with information stored in another.

3.2.3 Data Manipulation Language

▪ Data Manipulation Language (DML) consists of commands that allow you to

manage the database by performing operations such as inserting, updating,

deleting, and navigating through data.

▪ The DML commands include

✓ INSERT,

✓ UPDATE and

✓ DELETE.

I. INSERT Command - helps to insert new records to a table.

II. UPDATE Command - The UPDATE command does not add new records to a

table, nor does it remove records.

▪ It simply updates existing records in the table.


▪ The UPDATE command is used to change a value of one or more fields in

an existing table row or number of rows.

III. DELETE Command - The DELETE command is used to delete a record or

multiple records from the database.

▪ DELETE command does not remove the table structure, rather it only deletes the
data

that is currently being held by the table structure.

3.2.4 Data Query Language (SELECT Command)

▪ Data Query Language (DQL) is a data query language for relational DBMSs.

▪ It provides a SELECT command for querying all or subset of records from one or

more tables of a database.

▪ The SELECT command provides options for filtering and getting more meaningful

results from the database.

▪ The level of flexibility that is given by SQL is one of the reasons it has succeeded as
a

query language in relational DBMSs.

▪ A SELECT command is used to write the SQL statement that contains a complete

description of a set of data that you want to obtain from a database.

▪ SQL statement has clauses.

▪ Each clause performs a function for the SQL statement.

▪ Some clauses are required in a SELECT statement.

Basic SQL Clauses:

✓ SELECT,
✓ FROM, and

✓ WHERE
SELECT SQL statement takes the general form as follows:

SELECT field1, [field2]

FROM table

[WHERE criterion];

▪ [WHERE criterion] is an optional clause.

▪ It can be used to filter the output that is returned by the FROM clause.

Review Questions

1. Which one of the following is generally used for performing tasks like creating the

structure of the relations?

A. Query

B. Relational Schema

C. DML(Data Manipulation Language)

D. DDL(Data Definition Language)

2. Which one of the following provides the ability to insert tuples into, delete tuples
from,

and modify tuples in the database?

A. Query

B. Relational Schema

C. DML(Data Manipulation Language)

D. DDL(Data Definition Language)

3. A Database Management System is a type of_________ software.


A. system B. application

C. general D. Both A and C

4. Which one of the following is a type of Data Manipulation Command?

A. CREATE B. DELETE

C. ALTER D. All of the above

5. Which of the following command is a type of Data Definition language command?

A. CREATE B. UPDATE

C. DELETE D. MERGE

6. Which one of the following commands is used to remove the existing row in a
table

A. DELETE B. UPDATE

C. INSERT D. None of the above

7. Which language is used by most DBMS for helping its users access data?

A. HLL B. Query language


8.Microsoft Access is a______.

A. Network Database Model B. RDBMS

C. ORDBMS D. OODBMS

You might also like