SlideShare a Scribd company logo
What is view? Discuss the difference between a view and a base relation. 5M
View:
1. A view is defined as a database object that allows us to create a virtual table in the database.
2. View is defined to hide complexity of query from user.
3. The table on which view is defined is called as base table.
4. There are two types of view: simple view and complex view.
5. Simple view allows DML operations.
6. In simple view views base on only one table and in complex view views base on more than
one table.
7. Complex view has join and grouping conditions.
8. Simple view has simple SQL conditions.
Difference between a view and a base relation:
No. Views Base relation
1 This is one type of relation which is not a
part of the physical database.
A base relation is a relation that is not a
derived relation. It consists of virtual data.
2 It has no direct or physical relation with
the database.
It has physical relation with the database.
3 Views can be used to provide security
mechanism.
Base relation does not provide security.
4 Modification through a view generally not
permitted.
Modification may be done with a base
relation.
5 A view is query over one or more base
relation.
A base relation contains data.
6 Views are dependent on base tables. Base tables are not dependent on views.
7 Using views complex query can be solved. Using base tables complex query cannot be
solved.
ACID properties 5M
ACID stands for Atomicity, Consistency, Isolation and Durability.
A. Atomicity:
1. The atomicity property identifies that the transaction is atomic.
2. Atomic transaction means transaction is fully completed or not started.
3. If any part of the transaction fails, the entire transaction fails and the state of the database
remains unchanged.
4. If transaction unable to complete all the steps, then the system is returned to the state
before the transaction was started.
5. An example of atomic transaction is an account transfer transaction. The money is removed
from account A and added into account B.
If an error occurred after removing amount from account A, then the transaction processing
system will put that amount back to account A. that is system returned in its original state. This
is known as rollback.
B. Consistency:
1.Consistency property ensures that database remains in a consistent state before the start of
the transaction and after execution of transaction.
2. All the changes to the systemwill have been made properly and transaction will be in a valid
state.
3. If any error occurred then any changes made to the system will be automatically rolled back
to the state before transaction was started.
4. The systemwill be in a consistent state.
5. An example of account transfer transaction. The systemis in consistent state if the total of all
accounts is constant. If any error occurs and the money is removed from account A and not
added to account B, then the total in both account will change and it will became the value
before transaction was started.
By rolling back the removal from account A, the total will again what it should be and the
system back in a consistent state.
C. Isolation:
1. When a transaction runs in isolation, it appears to be the only action that the system is
carrying out at one time.
2. If there are two transactions performing same function at the same time, isolation ensures
that each transaction thinks it has exclusive use of the system.
3. If the transaction was not running in isolation, it can access data from system that may not
be consistent.
4. By providing transaction isolation this will prevent from happening.
5. Depending on the concurrency control method, the effect of an incomplete transaction will
not be visible to another transaction.
D. Durability:
1. A transaction is durable after it completed successfully.
2. All the changes made to the system after completion of transaction are permanent.
3. Once the transaction committed successfully it will remain constant if there is power loss
crashes or any errors.
4. There are safeguards to prevent the loss of information in the case of system failure.
5. The concept of durability allows the developer to know that a completed transaction is a
permanent part of the system.
Difference between static SQL and dynamic SQL.5M
No. Static SQL Dynamic SQL
1 In static SQL, SQL statements are compiled
at compile time.
In dynamic SQL, SQL statements are
compiled at run time.
2 SQL query parsing, validation and
optimization are done at compile time.
SQL query parsing, validation and
optimization are done at run time.
3 It is generally used for situations where
data is distributed uniformly.
It is generally used for situations where data
is distributed non-uniformly.
4 Execute immediate and executes
statements are not used.
Execute immediate and execute statements
are used.
5 Static SQL is less flexible. Dynamic SQL is more flexible.
6 Static SQL is more efficient. Dynamic SQL is less efficient.
7 It is also known as embedded SQL. It is also known as interactive SQL.
8 Static SQL is static in nature. Dynamic SQL is dynamic in nature.
Difference between OLTP and OLAP. 5/10M
No. OLTP OLAP
1 OLTP stands for online transaction
processing.
OLAP stands for online analytical processing.
2 OLTP is characterized by large number of
short online transactions.
OLAP is characterized by low volume of
transactions.
3 OLTP are the original source of the data. OLAP data comes from the various OLTP
databases.
4 OLTP is application oriented. OLAP is subject oriented.
5 OLTP is simple and short transaction. OLAP is complex query transaction.
6 Generally ER modeling is used to design
OLTP.
Dimensional modeling is used to design
OLAP.
7 OLTP is transaction oriented. OLAP is analysis oriented.
8 OLTP applications are used in database
management system.
OLAP applications are used in data
warehouses.
9 In OLTP system database size is 100MB to
GB.
In OLAP systemdatabase size is 100GB to
TB.
10 Data present in OLTP system is current
data.
Data present in OLAP systemis historic data.
11 OLTP system gives access to read or write
data.
OLAP system gives access to read data.
12 Data consists in OLTP systemis operational
processing data.
Data consists in OLAP system is
informational processing data.
13 Purpose of OLTP data is to control and run
fundamental business tasks.
Purpose of OLAP data is to help with
planning, problem solving and decision
support.
14 Processing speed in OLTP system is very
fast as compare to OLAP system.
Processing speed in OLAP systemis depends
on the amount of data involved.
15 Database design in OLTP system is highly
normalized with many tables.
Database design in OLAP systemis de-
normalized with fewer tables.
16 OLTP database schema is used to store
transactional databases.
OLAP database multidimensional schema is
used to store aggregated and historical
data.
Note on SQL injection. 5M
1. SQL injection is malfunction program used to hack databases.
2. SQL injection is a technique used for code injection which exploits security in the database
application programs.
3. Such SQL vulnerabilities are occurred when user input are not strongly checked.
4. SQL injection is one of the most common application layer attack technique used for
extracting valuable data from the databases.
5. SQL injection attacks:
i. Incorrectly filtered escape characters
ii. Incorrect type handling
iii. Vulnerabilities in database server
iv. Blind SQL injection
v. Conditional responses
vi. Conditional errors
vii. Time delays
6. Incorrectly filtered escape characters:
It occurs when user input is not properly filtered.
7. Incorrect type handling:
It occurs when a data field is not strongly typed checked for constraint.
8. Vulnerabilities in database server:
It occurs due to problem in server software.
9. Blind SQL injection:
This attack is used when a web application is vulnerable to an SQL injection but not visiblr to
the attacker.
10 Conditional responses:
This SQL injection evaluates a logical statement on an ordinary application screen.
11. Conditional errors:
This type of blind SQL injection attack causes some error.
12. Time delays:
Time delay is type of blind SQL injection. It causes to query to take infinite time to execute a
query.
List types of transparencies in distributed database and explain any one in detail. 5m
Types of transparencies in distributed databases:
a. Distribution/Network transparency
b. Fragmentation transparency
c. Replication transparency
a. Distribution/Network transparency:
1. In network transparency all internal network operations are hidden from the user.
2. Network transparency is divided into two transparencies:
i. Location transparency
ii. Naming transparency
i. Location transparency refers to task performed by user is independent of the location of data
and the location of the system.
ii. Naming transparency states that once a name is specified, these objects can be accessed
unambiguously.
3.
b. Fragmentation transparency:
1. The process of decomposing database into smaller multiple units is called as fragmentation
transparency.
2. In this fragmentation user accesses the data as like normal non fragmented data.
3.
c. Replication transparency:
1. Copy of data at multiple sites and location for better performance and availability is called as
replication transparency.
2. Replication transparency makes user unaware of the existence of copies of data.
3.
Explain SQL trigger with example. 5M/10M
1. The SQL CREATE TRIGGER statement provides a way for database management systemto
actively control, monitor and manage a group of table whenever an insert, update or delete
operation is performed.
2. The statement specified in SQL trigger is executed each time an SQL insert, update, delete
operation is performed.
3. An SQL trigger may call stored procedure or an additional user defined functions to perform
additional processing when the trigger is executed.
4. Triggers are stored in database as a simple database object.
5. A database that has asset of associated trigger called as active database.
6. An SQL trigger cannot directly called from an application. Instead, an SQL trigger is invoked
by the database management systemupon the execution of triggering insert, update or delete
operation.
7. SQL trigger is invoked by the database management system when the SQL table that the
trigger is defined on, is modified.
8. Components of trigger: SQL trigger consist of following components (ECA).
i. Event: Performs insert, update or delete operations.
ii. Condition: A condition that must be satisfied for execution of trigger.
iii. Action: This code executed when trigger condition is satisfied.
9. Types of trigger: There are two types of triggers: Row level trigger and Statement level
trigger.
i. Row level trigger fixed each time when the table is affected by trigger statement.
ii. Statement level trigger executes only once if no rows are affected by trigger statement.
10. Operations on trigger:
i. Data dictionary for trigger:
select * from user trigger where trigger_name=’<trigger_name>’;
ii. Dropping trigger:
drop trigger <trigger_name>;
iii. Disabling trigger:
alert trigger <trigger_name> {disable|enable};
11. Parameters used in trigger: CREATE, REPLACE, BEFORE, AFTER, INSERT, UPDATE, DELETE,
REFERENCING, FOR EACH ROW, WHEN, <TRIGGER_NAME>, <TRIGGER_CODE>, EXCEPTION.
12. Trigger syntax:
Create [OR replace] trigger <trigger_name>
[<ENABLE|DISABLE>]
<BEFORE|AFTER>
<INSERT|UPDATE|DELETE>
[of <column_name_list>]
ON <table_name>
[referencing new as <synonym> old as <synonym>]
[for each row][when (<trigger_condition>)]
declare
Variable definitions>
BEGIN
<trigger_code>
Exception
<exception_clauses>
ENN<trigger_name>;
13. Examples of trigger:
i.
create table source (source_id int IDENTITY, source_desc varchar(10))
go
create trigger tr_source_insert
ON source
FOR insert
AS
PRINT GETDATE()
Go
Insert source (source_desc) values(“Test 1”):
ii.
create table CS (student_ID int IDENTITY, student_desc varchar(90))
go
create trigger CSAutoRecruit
after insert on student
referencing new as newstudent
when(newstudent.GPA>3.0)
insert into take values(newstudent.SID,’CS’)
FOR EACH ROW;

