0% found this document useful (0 votes)
13 views

Database and Programming Concept

Uploaded by

nusrat della
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Database and Programming Concept

Uploaded by

nusrat della
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Bangladesh Army University of Engineering &

Technology
Department of Information and Communication Engineering (ICE)

Fundamentals of ICT
ICE 1111

Mursheda Nusrat Della


Lecturer
Lecture 19
Dept. of ICE
BAUET
Database and Programming
Concept

Information and Communication Engineering (ICE), BAUET


Database Management System
What is Database?

The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table, schema, views, and reports, etc.

For example: The college Database organizes the data about the admin, staff, students and faculty
etc.
Using the database, you can easily retrieve, insert, and delete the information.

Characteristics of DBMS
•It uses a digital repository established on a server to store and manage the information.
•It can provide a clear and logical view of the process that manipulates data.
•DBMS contains automatic backup and recovery procedures.
•It contains ACID properties which maintain data in a healthy state in case of failure.
•It can reduce the complex relationship between data.
•It is used to support manipulation and processing of data.
•It is used to provide security of data.
•It can view the database from different viewpoints according to the requirements of the user.
Information and Communication Engineering (ICE), BAUET
Advantages of DBMS

•Controls database redundancy: It can control data redundancy because it stores all the data in one single
database file and that recorded data is placed in the database.
•Data sharing: In DBMS, the authorized users of an organization can share the data among multiple users.
•Easily Maintenance: It can be easily maintainable due to the centralized nature of the database system.
•Reduce time: It reduces development time and maintenance need.
•Backup: It provides backup and recovery subsystems which create automatic backup of data
from hardware and software failures and restores the data if required.
•multiple user interface: It provides different types of user interfaces like graphical user interfaces,
application program interfaces
Disadvantages of DBMS

•Cost of Hardware and Software: It requires a high speed of data processor and large memory size to run
DBMS software.
•Size: It occupies a large space of disks and large memory to run them efficiently.
•Complexity: Database system creates additional complexity and requirements.
•Higher impact of failure: Failure is highly impacted the database because in most of the organization, all the
data stored in a single database and if the database is damaged due to electric failure or database corruption
then the data may be lost forever.
Information and Communication Engineering (ICE), BAUET
Relational Database Management Systems(RDBMS)

RDBMS stands for Relational Database Management Systems. All modern database
management systems like SQL, MS SQL Server, IBM DB2, ORACLE, My-SQL and Microsoft
Access are based on RDBMS. It is called Relational Data Base Management System
(RDBMS) because it is based on relational model introduced by E.F. Codd. Data is
represented in terms of tuples (rows) in RDBMS.

Relational database is most commonly used database. It contains number of tables and
each table has its own primary key.
Due to a collection of organized set of tables, data can be accessed easily in RDBMS.

Information and Communication Engineering (ICE), BAUET


DBMS RDBMS
DBMS applications store data as file. RDBMS applications store data in a tabular form.
In DBMS, data is generally stored in either a In RDBMS, the tables have an identifier called
hierarchical form or a navigational form. primary key and the data values are stored in
the form of tables.
Normalization is not present in DBMS. Normalization is present in RDBMS.
DBMS does not apply any security with RDBMS defines the integrity constraint for the
regards to data manipulation. purpose of ACID (Atomocity, Consistency,
Isolation and Durability) property.
DBMS uses file system to store data, so there in RDBMS, data values are stored in the form of
will be no relation between the tables. tables, so a relationship between these data
values will be stored in the form of a table as
well.
DBMS has to provide some uniform methods RDBMS system supports a tabular structure of
to access the stored information. the data and a relationship between them to
access the stored information.
DBMS does not support distributed database. RDBMS supports distributed database.
DBMS is meant to be for small organization RDBMS is designed to handle large amount of
and deal with small data. it supports single data. it supports multiple users.
user.
Examples of DBMS are file systems, xml etc. Example of RDBMS are mysql, postgre, sql
server, oracle etc.
Information and Communication Engineering (ICE), BAUET
What is Normalization?

Normalization is a database design technique that reduces data redundancy and eliminates
undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules
divides larger tables into smaller tables and links them using relationships. The purpose of
Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored
logically.
Computer Program
A computer program is a sequence of instructions written using a Computer Programming
Language to perform a specified task by the computer.

The two important terms that we have used in the above definition are −
•Sequence of instructions
•Computer Programming Language

