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

DBMS LabViva Qns

Uploaded by

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

DBMS LabViva Qns

Uploaded by

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

DBMS LAB Viva Questions and answers.

1. Define Database

▫ The collection of data

2. Database-management system (DBMS): is a collection of interrelated data and a set of programs to access those
data. General purpose software system that facilitates process of defining, constructing, manipulating, and sharing
database. DBMS is a general purpose software system that facilitates process of defining, constructing, manipulating,
and sharing database. We call the database and DBMS software together a database system.

3. What is a data abstraction?

The characteristic that allows program-data independence and program operation independence is called data
abstraction. A data model is a type of data abstraction that is used to provide conceptual representation

4. Concurrency

DBMS must include concurrency control software to ensure that several users trying to update the same data do so in
a controlled manner so that the result of the updates is correct

5. Isolation property

Ensures that each transaction appears to execute in isolation from other transactions even though hundreds of
transactions may be executing concurrently.

6. Atomicity Property

Ensures that either all the database operations in a transaction are executed or none are. Any mechanical or electrical
device is subject to failure, and so is the computer system. In this case we have to ensure that data should be restored
to a consistent state.

7. Advantages of DBMS

 Controlling Redundancy
 Restricting Unauthorized Access
 Providing Storage Structures for Efficient
 Query Processing
 Providing Backup and Recovery
 Providing Multiple User Interfaces
 Representing Complex Relationship among Data
 Enforcing Integrity Constraints
 Permitting Inferencing and Actions using Rules

8. Disadvantages of DBMS

 Cost of Hardware & Software


 Cost of Data Conversion
 Cost of Staff Training
 Appointing Technical Staff
 Database Damage

9. Structured, Semi-structured and Unstructured data:


Structured data

• Represented in a strict format


• It has been organized into a formatted repository that is typically a database.
• It concerns all data which can be stored in database SQL in a table with rows and columns
• Example: Relational data

Semi-Structured data

Information that does not reside in a relational database but that have some organizational properties that make it
easier to analyse. With some process, you can store them in the relation database. Eg: XML data.

Unstructured data

Data which is not organized in a predefined manner or does not have a predefined data model, thus it is not a good fit
for a mainstream relational database there are alternative platforms for storing and managing, it is increasingly
prevalent in IT systems and is used by organizations in a variety of business intelligence and analytics applications.

10. An entity represents a real-world object or concept

11. An attribute represents some property of interest that further describes an entity.

12. A relationship among two or more entities represents an interaction among the entities.

13. Schema Evolution.

The schema is not supposed to change frequently, but it is not uncommon that changes occasionally need to be applied
to the schema as the application requirements change. It is called schema evolution.

14. Mapping

The processes of transforming requests and results between levels are called mappings.

15. Data Independence

The capacity to change the schema at one level of a database system without having to change

the schema at the next higher level

• Two types of data independence:

1. Logical data independence

2. Physical data independence

16. DDL, SDL, VDL, DML

Data definition language ( DDL ), is used by the to define conceptual and internal schemas.

Storage definition language ( SDL ), is used to specify the internal schema.

View definition language ( VDL ), to specify user views and their mappings to conceptual schema

Data Manipulation Language(DML) is used for retrieval, insertion, deletion, and modificationDBA and by database
designers

17. DBMS architecture are of different types:

1. Centralized database

2. Basic client/server architecture


3. Two tire client server architecture

4. Three and n-tire architecture for web applications

18. ER Diagram

• High level conceptual data model


• It is used for conceptual data design of database applications
• Collection of entities and their properties called attributes and relationship between them
• Diagrammatic representation and easy to understand for non technical users

19. Recursive Relationships

In some cases same entity type participate more than once in a relationship type in different roles, so in this role name
is essential for distinguishing meaning of the role the participating entity plays they are recursive relationships.

20. Degree of a relationship

It is the number of entity set which are participating in a relationship

• Unary relationship
• Binary Relationship
• Ternary Relationship

21. Components of relational database.

• Domains
• Tuples (rows)
• Columns (attributes)
• Keys
• Relations (Tables)

22. SQL DML (Data Manipulation Language)

SQL queries on single and multiple tables, Nested queries (correlated and non-correlated), Aggregation and grouping,
Views, assertions, Triggers, SQL data types.

23. Data-manipulation language(DML)

The SQL DML provides the ability to query information from the database and to insert tuples into, delete tuples
from, and modify tuples in the database.

▫ Integrity: The SQL DDL includes commands for specifying integrity constraints that the data stored in the database
must satisfy. Updates that violate integrity constraints are disallowed.

▫ View definition: The SQL DDL includes commands for defining views.

▫ Transaction control: SQL includes commands for specifying the beginning and ending of

transactions.