More Related Content

Similar to Advanced Database Management Syatem

Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5kaashiv1
 
The Cloud Is NOT Just Someone Else's Computer
The Cloud Is NOT Just Someone Else's ComputerThe Cloud Is NOT Just Someone Else's Computer
The Cloud Is NOT Just Someone Else's Computer
James Cupps
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
gurjotkawatra
 
1. Transaction Processing and Concurrency Control.pptx
1. Transaction Processing and Concurrency Control.pptx1. Transaction Processing and Concurrency Control.pptx
1. Transaction Processing and Concurrency Control.pptx
calf_ville86
 
Distributed system
Distributed systemDistributed system
Distributed system
chirag patil
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
Abhishek Jaisingh
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
Mahabubur Rahaman
 
Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Antonios Chatzipavlis
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
WajeehaBaig
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
Rahul Prajapati
 
What is active-active
What is active-activeWhat is active-active
What is active-active
Saif Ahmad
 
data warehousing need and characteristics. types of data w data warehouse arc...
data warehousing need and characteristics. types of data w data warehouse arc...data warehousing need and characteristics. types of data w data warehouse arc...
data warehousing need and characteristics. types of data w data warehouse arc...
aasifkuchey85
 
Cost effective failover clustering
Cost effective failover clusteringCost effective failover clustering
Cost effective failover clustering
eSAT Publishing House
 