Information and Communication Engineering (ICE), BAUET


What Does Code Mean?
Code, in a general sense, is the language understood by the computer. Computers don't
understand natural language. As such the human language has to be converted into a set of
"words" that are understood by the computer. The words that initiate a standard action when
used in a program are called keywords. The arrangement of keywords for successful execution
of a desired computation is called syntax. The set of keywords and syntax form a programming
language.
Machine Code
Machine code, also called machine language, is a computer language that is directly
understandable by a computer's CPU (central processing unit), and it is the language into which all
programs must be converted before they can be run. Each CPU type has its own machine language,
although they are basically fairly similar.

After the source code for a program has been written by one or more humans in a programming
language (e.g., C or C++), it is compiled (i.e., converted) into machine code by a specialized
program called a compiler, or by an assembler in the case of assembly language. This machine code
is then stored as an executable file (i.e., a ready-to-run program) and can be executed (i.e., run) by
the operating system any time it is instructed to do so by another program or by a user.
Information and Communication Engineering (ICE), BAUET
Machine code is extremely difficult for humans to read because it consists merely of patterns of bits
(i.e., zeros and ones). Thus, programmers who want to work at the machine code level instead usually
use assembly language, which is a human-readable notation for the machine language in which the
instructions represented by patterns of zeros and ones are replaced with alphanumeric symbols
(called mnemonics) in order to make it easier to remember and work with them (including reducing
the chances of making errors). In contrast to high-level languages (e.g., C, C++, Java, Perl and Python),
there is a nearly one to one correspondence between a simple assembly language and its
corresponding machine language.

Programs for the first electronic computers were written directly in machine code. However, the
development of assembly language from the 1950s led to a large increase in programmer
productivity. Initially, programs written in assembly language programs were hand-translated into
machine code, but this tedious task was later eliminated by the development of assemblers to
automate the translations.

Information and Communication Engineering (ICE), BAUET


Compiler Interpreter

Compiler scans the whole program in one Translates program one statement at a
go. time.

As it scans the code in one go, the errors Considering it scans code one line at a
(if any) are shown at the end together. time, errors are shown line by line.

Due to interpreters being slow in


Main advantage of compilers is it’s
executing the object code, it is preferred
execution time.
less.

It converts the source code into object It does not convert source code into
code. object code instead it scans it line by line

It does not require source code for later It requires source code for later
execution. execution.

Python, Ruby, Perl, SNOBOL, MATLAB,


C, C++, C# etc.
etc.
Information and Communication Engineering (ICE), BAUET
What is Algorithm?

The word Algorithm means “a process or set of rules to be followed in calculations or other
problem-solving operations”. Therefore Algorithm refers to a set of rules/instructions that step-
by-step define how a work is to be executed upon in order to get the expected results.

Information and Communication Engineering (ICE), BAUET


Flowchart

A flowchart is a graphical representation of an


algorithm. Programmers often use it as a program-
planning tool to solve a problem. It makes use of
symbols which are connected among them to
indicate the flow of information and processing.
The process of drawing a flowchart for an
algorithm is known as “flowcharting”.
Example: Draw a flowchart to input two numbers
from the user and display the largest of two
numbers

Information and Communication Engineering (ICE), BAUET


Algorithm Flowchart
Flowchart is a diagram created by
Algorithm is step by step
different shapes to show the flow
procedure to solve the problem.
of data.

Algorithm is complex to
Flowchart is easy to understand.
understand.

In flowchart, symbols/shapes are


In algorithm plain text are used.
used.

Algorithm is easy to debug. Flowchart it is hard to debug.

Algorithm is difficult to construct. Flowchart is simple to construct.

Algorithm does not follow any Flowchart follows rules to be


rules. constructed.

Algorithm is the pseudo code for Flowchart is just graphical


the program. representation of that logic.
Information and Communication Engineering (ICE), BAUET
Pseudocode

Pseudocode is an informal way of programming description that does not require any strict
programming language syntax or underlying technology considerations. It is used for creating
an outline or a rough draft of a program. Pseudocode summarizes a program’s flow, but
excludes underlying details. System designers write pseudocode to ensure that programmers
understand a software project's requirements and align code accordingly.

Information and Communication Engineering (ICE), BAUET


Classification of programming languages
Programming languages are basically classified into two main categories – Low level
language and High level language. However, there also exists another category known as
Middle level language. Every programming language belongs to one of these category and
sub-category.

