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

Dbms-1 (1)

The document provides an overview of Database Management Systems (DBMS), detailing the definition, advantages, components, and types of users involved. It explains key concepts such as data abstraction, data independence, relational data models, and various operations in relational algebra. Additionally, it covers SQL commands and distinctions between data types and constraints within databases.

Uploaded by

hellscythe5565
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Dbms-1 (1)

The document provides an overview of Database Management Systems (DBMS), detailing the definition, advantages, components, and types of users involved. It explains key concepts such as data abstraction, data independence, relational data models, and various operations in relational algebra. Additionally, it covers SQL commands and distinctions between data types and constraints within databases.

Uploaded by

hellscythe5565
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

DATABASE MANAGEMENT

SYSTEM
Database -

Database is an organized collection of inter-related data


stored together with minimum redundancy, in a manner that
-

makes them accessible for multiple applications .


DBMS -
The software Database Management System (DBMS) is essentially a set of
programs which facilitates storage, retrieval and management of database.
Advantages of DBMS -
-
1. Controlling data redundancy : duplication of data is known as data
redundancy . Database systems do not maintain redundant data.
-
2. Data consistency : Data redundancy may lead to data inconsistency; that
is, the various copies of the same data show different values in different
files.
-
3. Efficient data access: A DBMS utilises a variety of techniques to store and
retrieve data efficiently.
-
4. Data integrity: Data integrity refers to the overall completeness,
accuracy and consistency of data in the database.
-
5. Data security : Data security refers to the protection of data
against accidental or intentional disclosure or unauthorized
destruction or modification by unauthorized persons.
--
6. Sharing of data: The data stored in the database can be shared
among several users or programs even simultaneously .
-
7. Enforcement of standards : Database Administrator (DBA)
defines and enforces the necessary standards. Standards
can be defined for data formats to facilitate exchange of data
between systems .

-
8. Crash recovery: DBMS provides some mechanism to recover data
from the crashes.
Components of the DBMS environment

The components are


● Hardware
● Software
● Data
● Users
● Procedures
● Hardware: The hardware is the actual computer system used
for storage and retrieval of the database.

● Software: The software part consists of the actual DBMS,


application programs and utilities.

● Data: The database contains operational data and the


meta-data (data about data). Data has three parts fields,
records and files.
● Users: There are a number of users who can access data on
demand using application programs.
Eg: Database Administrator (DBA), Application Programmers,
Sophisticated users and Naive Users.

● Procedures: Procedures refer to the instructions and rules that


govern the design and use of the database .
-
Data abstraction

-
a. Physical level -
The lowest level of abstraction describes how data is actually stored
on secondary storage devices .

b. Logical level -
The next-higher level of abstraction describes what data is stored in
the database, and what relationships exist among those data.

c. View level -
View level is the highest level of database abstraction and is the
closest to the users.
Data independence -

The ability to modify the schema definition (data structure


definition) in one level without affecting the schema definition at the
next higher level is called data independence .

There are two levels of data independence,


-
a. Physical data independence
Physical data independence refers to the ability to modify the
schema followed at the physical level without affecting the schema
followed at the conceptual level .

b. Logical data independence


-
Logical data independence refers to the ability to modify a
conceptual schema without causing any changes in the schema
followed at view (external) level .
Users of database

● Database Administrator (DBA)


● Application Programmers
● Sophisticated Users
● Naive Users
Database Administrator

The person who is responsible for the control of the centralized


and shared database is the Database Administrator (DBA).

Application programmers

Application programmers are computer professionals who


interact with the DBMS through application programs.
Naive users

Naive users interact with the system by invoking one of the


application programs that were written previously.

Sophisticated Users

It includes engineers, Scientists, business Analysts, etc .


They interact system with their own codes .
Relational data model

The relational data model represents database as a collection


of tables called relations . In relational model, both data and
the relationships among them are represented in tabular form.
6
Terminologies in RDBMS Admno int pomayles
Vorhaces Notul
G any

a. Entity -

An entity is a person or a thing in the real world that is


distinguishable from others.

-
b. Relation
Relation is a collection of data elements organized in terms
of rows and columns. A relation is also called Table .
-
c. Tuple -
The rows (records) of a relation are generally referred to as
-

tuples.

-
d. Attribute

The columns of a relation are called attributes.


-
W
e. Degree
The number of attributes in a relation determines the degree
of a relation .