24. Select statement:

SQL has one basic statement for retrieving information from a database; the SELECT statement

25.

• The SELECT-clause lists the attributes or functions to be retrieved


• The FROM-clause specifies all relations (or aliases) needed in the query but not those needed in nested
queries
• The WHERE-clause specifies the conditions for selection and join of tuples from the relations specified in the
FROM-clause
• GROUP BY specifies grouping attributes
• HAVING specifies a condition for selection of groups
• ORDER BY specifies an order for displaying the result of a query
• A query is evaluated by first applying the WHERE-clause, then GROUP BY and HAVING, and finally the
SELECT-clause
• There are three SQL commands to modify the database; INSERT, DELETE, and UPDATE

26. What are some benefits of PL/SQL packages?

you can use a PL/SQL package to store all related functions and procedures in one unit. It allows the memory to load
multiple objects and allows all the code blocks to run simultaneously while reducing traffic. Both these factors help
improve performance. With a PL/SQL package, developers can implement the object-oriented design in a top-down
fashion. They can create the interface by referring to hidden code in the PL/SQL package. If you modify one module
in a PL/SQL package, you can make similar changes in another.

27. What is the command you use to get the privileges offered by Grant command?

REVOKE

28. What is a PL/SQL package? What does it consist of?

PL/SQL packages are a way to organize and encapsulate related procedures, functions, variables, triggers, and other
PL/SQL items into a single item. Packages provide a modular approach to write and maintain the code. It makes it
easy to manage large codes.

A package is compiled and then stored in the database, which then can be shared with many applications. The package
also has specifications, which declare an item to be public or private. Public items can be referenced from outside of
the package.

A PL/SQL package is a collection of related Procedures, Functions, Variables, and other elements that are grouped for
Modularity and Reusability.

29. What is the need of packages?

The needs of the Packages are described below:

• Modularity: Packages provide a modular structure, allowing developers to organize and manage code
efficiently.
• Code Reusability: Procedures and functions within a package can be reused across multiple programs,
reducing redundancy.
• Private Elements: Packages support private procedures and functions, limiting access to certain code
components.
• Encapsulation: Packages encapsulate related logic, protecting internal details and promoting a clear interface
to other parts of the code.

30. A PL/SQL package consists?

• A package Specification
• A package Body

31. The PL/SQL compilation process involves:

• Parsing: The PL/SQL code is checked for syntax errors.


• Compilation: The code is converted into a format the Oracle Database can execute.
• Storage: The compiled code is stored in the database.
• Execution: When the PL/SQL code is called, it is executed by the database engine.

32. What is exception handling in PL/SQL?

An exception is an error which disrupts the normal flow of program instructions. PL/SQL provides us the exception
block which raises the exception thus helping the programmer to find out the fault and resolve it.

There are two types of exceptions defined in PL/SQL

• User defined exception.


• System defined exceptions.

33. Types of Views

• Simple View: A view based on only a single table, which doesn't contain GROUP BY clause and any
functions.
• Complex View: A view based on multiple tables, which contain GROUP BY clause and functions.

34. What are PL/SQL cursors?

A cursor is a named control structure used by an application program to point to and select a row of data from a result
set. Instead of executing a query all at once, you can use a cursor to read and process the query result set one row at a
time.

35. Explain the cursor execution cycle.

The life cycle of the cursor is described into the following five stages:

• Declare a Cursor.
• Open Cursor.
• Fetch Data from Cursor.
• Close Cursor Connection.
• Deallocate cursor.

36. What is NVL used for?

The NVL function is used to replace NULL values with a default value in a database query. It is primarily used to
provide more meaningful data when NULL values are encountered in query results.

37. How would you differentiate between the cursors declared in procedures and those declared in package
specifications?

The main difference between cursors declared in procedures and those declared in package specifications is that
packaged cursors are global cursors that remain open until closed or the session is disconnected.

38. Explain actual and formal parameters.

The Actual parameters are the variables that are transferred to the function when it is requested. The Formal
Parameters are the values determined by the function that accepts values when the function is declared.

39. What is an index? Explain the types of indices.


A database index is a data structure that helps access data faster and create high-performing applications. Indexes
usually have two columns: a search key and a data pointer. The search key stores the value to search for, and the data
pointer points to the block where the data is located

40. Describe Flashback Query.

A Flashback Query is a query that retrieves data from a database as it was at a specific point in time. The query uses a
timestamp or SCN to reference the past time. The results returned are the committed data that was current at that time.

41. What is polymorphism in PL/SQL?

In the context of PL/SQL, polymorphism refers to the ability of a program to treat different data types in a unified
manner. Polymorphism allows developers to create generic code that can operate on various data types, providing
flexibility and reusability in their applications.

You might also like