Information and Communication Engineering (ICE), BAUET


Below image describes the abstraction level of programming languages from hardware. As you can see
machine language provides no abstraction. Assembly language provide less abstraction from the
hardware. Whereas high level language provides a higher level of abstraction.

Information and Communication Engineering (ICE), BAUET


Low level languages
Low level language abbreviated as LLL, are languages close to the machine level instruction set.
They provide less or no abstraction from the hardware. A low-level programming language
interacts directly with the registers and memory. Since, instructions written in low level
languages are machine dependent. Programs developed using low level languages are machine
dependent and are not portable. Low level language does not require any compiler or interpreter
to translate the source to machine code. An assembler may translate the source code written in
low level language to machine code. Low level languages are further classified in two more
categories

Information and Communication Engineering (ICE), BAUET


Machine language
Machine language is closest language to the hardware. It consists set of instructions that are executed directly
by the computer. These instructions are a sequence of binary bits. Each instruction performs a very specific
and small task. Instructions written in machine language are machine dependent and varies from computer to
computer.

Example: SUB AX, BX = 00001011 00000001 00100010 is an instruction set to subtract values of two registers
AX and BX.
Assembly language
Assembly language is an improvement over machine language. Similar to machine language, assembly
language also interacts directly with the hardware. Instead of using raw binary sequence to represent an
instruction set, assembly language uses mnemonics.

Information and Communication Engineering (ICE), BAUET


Advantages of low level languages

1.Programs developed using low level languages are fast and memory efficient.
2.Programmers can utilize processor and memory in better way using a low level language.
3.There is no need of any compiler or interpreters to translate the source to machine code. Thus, cuts the
compilation and interpretation time.
4.Low level languages provide direct manipulation of computer registers and storage.
5.It can directly communicate with hardware devices.

Disadvantages of low level languages

6.Programs developed using low level languages are machine dependent and are not portable.
7.It is difficult to develop, debug and maintain.
8.Low level programs are more error prone.
9.Low level programming usually results in poor programming productivity.
10.Programmer must have additional knowledge of the computer architecture of particular machine, for
programming in low level language.

Information and Communication Engineering (ICE), BAUET


High level languages
High level language is abbreviated as HLL. High level languages are similar to the human language.
Unlike low level languages, high level languages are programmers friendly, easy to code, debug and
maintain.

High level language provides higher level of abstraction from machine language. They do not interact
directly with the hardware. Rather, they focus more on the complex arithmetic operations, optimal
program efficiency and easiness in coding.

Information and Communication Engineering (ICE), BAUET


Advantages of High level language

1.High level languages are programmer friendly. They are easy to write, debug and maintain.
2.It provide higher level of abstraction from machine languages.
3.It is machine independent language.
4.Easy to learn.
5.Less error prone, easy to find and debug errors.
6.High level programming results in better programming productivity.

Disadvantages of High level language

7.It takes additional translation times to translate the source to machine code.
8.High level programs are comparatively slower than low level programs.
9.Compared to low level programs, they are generally less memory efficient.
10.Cannot communicate directly with the hardware.

Information and Communication Engineering (ICE), BAUET


Low level language High level language
They are faster than high level
They are comparatively slower.
language.
Low level languages are memory High level languages are not memory
efficient. efficient.
Low level languages are difficult to
High level languages are easy to learn.
learn.
Programming in low level requires Programming in high level do not
additional knowledge of the computer require any additional knowledge of the
architecture. computer architecture.
They are machine dependent and are They are machine independent and
not portable. portable.
They provide less or no abstraction They provide high abstraction from the
from the hardware. hardware.
They are more error prone. They are less error prone.
Debugging and maintenance is
Debugging and maintenance is difficult.
comparatively easier.
They are used to develop a variety of
They are generally used for developing
applications such as – desktop
system software’s (Operating systems)
applications, websites, mobile
and embedded applications.
Information and Communication Engineering (ICE), BAUET etc.
software’s
Applications of DBMS

Database is a collection of related data and data is a collection of facts and figures that can be
processed to produce information.
Mostly data represents recordable facts. Data aids in producing information, which is based on
facts. For example, if we have data about marks obtained by all students, we can then conclude
about toppers and average marks.

A database management system stores data in such a way that it becomes easier to retrieve,
manipulate, and produce information. Following are the important characteristics and
applications of DBMS.