f. Cardinality -
The number of rows or tuples in a relation is called cardinality
-
of the relation.
g. Domain -
A domain is a pool of values from which actual values
appearing in a given column are drawn .
-

O
h. Schema -

The description or structure of a database is called the


-
database schema .
-

-
-

S
&

E
key
Pomacy
-
-

-
ladmuy Roll Batch
-
C
mno
Keys -
A key is an attribute or a collection of attributes in a
relation that uniquely distinguishes each tuples from other
tuples in a given relation . -

-
Types of keys -

-
a. Candidate key:
A candidate key is the minimal set of attributes that
uniquely identifies a row in a relation. There may be more
than one candidate key in a relation.
b. primary key :

➔ A primary key is a set of one or more attributes that can


uniquely identify tuples within the relation.
➔ From the candidate keys the one with the least number
of attributes may be selected as primary key .
c. Alternate key: -
A candidate key that is not the primary key is called an
alternate key.

d. Foreign key:
T
A key in a table can be called foreign key if it is a primary
- -
key in another table. -

-
Relational Algebra
The collection of operations that is used to manipulate the
entire relations of a database is known as relational
algebra .
Operations of Relational Algebra

1. SELECT operation -

SELECT operation is used to select rows from a


-
relation that satisfies a given predicate .

D
Eg: To select all the students who are eligible for higher
studies
- "Ensistentat
result
-

-
To select all the students in the Commerce batch who are failed.
2. PROJECT Operation: -

The PROJECT operation selects certain attributes from the table

2-
and forms a new relation.
Eg: Select Name, Result and Marks attributes in STUDENT relation.
---relation]
Twome Result Mos ,
, ,
To select admission number and name of students who are Eligible
~

for Higher Studies.


3. UNION operation

UNION operation is a binary operation and it returns a relation


containing all tuples appearing in either or both of the two specified
relations.
INTERSECTION operation:

INTERSECTION operation is also a binary operation and it returns a


relation containing the tuples appearing in both of the two specified
relations.
SET DIFFERENCE operation

SET DIFFERENCE operation is also a binary operation and it returns


a relation containing the tuples appearing in the first relation but not
in the second relation.
CARTESIAN PRODUCT operation

CARTESIAN PRODUCT returns a relation consisting of all possible


combinations of tuples from two relations.
Switching Techniques
The main goal of networking is the reliable exchange of data or
information among several interconnected nodes . For the delivery of
data with accuracy , Various types switching techniques
1. Circuit Switching
2. Packet Switching
In RDBMS, the minimal set of attributes that uniquely
identifies a row in a relation is called ________.

key
Candidate
Write short note about following terminologies in
RDBMS :
-
-

(a) Relation -
in
appear
~ Actuall values
(b) Domain column
(c) Foreign key -
Write short note about any two operations on relational
--
algebra.
-
If a table STUDENT has 5 columns and another table
-

TEACHER has 3 columns, the Cartesian product


-

STUDENT X TEACHER will have ______columns.


s
student
-
- Ther
-
- -

- = =
-- - & &

M
- -

If a table has 10 rows and 5 columns, what will be its


-
-

degree and cardinality ?


-

-
S
Degree
-

cardnality-10
Consider the following relations :
-

SPORTS -ARTS -
Nams Batch
Admno -

Arsun B1
3015 -
3005 Fithma (2
Y
>
-

- -

-
Find the result of following relational algebra operation.
-
-

(a)Arts Ո Sports Sports-ARTS

(b) Arts Ս Sports


(c) Sports – Arts
-
SPORIS
I
ARTS
Name Batch
Admno
Fazil B1
4010

U SPORTS
ARTS
no Name Batch
Adm
Manin Al
3001

3009 cristy 21-

4010 Earl B1
3090 Heun k2
so 15 Arun B1
3005 Fathima C2
-
-

&
- -
-

T

& -

-
-
M

~
-

- ↑ - -

& -
-

- -

- -
-
-
-

- - -
- - -
a) Name Age
55
Harsof

Seikahtu 43

(*)
b) city count

2
Delhi
2
Mumbai
Kolkata I
B
C City
Delhi
mumbai

Kolkata
-

MA (Dose1) MIN (DOS2)


a) 2021-07-28
2022-01-01
-

-
- =

-
- *

- -

-
-

---

- -

