2. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-2
Primary Concept of Database
1. What is Data?
The word data is the plural number of latin
word Datum.
The unordered events that’s are used for
processing are called data.
Data is the formation of character, number &
symbol.
3. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-3
Primary Concept of Database
Types Of data
There are mainly three types of Data
1. Numeric
2. Non Numeric
3. Boolean data
4. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-4
Primary Concept of Database
Types Of data
Data
BooleanNumeric
ObjectStringCharacter
FalseTrue
Floating PointInteger
Non-Numeric
5. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-5
Information
Information is the orderly and useful arrangement of
data so that they are accurate,timely,complete and
concise.
Primary Concept of Database
Roll Name Section
01 Rahim Electron
02 Moli Proton
03 Kamal Neutron
Information
Data
Data
Data
6. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-6
Differences Between data and Information
Data Information
1.Data is the Single unit of
Information.
1.Information is orderly and
useful arrangement of Data
2. Data is unprocessed facts
figures.
2. Information is processed data.
3. Data doesn’t depend on
Information.
3. Information depends on data.
4. Data is not specific. 4. Information is specific.
5. Data doesn’t carry a meaning. 5. Information must carry a
logical meaning.
6. Data is the raw material. 6. Information is the product.
7. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-7
Primary Concept of Database
Data Hierarchy
Data hierarchy refers to the systematic
organization of data, often in a hierarchical form.
Data organization involves bit, characters, fields,
records, files and so on.
9. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-9
What is database?
A Database is a collection of Related data.
Advantages of Database
• Reduced data redundancy
• Reduced updating errors and increased consistency
• Greater data integrity and independence from applications
programs
• Improved data access to users through use of host and query
languages
• Improved data security
• Reduced data entry, storage, and retrieval costs
• Facilitated development of new applications program
10. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-10
What is DBMS?
• A database management system (DBMS) is
system software for creating and managing
databases.
• A Database Management System(DBMS) is a
set of computer programs that controlls the
creation,maintenance, and the use of Database.
11. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-11
Software of DBMS
Oracle
dBASE
FoxPro
MS Office Access
My SQL
SQLite
FileMaker
Firebird. …………..etc
12. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-12
Fundamental Function of DBMS
• Create new Database
• Include Record in Database
• Update Record
• Delete wrong or redundant Data/Record.
• Data searching.
• Data Query.
• Data sorting.
• Data Indexing.
• Data Dictionary Management.
• Data Storage Management.
• Security Management.
• Multi User Access Control,
• Backup and Recovery Management,
13. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-13
Application and Uses of Database
Management System (DBMS)
• Education sector:
• Banking System:
• Industry:
• Telecommunications
• Railway Airlines Reservation System
• Hospital management
• Library Management System
• Human Resource Management
14. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-14
Field Type /Data Type in Database.
There are 10 types of Field or Data in Database.
1. Text/Character
2. Auto Number
3. Number/Numeric
4. Logical/Yes or No
5. Date/Time
6. Memo
7. Currency
8. Object linking and embedding
9. Hyperlink
10. Lookup Wizard
15. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-15
Key Field
Question: What is Key Field? Discuss various
types of Key Field.
Ans:
The field which is used for identifying the record of file
and database.
Three types of Key Field
1. Primary Key Field.
2. Composite Primary Key Field.
3. Foreign Key Field.
16. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-16
(Primary Key Field).
What is Primary Key Field?
A field in a record that holds unique data which identifies that record from
all the other records in the file or database.
Ex: Student id ,Account number, product code are typical key fields
Student Id Name GPA
1001 Rita 5.00
1002 Mita 4.75
1003 Rita 4.50
1004 Nita 5.00
Primary Key Field
17. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-17
Composite Primary Key Field
A composite key is a set of more than one key that,
together, uniquely identifies each record.
Roll Class GPA
1001 Seven 4.50
1004 Eight 4.80
1005 Nine 5.00
1001 Ten 4.75
1002 Eleven 4.00
Composite Primary Key Field
18. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-18
Foreign Key Field.
If a primary key field of one table is used as normal field of
another table then the field is called Foreign Key Field.
Roll St_Name SSC GPA
1001 Poli 5.00
1002 Moli 4.50
1003 Doli 4.75
Reg_No Roll HSC GPA
5225 1001 5.00
5227 1002 5.00
5228 1003 5.00
Student Admission Table Result Table
Primary key Foreign key
19. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-19
RDBMS
What is RDBMS ?
The Full name of RDBMS is Relational Database
Management System.
A relational database management system (RDBMS)
is a program that lets a user to create, update, and
administer a relational database.
In 1970 Edgar F. Codd, Invented RDBMS.
20. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-20
Query
What is Query ?
The process of retrieving data from database according to
condition is called Query .
A database Query is a piece of code constructed using SQL(A
high level Programming Language).
Classification of Query:
1. Select Query
2. Parameter Query
3. Crosstab Query
4. Unmatched Query
5. Action Query
Append Query
Update Query
Delete Query
Make table Query
21. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-21
Query Language
What is Query Language?
The language which is used to insert data,Modify data,update
data,maintain data,delete date,retrieves data from Database is
called Query Language.
According to Data manipulation Query Language are
classified as…
1.QUEL(Query Language)
2.QBE(Query By Example)
3.SQL(Structured Query language)
22. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-22
SQL(Structured Query language)
The commands of SQL are written by two methods.
1. DDL(Data Definition Language)
2. DML(Data Manipulation Language)
23. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-23
DDL(Data Definition Language)
What is DDL ?
Data Definition Language (DDL) is a standard for commands
that define the different structures in a database. DDL
statements create, modify, and remove database objects such
as tables, indexes, and users.
Common DDL statements are
CREATE, RENAME,ALTER, and DROP
24. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-24
SQL Statement by using DDL.
Create a new table by using SQL CREATE statement.
CREATE TABLE student_Informations
(
ID NO Number Primary Key,
Name text(20),
Father_Name text(20),
Mother_Name text(20),
Group text(20),
Tution_Fees Currency,
Class_start_date date
);
IDno Name Father_Name Mother_Name Group Tution_Fees Class_Start_Date
25. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-25
SQL Statement by using DDL.
Rename a table by using SQL RENAME
statement.
Syntax of RENAME COMMAND:
RENAME old table name TO new table name;
EX:
RENAME student_Informations To students;
26. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-26
SQL Statement by using DDL.
Update a table by using SQL statement.
1. Add a new field in a Table .
Syntax to add a new field in a database table :
ALTER TABLE table name
ADD (newcolumname1 datatype(size), newcolumname2 datatype(size));
EX:
ALTER TABLE student_Informations
ADD GPA number(10);
27. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-27
SQL Statement by using DDL.
Update a table by using SQL statement.
2. Change Field Type and Field Size of a database Table.
Syntax:
ALTER TABLE table name
MODIFY (columname newdatatype(newsize));
EX:
ALTER TABLE student_Informations
MODIFY GPA text(5);
28. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-28
SQL Statement by using DDL.
Update a table by using SQL statement.
3. Delete a Field from a database Table
Syntax:
ALTER TABLE table name
DROP columname;
EX:
ALTER TABLE student_Informations
DROP GPA;
29. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-29
SQL Statement by using DDL.
Update a table by using SQL statement.
4. Delete a Table From database
Syntax:
DROP TABLE table name
EX:
DROP TABLE student_Informations
30. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-30
SQL Statement by using DML.
Statements used in DML
1. INSERT
2. SELECT
3. UPDATE
4. DELETE
31. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-31
SQL Statement by using DML.
INSERT Statement
1.Insert a new Record in database table by using SQL INSERT Statement
Syntax:
INSERT INTO table name
(Columnname1, Columnname1, Columnname1……)
VALUES(Value1,Value2,Value3,…………);
Ex:
INSERT INTO student_Information
(ID_no,Name,Father_Name,Mother_Name,Group,Tution_Fees,Class_start_date date)
VALUES (1003,“Razu”,“Razzak”,“sofia”,“Science”,2500,01/07/2017);
ID_no Name Father_Name Mother_Name Group Tution_Fees Class_Start_Date
1003 Razu Razzak Sofia Science 2500 01/07/2017
32. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-32
SQL Statement by using DML.
SELECT Statements for viewing all fields of a Table.
Syntax:
SELECT *
From table name;
EX:
SELECT *
FROM student_Informations;
33. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-33
SQL Statement by using DML.
SELECT Statements for viewing specific field of a Table.
Syntax:
SELECT column1, column2, column3, ……
From table name;
EX:
SELECT ID_no, Name
FROM student_Informations;
34. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-34
SQL Statement by using DML.
SELECT Statements for viewing specific field of a Table.
Syntax:
SELECT column1, column2, column3, ……
From table name
Where columnname=value;
EX:
SELECT ID no, Name
FROM student_Informations
WHERE section=“science”;
35. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-35
SQL Statement by using DML.
SELECT Statements for viewing all field of a Table and sorting the
record by descending order.
Syntax:
SELTCT *
From table name
Where columnname=value;
EX:
SELTCT *
FROM student_Informations
WHERE section=“science”
ORDERED BY Name DESC;
36. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-36
SQL Statement by using DML.
SELECT Statements for viewing all field of a Table and sorting the
record by aescending order.
Syntax:
SELTCT *
From table name
Where columnname=value;
EX:
SELTCT *
FROM student_Informations
WHERE ((section=“science”) AND (GPA>=4.5))
ORDERED BY Name ASC;
37. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-37
SQL Statement by using DML.
UPDATE statement
Syntax:
UPDATE table name
SET (columnname=value…………;
WHERE Condition;
EX:
UPDATE student_Informations
SET Name=“Raza”
WHERE ID no=1003;
38. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-38
SQL Statement by using DML.
DELETE statement
Delete All Record From a table.
Syntax:
DELETE FROM table name
EX:
DELETE FROM student_Informations
OR
TRUNCATE TABLE student_Informations
39. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-39
SQL Statement by using DML.
DELETE statement
Delete specific Record from Table
Syntax:
DELETE FROM table name
WHERE Condition;
EX:
DELETE FROM student_Informations
WHERE ID no=1003;
40. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-40
Database Relation
The logical relationship with various database table
in a Database is called database relation.
4 types of Database Relation:
1. One to One.
2. One to Many
3. Many to One
4. Many to Many.
41. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-41
One to one Relation
The relation with one record of a table to another one
record of another table is called one to one relation.
This relation is possible only between two primary
key.
43. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-43
One to Many
The relation with one record of a table to many record
of another table is called one to many relation.
This relation is possible only between a primary key
and with a foreign key.
45. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-45
Many to One Relation.
The relation between many record of a table to only
with one record of another table is called many to
one relation.
This relation is possible only between a foreign key
with a primary key.
47. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-47
• Many to Many Relation
The relation with many record in a table to many
record of another table is called many to many
relation.
49. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-49
Data Encryption
Encryption is the process of using an algorithm to
transform information to make it unreadable for
unauthorized users.
Process of Data Encryption
1. Caesar Code.
2. DES(Data Encryption Standard)
3.IDEA(International Data Encryption Algorithm)
50. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-50
• Caesar Code.
Encryption Algorithm:
EN (X)=(X+N)mod 26
Where, En (X)=Cipher text or encrypted text
X=Plain Text positional value(0 to 25)
N=1,2,3………
51. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-51
• Caesar Code.
Decryption Algorithm:
DN (X)=(X-N)mod 26
Where, DN (X)=Decrypted text
X=Plain Text positional value(0 to 25)
N=1,2,3………
52. Database Management System
Md. Ikbal Hossain,Lecturer(ICT),Adamjee Cantonment College
P-52
Encrypt the word CAESAR
Plain Text(X) Positional
Value of X
X+N
Where N=20
(X+N)mod 26 Encrypted text
EN (X)
C 2 22 22 W
A 0 20 20 U
E 4 24 24 Y
S 18 38 12 M
A 0 20 20 U
R 17 37 11 L