•ACID Properties − DBMS follows the concepts of Atomicity, Consistency, Isolation,


and Durability (normally shortened as ACID). These concepts are applied on transactions, which
manipulate data in a database. ACID properties help the database stay healthy in multi-
transactional environments and in case of failure.

•Multiuser and Concurrent Access − DBMS supports multi-user environment and allows them
to access and manipulate data in parallel. Though there are restrictions on transactions when
users attempt to handle the same data item, but users are always unaware of them.
Information and Communication Engineering (ICE), BAUET
•Multiple views − DBMS offers multiple views for different users. A user who is in the Sales
department will have a different view of database than a person working in the Production
department. This feature enables the users to have a concentrate view of the database
according to their requirements.

•Security − Features like multiple views offer security to some extent where users are
unable to access data of other users and departments. DBMS offers methods to impose
constraints while entering data into the database and retrieving the same at a later stage.
DBMS offers many different levels of security features, which enables multiple users to have
different views with different features. For example, a user in the Sales department cannot
see the data that belongs to the Purchase department. Additionally, it can also be managed
how much data of the Sales department should be displayed to the user. Since a DBMS is not
saved on the disk as traditional file systems, it is very hard for miscreants to break the code.

Information and Communication Engineering (ICE), BAUET


Basis DBMS Approach File System Approach
Meaning DBMS is a collection of data. In DBMS, The file system is a collection of
the user is not required to write the data. In this system, the user has to
procedures. write the procedures for managing
the database.
Sharing of data Due to the centralized approach, data Data is distributed in many files, and
sharing is easy. it may be of different formats, so it
isn't easy to share data.

Data Abstraction DBMS gives an abstract view of data The file system provides the detail
that hides the details. of the data representation and
storage of data.
Security and DBMS provides a good protection It isn't easy to protect a file under
Protection mechanism. the file system.
ntegrity Constraints Integrity Constraints are easy to Integrity Constraints are difficult to
apply. implement in file system.
Data Models •In the database approach, 3 types of In the file system approach, there is
data models exist: no concept of data models exists.
•Hierarchal data models
•Network data models
•Relational data models
Information and Communication Engineering (ICE), BAUET
Concurrency Problems DBMS takes care of Concurrent In the File system, concurrent
access of data using some access has many problems like
form of locking. redirecting the file while
deleting some information or
updating some information.
Where to use Database approach used in File system approach used in
large systems which interrelate large systems which interrelate
many files. many files.
Cost The database system is The file system approach is
expensive to design. cheaper to design.
Data Redundancy and Due to the centralization of the In this, the files and application
Inconsistency database, the problems of data programs are created by
redundancy and inconsistency different programmers so that
are controlled. there exists a lot of duplication
Recovery Mechanism DBMS provides a crash The file system doesn't have a
of data which may lead to
recovery mechanism, i.e., crash mechanism, i.e., if the
inconsistency.
DBMS protects the user from system crashes while entering
system failure. some data, then the content of
the file will be lost.
Manipulation Techniques DBMS contains a wide variety The file system can't efficiently
of sophisticated techniques to store and retrieve the data.
store and retrieve the data.
Information and Communication Engineering (ICE), BAUET
Structure The database structure is The file system approach has a
complex to design. simple structure.
Data Independence •In this system, Data In the File system approach,
Independence exists, and it there exists no Data
can be of two types.Logical Independence.
Data Independence
•Physical Data Independence

Flexibility Changes are often a The flexibility of the system


necessity to the content of is less as compared to the
the data stored in any DBMS approach.
system, and these changes
are more easily with a
database approach.
Examples Oracle, SQL Server, Sybase Cobol, C++ etc.
etc.

Information and Communication Engineering (ICE), BAUET


Related questions

 Define database and it’s characteristics.


 Explain the necessity of DBMS .What are the applications of DBMS.
 Illustrate the pros and cons of database.
 Differentiate between DBMS and RDBMS.
 Define algorithm, pseudocode and flowchart. Make a comparison between
them.
 Make a short note on (i)code (ii)machine code (iii) Computer program
 What are the types of programming language. Differentiate between high
level and low level language with advantages and drawbacks.
 Define machine language and assembly language. Distinguish between
compiler and interpreter.
 Compare between DBMS approach and file system approach.

Information and Communication Engineering (ICE), BAUET

You might also like