-
-

- -
4)
Pe ANGALURU
T ID
-

101
TDATE

2021-12-25

1035500

D
FARE
3)
I
TID
-

101 4500 d) START MIN(FARE

DELHI 4000

MUMBAI 5000
The essential features of Object Oriented Data Model are;
(a) Object identity
(b) Encapsulation
(c) DataAbstraction
(d) All of the above
Which statement is false in context to the term Relation?
(a) Relation is a table storing logically related data.
(b) Data must be atomic in cell
(c) All rows of relation are distinct.
(d) Ordering of rows & columns is relevant.
Tune
A row of relation generally referred to as.............and column of a

S
afterbute
relation is ………… - -

(a) Domain & Attribute


(b) Attribute & Domain
(c) Tuple
- & Attribute
-
(d) Attribute & Tuple
A relation has 45 tuples & 5 attributes, what will be the Degree &
-
Cardinality of that relation?
(a) Degree5,Cardinality45 -
- -

(b) Degree45,Cardinality5
(c) Degree50,Cardinality45
(d) Degree50,Cardinality2250
A Candidate key that is not a primary key, is called ……………
--
(a) Alternate key
(b) Foreign key
(c) Primary key
(d) Super Key
A non-key attribute, whose values are derived from primary key of
-
-
some other table.
-

(a) Alternate key


(b) Foreign key L

(c) Primary key


(d) Super Key
Which is not a TCL command?

(a) Commit
(b) Rollback
(c) Exit
(d) Savepoint
Which is not a function of DML?
-

(a) Retrieval of data stored in the database -


(b) Insertion of data into the database -
(c) Deletion of data from the database -

O
(d) Making changes permanent to the database.
-
[
The default date format in MySQL is:
(a) DD/MM/YYYY
(b) YYYY/MM/DD -
(c) MM-DD-YYYY
(d) YYYY-MM-DD
How can you insert a new row into the “STORE” table.
-

(a) INSERT ROW(1,‟RAMSINGH‟)INTO STORE;


M

(b) INSERT VALUES(1,‟RAMSINGH‟)INTO STORE;


(c) INSERT INTO(1,‟RAMSINGH‟)STORE;
(d) INSERT INTO STORE VALUES(1,‟RAMSINGH‟); -
--
Which SQL statement will not generate any error message?
-

(a) SELECT*FROM EMP WHERE EMPNO LIKE(1,2,3,4); *


-

(b) SELECT*FROM EMP WHERE SAL BETWEEN 3000 TO 15000;X


O
-

(c) SELECT*FROM EMP WHERE COMM IS NOT NULL; -


-

(d) All of the above


➔ Create a table bank with the following fields and insert at least 5
-

records into the table.


Acc Number Integer Primary key
=

Acc Name Varchar (20)


-

-
Branch Name Varchar (25)
-

Acc Type Varchar (10)


-

Amount Decimal (10,2)


-

int pomoy key


creafe table bank (Acc-number &

Vachor (203 Branch-name


rachor (25)
wome &
ACL - ,

ACC-type
varchar (10)
C
Amount Decimal (10,
2)
1. Display the account details account in Kodungallur Branch

Select * from bank where Branch- name =

"Kodungallur

-
2. Change the branch name Trivandrum to Thiruvananthapuram
-

back set "Thiruvananthatural


update Branch-nome =

where Branch name =


"Trivandrum's
3. Display the details of customers in Thiruvananthapuram,
Eranakulam and Kozhikkode
where Branch-name
Select * from bank
Ernakulam Kozhikkode)
;
in (Thiruvananthatra , ,

4. List the details of customers in Trissur branch having a minimum


balance of Rs. 5000

setfrom bank where Branch-name =

AND Amount
<500
:

"Trisor"
Distinguish between CHAR and VARCHAR datatypes of
-
SQL.
-

CHAR VARCHR
- -

Size
> Fixed
-
, > size
-
changable

CHARLX) VARCHR(X)
What is the difference between PRIMARY KEY and
UNIQUE Constraints ?
The SQL operator ________
Like is used with pattern
matching.
Pick the odd one out and give reason:
a. CREATE b. SELECT c. UPDATE d. INSERT
m
Distinguish between DISTINCT and UNIQUE in SQL.
Name the keyword used with SELECT command to
-

avoid duplication of values in a column.


-

Distinct

You might also like