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

DBMS

Good notes for database management class 10

Uploaded by

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

DBMS

Good notes for database management class 10

Uploaded by

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

Database Management System

Class 10
Information Technology
Prepared by: Ms. Sanjana C Saju

All Rights Reserved @ Bhavans Middle East


Definitions
• Data : Raw facts, unprocessed facts
eg. 25(any no.), Meenu(any names), Kerala(any
place), any kind of texts, audio, video, etc.

• Information: Data which is processed to makes a


meaningful context.
(Processed data)
eg. The age of Meenu is 25 and she is from Kerala

• Database: Collection of related data.


eg. Online banking, library
All Rights Reserved @ Bhavansmanagement,
Middle East etc.
Introduction
• Most of us keep diaries to store details like names,
addresses, birthdays of our friends.
• Teachers keep marks registers to keep track of marks
secured by their students.
• A shopkeeper keeps details of customers who frequently
visit his /her shop in a register.
• These all are examples of paper-based databases.
• When we use the term 'database' we think of a
computerized database.
• These days computerized databases can be seen being
used almost everywhere.
All Rights Reserved @ Bhavans Middle East
• A database is an organized collection of related data,
it can be visualized as a container of information.
• Databases allows users to enter, access, and analyze
their data quickly and easily.

• The police force uses various computerized databases


to help them track criminals and solve crimes.
• A library stores details of all their books, in a
computerized database. When we want to know if a
book is in stock, we cannot only look it up, but can
also check when it is due to be returned.
The database also records details of all
the borrowers, what books they
currently have borrowed and when they are due back.
All Rights Reserved @ Bhavans Middle East
Some applications ……..

All Rights Reserved @ Bhavans Middle East


Database Management System (DBMS)

• A software package with computer programs that controls


the creation, maintenance and use of a database.
• It is an integrated collection of data records, files, and other
objects.
• DBMS allows different user application programs to
concurrently access the same database.
• Some examples of DBMS softwares -– Oracle, MySQL,
FoxPro, IBM DB2, Microsoft SQL Server,
OpenOffice.org Base, Microsoft Access, SQLite.
All Rights Reserved @ Bhavans Middle East
Database Servers: These are dedicated computer
systems that hold the databases and run only the DBMS
and related software.
• Databases on the database servers are accessed through
command line or graphic user interface tools referred to
as Frontends; database servers are referred to as Back-
ends. Such type of data access is referred to as Client-
server model.
Organization of Data : 2 ways
• Flat File: Data is stored in a single table. Usually suitable
for less amount of data.
• Relational: Data is stored in multiple tables and the
tables are linked using a common field. Relational is
suitable for medium to large amount of data.
All Rights Reserved @ Bhavans Middle East
Advantages of Database
• Reduces Data Redundancy : no chance of encountering duplicate data
• Sharing of Data : the users of the database can share the data among
themselves
• Data Integrity : the data is accurate and consistent in the database
• Data Security : Only authorized users are allowed to access the
database and their identity is authenticated using a username and
password
• Privacy : The privacy rule in a database states that only the authorized
users can access a database according to its privacy constraints
• Backup and Recovery : Database Management System automatically
takes care of backup and recovery.
• Data Consistency : means there should be multiple mismatching
copies of the same data. Any changes made to the database are
immediately reflected to all the users and there is no data
inconsistency.
All Rights Reserved @ Bhavans Middle East
Features of Database:

• The database has one or more tables.


• Each table has information about one type of item.
• Every table in a database has a key field that makes
sure that there are unique values throughout the
database.

All Rights Reserved @ Bhavans Middle East


Datamodel
• Different types of DBMS are available and their
classification is done based on the underlying data model.
• A data model describes the structure of the database,
including how data are defined and represented,
relationships among data, and the constraints.
• Types of data models include object-oriented data model,
entity-relationship data model, document model and
hierarchical data model.
• The most commonly used data model is Relational Data
Model.
All Rights Reserved @ Bhavans Middle East
Relational Database Management System (RDBMS)
• It is based on the relational model and data is organized
into tables.
• Relational database establish a well-defined relationship
between database tables.
• Tables communicate and share information, which
facilitates data searcheability, organization and reporting.
• A Relational database use Structured Query Language
(SQL), which is a standard user application that provides
an easy programming interface for database interaction

All Rights Reserved @ Bhavans Middle East


Elements of Database

1)Table: It is a collection of data elements (values). It


consists of vertical columns and horizontal rows where we
put the required information.
2) Columns/Fields/Attributes: It is a set of data values of
a particularly simple type, one for each row of the table.
3) Rows /Records /Tuples: It represents a single data item
in a table. Every row in the table has the same structure.

All Rights Reserved @ Bhavans Middle East


All Rights Reserved @ Bhavans Middle East
• Column Names
Each field or column has an individual name. A table cannot
contain the same name of two different columns.
• Column Values
The value of each field makes a row is the column value.
• Key field
Each table should contain a field which can create a link
with another one or more table is the key field of a table.
i.e. Each row is identified by a unique key index or the key
field.

All Rights Reserved @ Bhavans Middle East


