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

Dbms Notes Unit5

Dbms notes 2

Uploaded by

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

Dbms Notes Unit5

Dbms notes 2

Uploaded by

Dawood Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

A temporal database management system (DBMS) is a DBMS that provides built-in support for the time

dimension, including special facilities for storing, querying, and updating data with respect to time. A
temporal DBMS can distinguish between historical data, current data, and data that will be in effect in the
future.

The intent of a temporal database management system is to reason with time.

A temporal DBMS provides a temporal version of SQL, including enhancements to the data definition
language (DDL), constraint specifications and their enforcements, data types, data manipulation language
(DML), and query language for temporal tables.

A temporal database stores data that relates to time periods and time instances. It provides temporal data
types and stores information relating to the past, present, and future. For example, it stores the history of a
stock or the movement of employees within an organization. The difference between a temporal database
and a conventional database is that a temporal database maintains data with respect to time and allows
time-based reasoning, whereas a conventional database captures only a current snapshot of reality.

For example, a conventional database cannot directly support historical queries about past status and
cannot represent inherently retroactive or proactive changes. Without built-in temporal table support from
the DBMS, applications are forced to use complex and often manual methods to manage and maintain
temporal information.

Static, time-related columns can be added to tables by adding columns defined to have DateTime data
types, such as DATE or TIMESTAMP. Teradata also supports two built-in time dimensions that can be
used to create temporal tables: transaction time and valid time.

Each of these time dimensions is represented by a column with a period data type. The column stores a
pair of DATE or TIMESTAMP values that define the beginning and end of the transaction- or valid-time
period for a row. Transaction time and valid time are independent time dimensions. A table can have
either type of column, both, or neither:

 A table with a transaction-time column is called a transaction-time table.


 A table with a valid-time column is called a valid-time table.
 A table with both a transaction-time and a valid-time column is called a bitemporal table.
 A table with neither a transaction-time nor a valid-time column is a nontemporal table.

 Temporal data have an association time interval during which the data are valid.
 A snapshot is the value of the data at a particular point in time
 Several proposals to extend ER model by adding valid time to
• attributes, e.g., address of an instructor at different points in time
• entities, e.g., time duration when a student entity exists
• relationships, e.g., time during which an instructor was associated with a student as an
advisor.
 But no accepted standard
 Adding a temporal component results in functional dependencies like

ID  street, city

not holding, because the address varies over time


 A temporal functional dependency X  Y holds on schema R if the functional dependency X
 Y holds on all snapshots for all legal instances r (R).

Multimedia database

Multimedia is a combination of text, graphics, animations, audio and video converted from different
formats into digital media. The extension of database application to handle multimedia objects requires
synchronization of multiple media data streams. Time-related characteristics of multimedia data should
be superimposed on the existing database. This paper will try to focus on several aspects of multimedia
databases- its need, structure and method of handling multimedia components in order to render
multimedia services to its users.

Multimedia database is a kind of database like any other databases containing multimedia collections.
Multimedia is defined as the combination of more than one media, they may be of two types--static and
dynamic media. Text, graphics, and images are categorized as static media; on the other hand, objects
like- animation, music, audio, speech, video are categorized as dynamic media. Graphic images may
consist of cliparts, photographs, logos, and custom drawings. Sound consists of voice narration, speech,
music etc. Video data encompasses sound as well as photos. To manage these data multimedia
database management system is essential. Multimedia database management system can be defined as
a software system that manages a collection of multimedia data and provides access to users to query
and retrieve multimedia objects. Generally, multimedia database contains text, image, animatio n,
video, audio, movie sound etc. But, all data are stored in the database in binary form.

Multimedia Database is capable of hand ling huge volume of multimedia objects which a general
database fails to do effectively; ÿ Multimedia Database will help to create virtual museum; ÿ It will surely
help to develop multimedia applications in various fields like teaching, medical sciences and libraries; ÿ
Preserving decaying photographs, maps, films having got historical evidence or national importance; ÿ
Using multimedia database, we can develop the excellent teaching packages; ÿ Helps multi-user
operations.

Charasteristics: Corresponding storage media ÿ Comprehensive search methods ÿ Device and format
Independence Interface ÿ Simultaneous data access ÿ Management of large amount of data ÿ Relational
consistency of Data Management ÿ Long Transaction

Data retrieval The ultimate objective of any multimedia database is how to access multimedia
information effectively. With respect to access, multimedia objects can be classified into two-- active
and passive objects. The objects, which participate in the retrieval process, are called active objects.
Similarly, the objects, which are not participating in the retrieval process are called passive objects. In a
really multimedia database environment all objects should be active objects.

Query language In order to retrieve multimedia data from database system, query language is provided
to fulfill this purpose. In a DBMS process, user queries are processed by defining a query language as
part of DBMS. It is an unseparated part of DBMS. A multimedia query language must have ability to
handle complex, spatial, and temporal relationships. A powerful query language should have to deal
with keywords, index to keywords and contents of multimedia objects. Traditional DBMS deals with
exact match query. Generally, there are two types of queries used in databases. They are well-defined
query and fuzzy query. In a well-defined Paper: BC Samir Kumar Jalal 10 query, the user must know what
they are intended to search. The second one is called fuzzy where the properties of query objects are
ambiguous. In such a situation, multimedia data queries can be divided into the sub-groups like keyword
querying, semantic querying, and visual querying. Keyword querying is still popular because of its
simplicity. Semantic query is the most difficult query method in terms of its indexing and pattern
matching. Visual querying is used in QBIC (Query By Image Context) through icon leading to content
search in the domain of image.

