Lecture 2-CSC491 Database, Database Management
Lecture 2-CSC491 Database, Database Management
4. Types of Database.
5. Database Architecture
6. Database Languages
7. Database Components
8. Database Applications
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
What is Databases?
What is a Database? A database is a structured collection of data that is
stored electronically. It enables users to efficiently store, retrieve, and
manage data. Databases are integral to modern computing systems and
serve as the backbone of virtually every software application in use today.
The database
environment
• To be able to function, an organisation needs information,
e.g.
The database
•environment
A major requirement of any computer system is to store and retrieve
data in a way that is meaningful to the end user
Key Characteristics of a Database:
A relational database is a type of database that stores data in a structured format using rows and columns. The
data is organized into tables (called "relations"), and each table consists of one or more columns (attributes) and
rows (records).
1. Tables (Relations): The primary structure for storing data. Each table represents an entity.
2. Rows (Tuples): Each row represents a unique record in a table.
3. Columns (Attributes): Each column represents a data field, with a specific datatype.
4. Primary Key: A unique identifier for each row in a table.
5. Foreign Key: A field that creates a relationship between two tables.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
The advantages of the relational
model are:
1. Structural independence
2. Improved conceptual simplicity
3. Easier database design,
implementation, management &
use
4. Ad hoc querying (a query that is
not predefined) capability through
SQL
5. Powerful data management
system.
The disadvantages, on the other
hand, are:
1. Substantial hardware & system
software overhead
2. Possibility of poor design &
implementation
3. Potential “islands of
information” problem.
2. Object-Oriented Database
Model
The object-oriented paradigm has been
applied to database technology,
creating a new programming model
known as object databases. These
databases attempt to bring the
database world and the application
programming world closer together, in The Object-Oriented Database Model (OODB) is a data model that
integrates database capabilities with the features of object-oriented
particular by ensuring that the programming (OOP). It is designed to handle more complex data
database uses the same type system as structures than the traditional relational model and is especially
the application program. suited for applications involving multimedia, CAD/CAM, simulations,
and real-time systems.
Object databases have been used successfully in
many applications:
The combined storage of both data and the procedures that manipulate
usually specialized applications such as
them is referred to as encapsulation. Through encapsulation, an object can
engineering databases or molecular biology be “planted” in different data sets. The ability in object-oriented structures
databases to create a new object automatically by replicating all or some of the
characteristics of a previously developed object (called the parent object) is
called inheritance.
Example Scenario for Object Oriented
We are designing a database system for a university to
manage:
• Students
• Professors
• Courses
• Departments
This system will use an Object-Oriented Database (OODB).
When a user wants to get some information from a database file, he can issue a query.
SQL is specialized to handle ‘structured data’ that follows relational model – data that incorporates relations among entities and
variables.
Used to interact with databases to manage data: create, populate, modify, or destroy data.
"Domain-specific" refers to something that is designed or specialized for a particular area of knowledge, industry, or
problem set—known as a domain.
SQL (Structured Query Language) is a domain-specific language because it is designed specifically for working with databases
to query, update, insert, or delete data in databases.
Examples of domain specific languages are SQL and HTML
Examples of General Purpose Languages are C++, Java, Python
SQL as a Language
Nevertheless, SQL is a ‘language’. It has its language specification – a set of language elements, rules and syntax
According to ANSI (American National Standards Institute), SQL is the standard language for all database
management systems.
It is a high level language which is user friendly and easy to learn
The latest version of the SQL standard is SQL Server 2022 Version Number
16.0.1000.6
Result
Task#2 List the names, id of 1A students with no fee
remission.
SELECT name, id, class FROM student WHERE class="1A" AND NOT remission;
Result
Task#3 List the students who were not born in January, March, June, September.
SELECT name, class, dob FROM student WHERE MONTH(dob) NOT IN (1,3,6,9);
Result
SQL Queries
1. SELECT Statement Used to fetch data from a database.
SELECT Name, Department FROM Employees;
SQL Categories
1. Data Query Language (DQL) - used to query data
2. Data Manipulation Language (DML) – used to create/modify/destroy data
3. Data Definition Language (DDL) – used to define database schema
4. Data Control Language (DCL) – used for security and access control
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Database Management
•System (DBMS)
To access information from a database, you need a database management
system (DBMS).
• This is a collection of programs that enables you to enter, organize, and select
data in a database. OR
• A Database Management System (DBMS) is a software tool that facilitates
creating, maintaining, and manipulating an information database.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Database Management
System (DBMS)
• DMBS is a collection of programs that enables you to store, modify, and
extract information from a database.
• There are many different types of DBMSs, ranging from small systems that
run on personal computers to huge systems that run on mainframes.
Database Management
System
•
(DBMS)
Requests for information from a database are made in the form of a
query.
Relational Database
Management System (RDBMS)
• A relational database management system (RDBMS) is a database
management system (DBMS) that is based on the relational model
as introduced by E. F. Codd.
Relational Database
Management System (RDBMS)
• A short definition of an RDBMS is:
• a DBMS in which data is stored in tables and the relationships among the data
are also stored in tables.
Relational Database
Management System (RDBMS)
• A relational database management system (RDBMS) is a program that
lets you create, update, and administer a relational database.
• Filemaker
• MySQL
• Oracle
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
What is
Record?
•In the context of a relational database, a row—also called a record or
tuple—represents a single, structured data item in a table.
• Each row in a table represents a set of related data, and every row in
the table has the same structure.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Recor
d
EMPNO FIRSTNME LASTNAME WORKDEPT JOB
What is Entity?
• The first step in developing a database design is to identify the types
of data to be stored in database tables.
What is Entity?
• An entity is a person, object, or concept about which you want to
store information.
What is Field/Column?
• Within a relational table, each row of data in the table is a collection
of related data values.
• Each column in a table must have a name that is unique for that
table.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
What is Field/Column?
• The data type and length specify the type of data and the maximum
length that are valid for the column.
• Structured Query Language (SQL) is the most widely used query language.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Relational Model
Attributes
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
• The DBMS Manages the Interaction Between the End User and
the Database.
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
• Peripherals
• Software
• Operating systems software
• DBMS software
• Systems administrators
• Database designers
• End users
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
• Instructions and rules that govern the design and use of the database system
• Data
• Single-user
• Desktop database
• Multiuser
• Workgroup database
• Enterprise database
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
• Location
• Centralized
• Distributed
• Use
• Transactional (Production)
• Decision support
• Data warehouse
Ref: Experiencing MIS, 4th edition by D. M. Kroenke, A. Gemino and P. Tingling.
Data Administration
1. What is DBMS.
4. Types of Database.
5. Database Architecture
6. Database Languages
7. Database Components
8. Database Applications
References / Resources