RDBMS
RDBMS
RDBMS
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 1 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Ans (i)Function:
A function is a logically grouped set of SQL and PL/SQL statements Correct
that perform a specific task. definitio
n 1M
(ii) Procedure: each
It is named PL/SQL block which performs one or more specific task
Page 2 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 3 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Explanation:
1. Physical Level:
It is lowest level of abstraction.
This level defines lowest complicated data structure of database
system.
This level hidden from user.
It defines how the data are stored.
2. Logical Level:
The level next to physical level is called logical level.
This level defines what data stored in the database and what the
relationships among these data are.
Fully decides the structure of the entire database.
3. View Level:
This level is used to show the part of database to user.
There is more complexity in physical as well as logical level so
user should not interact with complicated database.
So different view of database can be created for user to interact
with database easily
(b) Describe the command to change the data in the table with 4M
example.
Syntax : Example
Update <tablename> set <attribute_name1=expression1> where 2M
<search_condition>;
Page 4 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 5 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example OF 3NF
A bank uses the following relation:
Vendor(ID, Name, Account_No, Bank_Code_No, Bank)
The attribute ID is the identification key. All attributes are single
valued (1NF). The table is also in 2NF.The following dependencies
exist:
Page 6 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example of BCNF:
Let's assume there is a company where employees work in more than
one department.
EMPLOYEE tableEMP_ID,EMP_COUNTRY,EMP_DEPT,
DEPT_TYPE,EMP_DEPT_NO)
Functional dependencies
1. EMP_ID → EMP_COUNTRY
2. EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}
Candidate keys:
For the first table: EMP_ID
For the second table: EMP_DEPT
Page 7 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 8 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax:-
ALTER SNAPSHOT <snapshotname>
[[PCTFREE <integer>]
[PCTUSED <integer>]
[REFRESH [FAST/COMPLETE/FORCE]];
Syntax:-
Drop snapshot <snapshot name>;
Page 9 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax:
Revoke <object privileges>on<object name>from <username> ;
Storage Manager
1. Authorization and integrity manager
Which tests for the satisfaction of integrity constraints and checks the
authority of users to access data.
2. Transaction manager
Which ensures that the database remains in a consistent correct) state
despite system failures, and that concurrent transaction executions
proceed without conflicting.
3. File Manager
It manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.
4. Buffer manager
Which is responsible for fetching data from disk storage into main
memory, and deciding what data to cache in main memory.
Page 10 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Disk Storage
i. Data files, which store the database itself.
ii. Data dictionary, which stores metadata about the structure of
the database, in particular the schema of the database.
iii. Indices, which provide fast access to data items that hold
particular values.
iv. Statistical Data: It stores statistical information about the data
in the database.
Page 11 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 12 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 13 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Exception Block
Page 14 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 15 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 16 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 17 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example:
select ename from emp1 intersect select ename from emp2;
4) Minus: The minus of two sets includes elements from set1 minus
elements of set2.
Example:
select ename from emp1 minus select ename from emp2;
Correct
symbols
2M
Correct
relations
hips
1M
Page 18 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
b) Application programmers:
Application programmers are the users who write the application
programs. These programmers use programming tools to develop the
program. RAD technology is used to write the program.
c) Sophisticated users:
Sophisticated users interact with the system by making the requests
in the form of query language. These queries are then submitted to
the query processor. Query processor converts the DML statements
into lower level interactions which are understandable by storage
manager.
d) Specialized users:
These users are not traditional. They write some special application
programs which are not regular applications like CAD, knowledge
based and expert system.
e) Database administrator:
Responsible for managing whole database system, create and
maintains database. Manages users who can access the database and
manages integrity issue. Manages performance of system as and
when required.
Page 19 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 20 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example
Following is the sequence query creating sequence in ascending
order.
Example :
CREATE SEQUENCE sequence_1
start with 1
increment by 1
Page 21 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 22 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax Explanation:
The above syntax shows the different optional statements that are
present in trigger creation.
BEFORE/ AFTER will specify the event timings.
INSERT/UPDATE/LOGON/CREATE/etc. will specify the event
for which the trigger needs to be fired.
ON clause will specify on which object the above-mentioned event
is valid. For example, this will be the table name on which the
DML event may occur in the case of DML Trigger.
Command "FOR EACH ROW" will specify the ROW level
trigger.
WHEN clause will specify the additional condition in which the
trigger needs to fire.
The declaration part, execution part, exception handling part is
same as that of the other PL/SQL blocks. Declaration part and
exception handling part are optional.
Page 23 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
AFTER Triggers
Page 24 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 25 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 26 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
Example
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country
ORDER BY COUNT(CustomerID) DESC;
Page 27 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Aborted: after the transaction has been rolled back and the database
has been restored to its state prior to the start of the transaction.
Committed: after successful completion.
Page 28 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example
2M
Page 29 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Example: Example:
Person->-> mobile,
EmpID -> EmpName,
Person ->-> food_likes
EmpName is functionally
dependent This is described as:
on EmpID because EmpName c person multi determines
an take only one value for the mobile” and “person multi
given value of EmpID determines food_likes.”
Page 30 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Or
Page 31 / 32
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Page 32 / 32