Keys in Relational Database

• The rows/tuples within a table must be distinct.


• It means no two rows in a table should have same value for all
attributes. That is, there should be at least one attribute in which
data are distinct (unique) and not NULL.
• That way, we can uniquely distinguish each row of a table.
• So, relational data model imposes some restrictions or constraints
on the values of the attributes and how the contents of one table
be referred through another table.
• These restrictions are specified at the time of defining the
database through different types of keys.

All Rights Reserved @ Bhavans Middle East


All Rights Reserved @ Bhavans Middle East
Primary Key
• A Primary key is a column or a group of columns that
uniquely identifies each row in a table. It contain UNIQUE
values in column, and does not allows NULL values.
• When you create a new database table, you are asked
to select one key that will uniquely identify records
stored in that table.
• Each table can have only one Primary key
and multiple Candidate keys.

All Rights Reserved @ Bhavans Middle East


Candidate Key
• A set of one or more columns that can identify a record
uniquely in a table and which can be selected as a
primary key of the table.
• It contains UNIQUE values in column, and does not
allows NULL values.

All Rights Reserved @ Bhavans Middle East


Example
Consider the following Table, RollNo and Admission_no both may be
used to uniquely identify each row in this Table, so both are candidate
keys.

All Rights Reserved @ Bhavans Middle East


Alternate Key
• A key that can be work as a primary key if required but right
now it is not Primary key.
• There may be two or more attributes or combination of attributes
that uniquely identifies each record of a table.
• In such cases we must decide which of the candidate key will
be used as a primary keys. The remaining candidate keys would
be considered alternate keys.

• Example: In Table-1, Empid is primary key but we can


use EmpLicence & EmpPassport as a primary key to get
unique record from table, That’s
why EmpLicence & EmpPassport are Alternate keys but right
now it is not primary keys.
All Rights Reserved @ Bhavans Middle East
Foreign Key
• Foreign creates a relationship between two or more tables, a
primary key of one table is referred as a foreign key in another
table.
• It can also accept multiple null values and duplicate values.
• A foreign key is a column in a table where that column is a
primary key or a unique key of another table, which means that
any data in a foreign key column must have a corresponding data
in the other table where that column is the primary key.

All Rights Reserved @ Bhavans Middle East


Composite Primary Key
• Composite Key is a combination of more than one columns of a
table. It can be a Candidate key and Primary key.
• When a primary key constraint is applied on one or more columns
then it is known as Composite Primary Key.
In Table-1, we can
combine Empid &
EmpLicence columns to
fetch the data from table.

Another example -----

All Rights Reserved @ Bhavans Middle East


Database Objects
• Tables
Basic element of a database in which data is organized into
columns (fields) and rows (records or tuples).
• Queries
Query is a statement used to fetch/retrieve information from
database.
• Forms
Forms are used to enter or modify data in a database.
• Reports
Reports are similar to forms. However, it can be used only to
view and print data.
All Rights Reserved @ Bhavans Middle East
Data Types

These are used to identify which type of data we are going to store
in the database.

Numeric Types
Alphanumeric Types
 Binary Types
 Date time
Other Variable types

All Rights Reserved @ Bhavans Middle East


Numeric Types
• Numeric data types are used for describing numeric values for the field used in
the table of a database.
• Used for storing information such as mobile number, roll number, door number,
etc.

All Rights Reserved @ Bhavans Middle East


Alphanumeric Types:
• Used to store information that has alphabets as well as
numbers for example address, book summary field, etc.

All Rights Reserved @ Bhavans Middle East


Binary Types

• Used for storing data in binary formats. This can be used for
storing photos, music files, etc.
• In general, files of any format can be stored using the binary data
type.

All Rights Reserved @ Bhavans Middle East


DATE TIME:

• Date time data types are used for describing date and
time values for the field used in the table of a database.
• Used for storing information such as date of birth, date of
admission, date of product sale, etc.
• Format
1.DATE - YYYY-MM-DD.
2.DATETIME - YYYY-MM-DD HH:MI:SS.
3.TIMESTAMP - YYYY-MM-DD HH:MI:SS.
4.YEAR - YYYY or YY.

All Rights Reserved @ Bhavans Middle East


All Rights Reserved @ Bhavans Middle East
DATA DEFINITION / DESCRIPTION LANGUAGE :-
It 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:-
1. Create :- Used to create database objects.
2. Alter :- Used to modify database objects.
3. Drop :- Used to delete database objects.
DATA MANIPULATION LANGUAGE:-
It is a standard for commands that enables users to access and
manipulate data in a database.
• Common DML Statements are:-
1. SELECT :- Used for retrieval of information from the database.
2. INSERT :- Used for insertion of new information into the database.
3. DELETE :- Used for deletion of information in the database.
4. UPDATE :- Used for modification of information in the database.
All Rights Reserved @ Bhavans Middle East
The SELECT statement has many optional clauses:

• WHERE specifies which rows to retrieve.


• ORDER BY specifies an order in which to return the rows.

All Rights Reserved @ Bhavans Middle East

You might also like