Database and Programming Concept
Database and Programming Concept
Technology
Department of Information and Communication Engineering (ICE)
Fundamentals of ICT
ICE 1111
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.
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
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.
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.
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.
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.
Algorithm is complex to
Flowchart is easy to understand.
understand.
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.
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.
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.
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.
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.
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.
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.
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.
•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.
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