0% found this document useful (0 votes)
1K views37 pages

Fundamentals of Database Systems

The document provides information about database management systems and relational databases. It discusses: 1) What a database is and the components of a database system including the data, hardware, software, and users. 2) Examples of common database applications like banking, airlines, universities, sales, and manufacturing. 3) The benefits of using a DBMS like protection of data, ability to maintain and evolve the database, reduction of redundancy, and sharing of data. 4) The basic components of a relational database including relations, attributes, tuples, domains, degrees, primary keys, and foreign keys.

Uploaded by

hanishu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views37 pages

Fundamentals of Database Systems

The document provides information about database management systems and relational databases. It discusses: 1) What a database is and the components of a database system including the data, hardware, software, and users. 2) Examples of common database applications like banking, airlines, universities, sales, and manufacturing. 3) The benefits of using a DBMS like protection of data, ability to maintain and evolve the database, reduction of redundancy, and sharing of data. 4) The basic components of a relational database including relations, attributes, tuples, domains, degrees, primary keys, and foreign keys.

Uploaded by

hanishu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

m 

m
   

PRESENTED BY-
SRIDHAR
SANTHOSH HP
ANIL KUMAR
SADIQ
M   

 A database is an integrated collection of


data(known facts) which is centrally
controlled.

 A database system involves the data itself,


the hardware on which the data resides, the
software that controls the storing and
retrieval of data, and the users themselves.

MIS 22 September 2010 2


M   


USERS

QUERIES

SOFTWARE TO
PROCESS QUERIES
DBMS
SOFTWARE SOFTWARE TO ACCESS DATA

STORED
DATABASE

MIS 22 September 2010 3


M    
 


Œ Banking: all transactions


Œ Airlines: reservations, schedules
Œ Universities: registration, grades
Œ Sales: customers, products, purchases
Œ Online retailers: order tracking, customized
recommendations
Œ Manufacturing: production, inventory, orders,
supply chain
Œ Human resources: employee records, salaries,
tax deductions
MIS 22 September 2010 4
M   M

 Protection of database- system protection


against hardware or software malfunction.
 Maintaining database- dbms is able to
maintain the database by allowing the
system to evolve as requirements change
over time.
 Redundancy can be reduced.
 The data can be shared.

MIS 22 September 2010 5


M   


D Multiple file formats, duplication of


information in different files
D Difficulty in accessing data
D Need to write a new program to carry
out each new task
D Hard to add new constraints or change
existing ones
D Uncontrolled concurrent accesses can
lead to inconsistencies
MIS 22 September 2010 6
M     

 A Database management system is a


collection of programs that enables users to
create and maintain a database.

 It is a general purpose software system that


facilitates the processes of
defining,constructing,manipulating and
sharing of database.

MIS 22 September 2010 7


  
M   

Dynamic allocation of memory is mostly


involved.
 Allocating memory as the data is to be stored

 Allocation exactly equals requirement; no


wastage of memory

MIS 22 September 2010 8


M     

 Cobol ,high level languages for application


programs involving system analysts or
software engineers.

 Terminal users may use query language


(usually in simple English)such as SQL.
-such languages are referred to as HOST
LANGUAGES.

MIS 22 September 2010 9


MIS 22 September 2010 10
 M
 
 !" !

6  6    

 
6   
6  
  

 6
6  6  

MIS 22 September 2010 11


  M    M

 Hierarchical database

 Network database

 Relational database

MIS 22 September 2010 12



 
 M    M

BOSS

WORKER 1 WORKER 2

MIS 22 September 2010 13


 M    M

BOSS

W1 W2

SW1 SW2 SW3

MIS 22 September 2010 14


 
 M   

 Is composed of relations
 Each column of the relation represents a
different domain
 Any particular row of the relation is called a
tuple
 The number of domains in a relation indicates
the degree of the relation

MIS 22 September 2010 15


M# $!%&'$(
6  6         6

108670 Anil 413 34880 Bangalore


tuple

108671 Santhosh 611 34876 Mysore

108672 Sadiq 642 34868 Mangalore

108673 Sridhar 413 34880 Bangalore

Primary key
MIS 22 September 2010 16
$!%) '$!
    6
413 BANGALORE
611 MYSORE
642 MANGALORE

MIS 22 September 2010 17


M
 G 



Structured Query Language (SQL) is a standard database


computer language used for querying, modifying and
managing data in Relational Database Management
Systems (RDBMS).

 


SQL was developed in the 1970's by IBM to initially


manipulate and retrieve data in IBM System R. The SQL
language was standardized in 1986 by the American
National Standards Institute (ANSI); however, later
releases were released as International Organization for
Standardization (ISO) standards.

MIS 22 September 2010 18


The SQL syntax for  
  is

  
 

 



    
 



    
 

So, if we are to create the customer table specified as
above, we would type in

 CREATE TABLE STATION


(ID INTEGER PRIMARY KEY,
CITY CHAR(20),
STATE CHAR(2),
STR_N REAL,
MAIN_N REAL);
MIS 22 September 2010 19

   M
 

 

  6



 !

INSERT INTO STATION VALUES (13, ǮJPN', ǮKAR', 33, 112);