Cost effective failover clustering
Cost effective failover clusteringCost effective failover clustering
Cost effective failover clustering
eSAT Journals
 
Db lec 07_new
Db lec 07_newDb lec 07_new
Db lec 07_new
Ramadan Babers, PhD
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9phanleson
 

Similar to Advanced Database Management Syatem (20)

Chapter 4 u
Chapter 4 uChapter 4 u
Chapter 4 u
 
Ebook5
Ebook5Ebook5
Ebook5
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
 
The Cloud Is NOT Just Someone Else's Computer
The Cloud Is NOT Just Someone Else's ComputerThe Cloud Is NOT Just Someone Else's Computer
The Cloud Is NOT Just Someone Else's Computer
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
1. Transaction Processing and Concurrency Control.pptx
1. Transaction Processing and Concurrency Control.pptx1. Transaction Processing and Concurrency Control.pptx
1. Transaction Processing and Concurrency Control.pptx
 
Distributed system
Distributed systemDistributed system
Distributed system
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
 
Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)Concurrency in SQL Server (SQL Night #24)
Concurrency in SQL Server (SQL Night #24)
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
 
What is active-active
What is active-activeWhat is active-active
What is active-active
 
Tps
TpsTps
Tps
 
data warehousing need and characteristics. types of data w data warehouse arc...
data warehousing need and characteristics. types of data w data warehouse arc...data warehousing need and characteristics. types of data w data warehouse arc...
data warehousing need and characteristics. types of data w data warehouse arc...
 
Cost effective failover clustering
Cost effective failover clusteringCost effective failover clustering
Cost effective failover clustering
 
Cost effective failover clustering
Cost effective failover clusteringCost effective failover clustering
Cost effective failover clustering
 
Db lec 07_new
Db lec 07_newDb lec 07_new
Db lec 07_new
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9
 

More from chirag patil

Wh Yes-No questions.pptx
Wh Yes-No questions.pptxWh Yes-No questions.pptx
Wh Yes-No questions.pptx
chirag patil
 
joining words not only but also.pptx
joining words not only but also.pptxjoining words not only but also.pptx
joining words not only but also.pptx
chirag patil
 
Basic English Grammar 2.pptx
Basic English Grammar 2.pptxBasic English Grammar 2.pptx
Basic English Grammar 2.pptx
chirag patil
 
Basic English Grammar.pptx
Basic English Grammar.pptxBasic English Grammar.pptx
Basic English Grammar.pptx
chirag patil
 
Maths formulae
Maths formulaeMaths formulae
Maths formulae
chirag patil
 
Input output devices
Input output devicesInput output devices
Input output devices
chirag patil
 
Shortcut keys
Shortcut keysShortcut keys
Shortcut keys
chirag patil
 
Operating system
Operating systemOperating system
Operating system
chirag patil
 
Network topology
Network topologyNetwork topology
Network topology
chirag patil
 
Decimal and binary conversion
Decimal and binary conversionDecimal and binary conversion
Decimal and binary conversion
chirag patil
 
Abbreviations and full forms
Abbreviations and full formsAbbreviations and full forms
Abbreviations and full forms
chirag patil
 
ASCII Code
ASCII CodeASCII Code
ASCII Code
chirag patil
 
Web engineering and Technology
Web engineering and TechnologyWeb engineering and Technology
Web engineering and Technology
chirag patil
 
Web data management
Web data managementWeb data management
Web data management
chirag patil
 
Web application development
Web application developmentWeb application development
Web application development
chirag patil
 
Programming the web
Programming the webProgramming the web
Programming the web
chirag patil
 
Operating System
Operating SystemOperating System
Operating System
chirag patil
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
chirag patil
 
Computer Graphics and Virtual Reality
Computer Graphics and Virtual RealityComputer Graphics and Virtual Reality
Computer Graphics and Virtual Reality
chirag patil
 
The law of attraction for positive things
The law of attraction for positive thingsThe law of attraction for positive things
The law of attraction for positive things
chirag patil
 

More from chirag patil (20)

Wh Yes-No questions.pptx
Wh Yes-No questions.pptxWh Yes-No questions.pptx
Wh Yes-No questions.pptx
 
joining words not only but also.pptx
joining words not only but also.pptxjoining words not only but also.pptx
joining words not only but also.pptx
 
Basic English Grammar 2.pptx
Basic English Grammar 2.pptxBasic English Grammar 2.pptx
Basic English Grammar 2.pptx
 
Basic English Grammar.pptx
Basic English Grammar.pptxBasic English Grammar.pptx
Basic English Grammar.pptx
 
Maths formulae
Maths formulaeMaths formulae
Maths formulae
 
Input output devices
Input output devicesInput output devices
Input output devices
 
Shortcut keys
Shortcut keysShortcut keys
Shortcut keys
 
Operating system
Operating systemOperating system
Operating system
 
Network topology
Network topologyNetwork topology
Network topology
 
Decimal and binary conversion
Decimal and binary conversionDecimal and binary conversion
Decimal and binary conversion
 
Abbreviations and full forms
Abbreviations and full formsAbbreviations and full forms
Abbreviations and full forms
 
ASCII Code
ASCII CodeASCII Code
ASCII Code
 
Web engineering and Technology
Web engineering and TechnologyWeb engineering and Technology
Web engineering and Technology
 
Web data management
Web data managementWeb data management
Web data management
 
Web application development
Web application developmentWeb application development
Web application development
 
Programming the web
Programming the webProgramming the web
Programming the web
 
Operating System
Operating SystemOperating System
Operating System
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Computer Graphics and Virtual Reality
Computer Graphics and Virtual RealityComputer Graphics and Virtual Reality
Computer Graphics and Virtual Reality
 
The law of attraction for positive things
The law of attraction for positive thingsThe law of attraction for positive things
The law of attraction for positive things
 

Recently uploaded

一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 

Recently uploaded (20)

一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 

Advanced Database Management Syatem

  • 1. What is view? Discuss the difference between a view and a base relation. 5M View: 1. A view is defined as a database object that allows us to create a virtual table in the database. 2. View is defined to hide complexity of query from user. 3. The table on which view is defined is called as base table. 4. There are two types of view: simple view and complex view. 5. Simple view allows DML operations. 6. In simple view views base on only one table and in complex view views base on more than one table. 7. Complex view has join and grouping conditions. 8. Simple view has simple SQL conditions. Difference between a view and a base relation: No. Views Base relation 1 This is one type of relation which is not a part of the physical database. A base relation is a relation that is not a derived relation. It consists of virtual data. 2 It has no direct or physical relation with the database. It has physical relation with the database. 3 Views can be used to provide security mechanism. Base relation does not provide security. 4 Modification through a view generally not permitted. Modification may be done with a base relation. 5 A view is query over one or more base relation. A base relation contains data. 6 Views are dependent on base tables. Base tables are not dependent on views. 7 Using views complex query can be solved. Using base tables complex query cannot be solved. ACID properties 5M ACID stands for Atomicity, Consistency, Isolation and Durability. A. Atomicity: 1. The atomicity property identifies that the transaction is atomic. 2. Atomic transaction means transaction is fully completed or not started.
  • 2. 3. If any part of the transaction fails, the entire transaction fails and the state of the database remains unchanged. 4. If transaction unable to complete all the steps, then the system is returned to the state before the transaction was started. 5. An example of atomic transaction is an account transfer transaction. The money is removed from account A and added into account B. If an error occurred after removing amount from account A, then the transaction processing system will put that amount back to account A. that is system returned in its original state. This is known as rollback. B. Consistency: 1.Consistency property ensures that database remains in a consistent state before the start of the transaction and after execution of transaction. 2. All the changes to the systemwill have been made properly and transaction will be in a valid state. 3. If any error occurred then any changes made to the system will be automatically rolled back to the state before transaction was started. 4. The systemwill be in a consistent state. 5. An example of account transfer transaction. The systemis in consistent state if the total of all accounts is constant. If any error occurs and the money is removed from account A and not added to account B, then the total in both account will change and it will became the value before transaction was started. By rolling back the removal from account A, the total will again what it should be and the system back in a consistent state. C. Isolation: 1. When a transaction runs in isolation, it appears to be the only action that the system is carrying out at one time. 2. If there are two transactions performing same function at the same time, isolation ensures that each transaction thinks it has exclusive use of the system. 3. If the transaction was not running in isolation, it can access data from system that may not be consistent.
  • 3. 4. By providing transaction isolation this will prevent from happening. 5. Depending on the concurrency control method, the effect of an incomplete transaction will not be visible to another transaction. D. Durability: 1. A transaction is durable after it completed successfully. 2. All the changes made to the system after completion of transaction are permanent. 3. Once the transaction committed successfully it will remain constant if there is power loss crashes or any errors. 4. There are safeguards to prevent the loss of information in the case of system failure. 5. The concept of durability allows the developer to know that a completed transaction is a permanent part of the system. Difference between static SQL and dynamic SQL.5M No. Static SQL Dynamic SQL 1 In static SQL, SQL statements are compiled at compile time. In dynamic SQL, SQL statements are compiled at run time. 2 SQL query parsing, validation and optimization are done at compile time. SQL query parsing, validation and optimization are done at run time. 3 It is generally used for situations where data is distributed uniformly. It is generally used for situations where data is distributed non-uniformly. 4 Execute immediate and executes statements are not used. Execute immediate and execute statements are used. 5 Static SQL is less flexible. Dynamic SQL is more flexible. 6 Static SQL is more efficient. Dynamic SQL is less efficient. 7 It is also known as embedded SQL. It is also known as interactive SQL. 8 Static SQL is static in nature. Dynamic SQL is dynamic in nature. Difference between OLTP and OLAP. 5/10M No. OLTP OLAP 1 OLTP stands for online transaction processing. OLAP stands for online analytical processing. 2 OLTP is characterized by large number of short online transactions. OLAP is characterized by low volume of transactions. 3 OLTP are the original source of the data. OLAP data comes from the various OLTP databases. 4 OLTP is application oriented. OLAP is subject oriented.
  • 4. 5 OLTP is simple and short transaction. OLAP is complex query transaction. 6 Generally ER modeling is used to design OLTP. Dimensional modeling is used to design OLAP. 7 OLTP is transaction oriented. OLAP is analysis oriented. 8 OLTP applications are used in database management system. OLAP applications are used in data warehouses. 9 In OLTP system database size is 100MB to GB. In OLAP systemdatabase size is 100GB to TB. 10 Data present in OLTP system is current data. Data present in OLAP systemis historic data. 11 OLTP system gives access to read or write data. OLAP system gives access to read data. 12 Data consists in OLTP systemis operational processing data. Data consists in OLAP system is informational processing data. 13 Purpose of OLTP data is to control and run fundamental business tasks. Purpose of OLAP data is to help with planning, problem solving and decision support. 14 Processing speed in OLTP system is very fast as compare to OLAP system. Processing speed in OLAP systemis depends on the amount of data involved. 15 Database design in OLTP system is highly normalized with many tables. Database design in OLAP systemis de- normalized with fewer tables. 16 OLTP database schema is used to store transactional databases. OLAP database multidimensional schema is used to store aggregated and historical data. Note on SQL injection. 5M 1. SQL injection is malfunction program used to hack databases. 2. SQL injection is a technique used for code injection which exploits security in the database application programs. 3. Such SQL vulnerabilities are occurred when user input are not strongly checked. 4. SQL injection is one of the most common application layer attack technique used for extracting valuable data from the databases. 5. SQL injection attacks: i. Incorrectly filtered escape characters ii. Incorrect type handling iii. Vulnerabilities in database server
  • 5. iv. Blind SQL injection v. Conditional responses vi. Conditional errors vii. Time delays 6. Incorrectly filtered escape characters: It occurs when user input is not properly filtered. 7. Incorrect type handling: It occurs when a data field is not strongly typed checked for constraint. 8. Vulnerabilities in database server: It occurs due to problem in server software. 9. Blind SQL injection: This attack is used when a web application is vulnerable to an SQL injection but not visiblr to the attacker. 10 Conditional responses: This SQL injection evaluates a logical statement on an ordinary application screen. 11. Conditional errors: This type of blind SQL injection attack causes some error. 12. Time delays: Time delay is type of blind SQL injection. It causes to query to take infinite time to execute a query. List types of transparencies in distributed database and explain any one in detail. 5m Types of transparencies in distributed databases: a. Distribution/Network transparency b. Fragmentation transparency c. Replication transparency
  • 6. a. Distribution/Network transparency: 1. In network transparency all internal network operations are hidden from the user. 2. Network transparency is divided into two transparencies: i. Location transparency ii. Naming transparency i. Location transparency refers to task performed by user is independent of the location of data and the location of the system. ii. Naming transparency states that once a name is specified, these objects can be accessed unambiguously. 3. b. Fragmentation transparency: 1. The process of decomposing database into smaller multiple units is called as fragmentation transparency. 2. In this fragmentation user accesses the data as like normal non fragmented data. 3.
  • 7. c. Replication transparency: 1. Copy of data at multiple sites and location for better performance and availability is called as replication transparency. 2. Replication transparency makes user unaware of the existence of copies of data. 3.
  • 8. Explain SQL trigger with example. 5M/10M 1. The SQL CREATE TRIGGER statement provides a way for database management systemto actively control, monitor and manage a group of table whenever an insert, update or delete operation is performed. 2. The statement specified in SQL trigger is executed each time an SQL insert, update, delete operation is performed. 3. An SQL trigger may call stored procedure or an additional user defined functions to perform additional processing when the trigger is executed. 4. Triggers are stored in database as a simple database object. 5. A database that has asset of associated trigger called as active database. 6. An SQL trigger cannot directly called from an application. Instead, an SQL trigger is invoked by the database management systemupon the execution of triggering insert, update or delete operation. 7. SQL trigger is invoked by the database management system when the SQL table that the trigger is defined on, is modified. 8. Components of trigger: SQL trigger consist of following components (ECA). i. Event: Performs insert, update or delete operations. ii. Condition: A condition that must be satisfied for execution of trigger. iii. Action: This code executed when trigger condition is satisfied. 9. Types of trigger: There are two types of triggers: Row level trigger and Statement level trigger. i. Row level trigger fixed each time when the table is affected by trigger statement. ii. Statement level trigger executes only once if no rows are affected by trigger statement. 10. Operations on trigger: i. Data dictionary for trigger: select * from user trigger where trigger_name=’<trigger_name>’; ii. Dropping trigger:
  • 9. drop trigger <trigger_name>; iii. Disabling trigger: alert trigger <trigger_name> {disable|enable}; 11. Parameters used in trigger: CREATE, REPLACE, BEFORE, AFTER, INSERT, UPDATE, DELETE, REFERENCING, FOR EACH ROW, WHEN, <TRIGGER_NAME>, <TRIGGER_CODE>, EXCEPTION. 12. Trigger syntax: Create [OR replace] trigger <trigger_name> [<ENABLE|DISABLE>] <BEFORE|AFTER> <INSERT|UPDATE|DELETE> [of <column_name_list>] ON <table_name> [referencing new as <synonym> old as <synonym>] [for each row][when (<trigger_condition>)] declare Variable definitions> BEGIN <trigger_code> Exception <exception_clauses> ENN<trigger_name>; 13. Examples of trigger: i. create table source (source_id int IDENTITY, source_desc varchar(10))
  • 10. go create trigger tr_source_insert ON source FOR insert AS PRINT GETDATE() Go Insert source (source_desc) values(“Test 1”): ii. create table CS (student_ID int IDENTITY, student_desc varchar(90)) go create trigger CSAutoRecruit after insert on student referencing new as newstudent when(newstudent.GPA>3.0) insert into take values(newstudent.SID,’CS’) FOR EACH ROW;