Data dictionary

A data dictionary in Database Management System (DBMS) can be defined as a component that stores
the collection of names, definitions, and attributes for data elements that are being used in a database.
The Data Dictionary stores metadata, i.e., data about the database. These data elements are then used
as part of a database, research project, or information system. Data Dictionary is made up of two words,
data which means the collected information through multiple sources, and dictionary meaning the place
where all this information is made available. A data dictionary is a crucial part of a relational database as
it provides additional information about the relationships between multiple tables in a database. The
data dictionary in DBMS helps the user to arrange data in a neat and well-organized way, thus
preventing data redundancy.

Below is a data dictionary describing the table containing employee details.

Attribute Name Data Type Max Field Size Description isRequired


Employee ID Integer 10 A unique ID for each Employee Yes
Name Text 25 Name of the Employee Yes
Date of Birth DateTime 10 Date of Birth of the Employee Yes
Mobile Number Integer 10 Contact Number of the Employee Yes
Some advantages of using a data dictionary are:

Data models in DBMS provide very little information about the database, so a data dictionary is very
essential to have proper knowledge about entities, relationships, and attributes that are present in a
data model.
The Data Dictionary provides consistency by reducing data redundancy in the collection and use of data
across various members of a team.
The Data Dictionary provides structured analysis and design tools by enforcing the use of data
standards. Data standards are the set of rules that govern the way data is collected, recorded, and
represented.
Using a Data Dictionary helps to define naming conventions that are used in a model.
There are mainly two types of data dictionary in a database management system:

Integrated Data Dictionary : This integrated data dictionary acts as a system catalog that is accessed and
updated by the relational database. Embedded in DB

Stand Alone Data Dictionary: A stand-alone data dictionary allows database designers to interact with
end-users regardless of the data dictionary format.

Hierarchical Queries
If a table contains hierarchical data, then you can select rows in a hierarchical order
using the hierarchical query clause:

Oracle processes hierarchical queries as follows:

 A join, if present, is evaluated first, whether the join is specified in the FROM clause or
with WHERE clause predicates.
 The CONNECT BY condition is evaluated.
 Any remaining WHERE clause predicates are evaluated.
The following hierarchical query uses the CONNECT BY clause to define the relationship between
employees and managers:

SELECT employee_id, last_name, manager_id


FROM employees
CONNECT BY PRIOR employee_id = manager_id;

The next example is similar to the preceding example, but uses the LEVEL pseudocolumn to
show parent and child rows:

SELECT employee_id, last_name, manager_id, LEVEL


FROM employees
CONNECT BY PRIOR employee_id = manager_id;
Both the CONNECT BY condition and the PRIOR expression can take the form of an uncorrelated
subquery. However, CURRVAL and NEXTVAL are not valid PRIOR expressions, so
the PRIOR expression cannot refer to a sequence.
START WITH specifies the root row(s) of the hierarchy.
CONNECT BY specifies the relationship between parent rows and child rows of the
hierarchy.

Inline query : An inline query is a query in the FROM clause (defined by Oracle
SQL)
In the FROM clause, we’ve used the inline view (called avg_movie_ratings and shown
in bold) to compute the average rating for each movie. Then, from the averages, we
selected the biggest value. The inline view we’ve used works like a temporary table.
For ex.
SELECT
MAX(avg_rating) AS max_avg_rating
FROM (
SELECT
AVG(rating) AS avg_rating
FROM rating
GROUP BY movie_id
) AS avg_movie_ratings; this is inline query

Inline query v/s subquery


The first difference is that inline views can contain multiple columns, while
subqueries (in the Oracle meaning) should return only one The reason is simple –
an inline view works like a table and tables can contain more than one column.
Subqueries, on the other hand, generally work as a single value.

Flashback Query
Flashback Query is a powerful feature available in some SQL databases, such
as Oracle, that allows users to view or restore data as it existed at a previous point
in time.
This functionality is especially useful for recovering from accidental data changes
or deletions and for auditing historical data. In this article, We will learn about
the Flashback Queries in detail.

You perform a Flashback Query using a SELECT statement with an AS OF clause. You use a
Flashback Query to retrieve data as it existed at some time in the past. The query explicitly
references a past time using a timestamp or SCN. It returns committed data that was current at
that point in time.
Oracle Database Flashback Technologies is a rich set of data recovery solutions that reverse
human and logical errors by selectively and efficiently undoing the effects of a mistake. Before
Flashback, it might take minutes to damage a database but hours to recover.

For example, suppose John gives a delete statement at 10 AM and commits it. After 1 hour he
realizes that delete statement is mistakenly performed. Now he can give a flashback AS.. OF query
to get back the deleted rows like this.

Flashback Query

SQL>select * from emp as of timestamp sysdate-1/24;

Or

SQL> SELECT * FROM emp AS OF TIMESTAMP


TO_TIMESTAMP('2007-06-07 10:00:00', 'YYYY-MM-DD HH:MI:SS')

You might also like