INSERT INTO STATION VALUES (44, ǮJAYNGR', ǮKAR', 40,
105);
INSERT INTO STATION VALUES (66, ǮBSK', ǮKAR', 47, 68);
SELECT COMMAND

 
"
# 
  6
     6  6 6
13 JPN KAR 33 112
44 JAYNGR KAR 40 105
66 BSK KAR 47 68
MIS 22 September 2010 20
 





 

 

!

SELECT ID, CITY, STATE FROM STATION;


   
13 JPN KAR
44 JAYNGR KAR
66 BSK KAR

MIS 22 September 2010 21


M



 !
UPDATE STATION SET CITY = RT NGR
WHERE ID=66;

   
13 JPN KAR
44 JAYNGR KAR
66 RT NGR KAR

MIS 22 September 2010 22


 DELETE COMMAND
DELETE FROM STATION
WHERE ID=44;

Now the content of the table will be:


   
13 JPN KAR
66 RT NGR KAR

MIS 22 September 2010 23


M
 SQL Overview

 Today, SQL data sources are widely deployed, and SQL is


considered to be the foundation of conventional data
management, business intelligence and analytics.

 Leading Independent Software Vendors (ISVs), such as Microsoft,


Oracle and Teradata have invested heavily to bring SQL-based
products to market that are deployed throughout the world.

 Users require data connectivity drivers - based upon proven data


standards like ODBC, JDBC, OLE DB and ADO.NET - to access
SQL data and provide actionable insight and business
intelligence based on data.

MIS 22 September 2010 24


à  

!*$'
ë   
   

Õ 
ë   ë   ë  
  
  
 
     
 
  
 

 
 
 
!*$'

 Cardinality of the table Ȃ total number of


rows present in a table at any one time.
 Attributes of the table Ȃ Column Names of
the table
 Populating the table Ȃ It is the process of
inserting tuples for the first time into a table.
!%!(
Formally given a relation r and its attributes A1, A2, A3,.., Ak we will call any
subset K={A1, A2, .. , Ak} with (1<k<n) of these attributes a candidate key
if K satisfies the following conditions
1. uniqueness property of the key - For any two distinct tuples t1 and t2 of
the relation r, there exists an attribute Aj of K such that t1(Aj) <> t2(Aj).
This implies that no two different tuples of r will have identical entries in
all attributes of K.
2. minimality property of the key - No proper subset Kǯ of K satisfies the
uniqueness property. That is, no element of K can be discarded without
destroying the uniqueness property.
       

     !  " 


#$  %& '() ë
  "
*+,- ë. ë

/ 0!1 .
%&! ((
A relation r may have more than one candidate key, one of these candidate keys
should be designated as the primary key of the relation. The value of the primary
key can then be used as the identification and addressing mechanism of the
relation.
 A RDBMS allows only one primary key per table.
 None of the attributes containing a primary key may be NULL.
 Primary keys are defined using Data Definition Language (DDL)
 Primary keys are generally defined at the time the tables are created.

       


2 
     !  " 
#$  %& '() ë
  " *+,- ë. ë
/ 0!1 .
$ !+! ((

 After selecting a primary key the other remaining


candidate keys (if any) are called as alternate keys
or secondary keys.

       


2  " 
     !  " 
#$  %& '() ë
  " *+,- ë. ë
/ 0!1 .
 %"(

Given two relations r1 and r2 of the same database, a set of


attributes FK of relation r1 is said to be a foreign key of r1
(with respect to r2) if the following two conditions are
satisfied. Simultaneously:
 The attributes of FK have the same underlying domain as
a set of attributes of relation r2 that have been defined as
the PK of r2. The FK is said to reference the PK
attribute(s) of the relation r2.
 The FK value in any tuple of the relation r1 are either
NULL or must appear as the PK value of a tuple of
relation r2.
 %"(

Ú3   2  2   83


    
Ú3 2  # # !  9
456 " 7777777 %&* %&* '() 0 

"6" 7777777 +,-/ +,-/ ë. 8 

:  

Ú3 # !  9

456 " %&* '() 0 

"6" +,-/ ë. 8 


, %!$
" %(

Referential Integrity Ȃ The foreign key concept


ensures that the tuples of relation r1 that refer to
tuples of relation r2 must refer to tuples of r2
that already exist. This condition imposed on
foreign keys is called the referential integrity
constraint.
 Foreign Keys are generally defined after all
tables have been created and populated.
 Integrity constraints are defined using DDL
statements.
, %!$
" %(

Ú3 2  2   83


       
Ú3 2  # # !  9

456 " 7777777 %&* %&* '() 0 

"6" 7777777 +,-/ +,-/ ë. 8 

:    "3 " " 

Ú3 # !  9


   456 " %&* '() 0 
  
" "  "6" +,-/ ë. 8 
?

 $ (Procedural Language/Structured Query Language) is


Oracle Corporation's procedural extension language for SQL and
the Oracle relational database

 PL/SQL supports
 Variables
 conditions
 loops
 Exceptions
 Arrays

MIS 22 September 2010 35


-!&'$, +.

 
number1 6 (2);
number2 6 (2) := 17; -- value default
text1 %  (12) := 'Hello world';
text2  :=  ; -- current date and time
 6
 street_number
6 number1
#  address
G name = 'BILLA';
6 ;

MIS 22 September 2010 36


à

You might also like