You are on page 1of 52

Database

Management System
Core Concepts

Lecture 1
Database Management System: CORE
Concepts

A Database Management System (DBMS) is software


that permits the organization to centralize data, manage
them efficiently, and provide access to the stored data by
application programs.
The DBMS is a general-purpose software system that
facilitates the processes of defining, constructing,
manipulating, and sharing databases among various
users and applications.
RDBMS – Relational Database Management System

Why do we need one?


Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS
Joy M. Peji, MIT
Instructor
Relational Management System

An RDBMS is a type of DBMS that stores data in a


row-based table structure which connects related
data elements.
 Security DATA

 Integrity
 Performance DATABASE

 Reliability

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What is a Database?

• Collection of related files containing records on


people, places, or things.
• A database is a logically coherent, organized
collection of similar or related data

Customers Orders Products

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Basic Concept of Data Management

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Basic Database Concept

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Basic Database Concept

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Database System Environment

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Database Management System

• Combination of software and data for Collecting,


storing and managing data in a database
environment.
• A DBMS basically includes:
o Database
o Database engine (for accessing and modifying the DB
content)
o Data Manipulation Language (DML)

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Database Management System

APPLICATION 1

APPLICATION 2 DBMS
DATABASE

APPLICATION …N

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Database Management System

• A database management system (DBMS) is simply


the software that permits an organization to
centralize data, manage them efficiently, and
provide access to the stored data by application
programs
• an interface between application programs and the
physical data files

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Advantages of DBMS

• Reduction in Data Redundancy


• Reduction in Data Inconsistency
• Sharing of data
• Enforcement of standards
• Improvement in data security
• Management of data integrity
• Better interaction with users
• Efficient system

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Disadvantages of DBMS

Main inhibitor of using a DBMS:


 High initial investment and possible need for
additional hardware.
• When a DBMS may be unnecessary:
 If the database and applications are simple, well
defined, and not expected to change.
 If access to data by multiple users is not required.

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Database Management System

 Centralized Database
• Used by single central processor or multiple
processors in client/server network
 Distributed Database
• Database stored in more than one physical
location
• Partitioned database
• Duplicated database

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Choosing a DBMS

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Choosing a DBMS

• Why Microsoft SQL Server?

 INTEGRATION
 HOSTED SOLUTION
 ADVANCED FEATURES

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Choosing a DBMS

db db

MySQL ORACLE SQL SERVER

db db db db db

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
SQL Server Components and Application

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
SQL Server Editions

 EXPRESS Edition  DEVELOPER Edition


 WEB Edition  WORKGROUP Edition
 COMPACT Edition

Microsoft SQL Server


 AZURE  ENTERPRISE Edition
 STANDARD Edition  DATA WAREHOUSE

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
MS SQL Server Download

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Planning SQL Server Installation

 INSTANCES  SECURITY

 STORAGE  AVAILABILITY

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
SQL Server INSTANCES

 Stability
• If an instance goes down, everything goes down.
 Security
• Each instance has its own instance-wide security.
 Performance
• Control how many resources used by each instance.
 Configuration and Compliance
• Each instance can be configured independently from
one another.

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Too many INSTANCES…

 NOT a good IDEA!

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Storage

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Security

• WINDOWS Authentication
• Windows Accounts based on active directory

• MIXED Mode
• Windows accounts
• SQL Login accounts

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Windows Authentication SECURITY

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
SQL Login SECURITY

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Service SECURITY

LOCAL System
DOMAIN Account
 Recommended to use separate accounts
for each services:
▪ Database Engine
▪ SQL Server Agents
▪ Analysis Services
▪ Reporting Services

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
AVAILABILITY

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Using MS SQL Server: Creating Database

Planning your Database

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Planning your Database

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Planning your Database

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What’s IT for?

• “The database stores necessary product and order


information.”
• “We help customer find books, discover what
others thought about them, purchase and track
their orders, contribute their own reviews and
opinions, and learn about other products they
might like based on people with similar reading
habits.”

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What do you have?

Existing database?
 Don’t just import: re-architect
Existing process?
 Physical assets: order forms, filing cabinets,
people

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What tables do you need?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What columns do you need?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What keys do you need?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
What relations do you need?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
SQL Server Database

Creating Database
 Database files
• File groups, Size, location
 Database option
• Automatic, Cursor, Miscellaneous, State, etc.
• Compatibility level
• Recovery Model

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Creating a Table

• Attributes (fields/columns)
• Data types
• Primary Key
• Default value
• Check Constraint
• Unique Keys
• Computed Column
• character / string data types

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Data Types

 character / string data types


• text
• ntext
• char
• nchar
• varchar
• nvarcha

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Character Data Types

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Character Data Types

Fixed-length character data


• nchar(10) - 20 bytes, padded with space
• char(10) - 10 bytes, padded with space

Variable-length character data


• nvarchar(10) - it depends, up to 20 bytes
• nvarchar(4000) - maximum specified length
• varchar(8000) - maximum specified length
• nvarchar(max) - up to 2GB

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Numeric Data Types

Exact Numbers
• int - /+ 2 billion
• smallint - 32,768 to + 32,767
• tinyint - 0 to 255
• bigint - /+ 2^63
• money - /+ 922,337,203,685,477.5808
• smallmoney - /+ 214,748.3648
• decimal / numeric - fixed precision and scale (p,s)
• ▪ Ex: decimal (9,2) -> max value of: 9999999.99

Approximate Numbers
• float(n) / real

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Date Data Types

 date
 time
 datetime
 datetime2
 datetimeoffset
 smalldatetime

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
Other Data Types

 binary
 varbinary
 bit
 xml
 uniqueidentifier
 user defined
 geometry
 geography

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
How database works?

 SQL Server Storage Model

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
How database works?

• Schema Design Consideration

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
How database works?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
How database works?

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor
-

Thank you!!!

Truth. Excellence. Service.


REFERENCES

Innovating Knowledge. Improving Lives. Globalizing Impact. OVPRECETS


Joy M. Peji, MIT
Instructor

You might also like