0% found this document useful (0 votes)
15 views39 pages

DBMS Interview Questions

Uploaded by

Johan Araya
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)
15 views39 pages

DBMS Interview Questions

Uploaded by

Johan Araya
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/ 39

Commonly asked DBMS interview questions

What are advantages of DBMS over traditional file based systems?

Ans: Database management systems were developed to handle the following difficulties of typical file-
processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems

What are super, primary, candidate and foreign keys?

Ans: A super key is a set of attributes of a relation schema upon which all attributes of the schema are
functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal super key, i.e., no proper subset of Candidate key attributes can be a super
key.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important
and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table.

What is the difference between primary key and unique constraints?

Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only
one primary key in a table, but there can be multiple unique constrains.

What is database normalization?


Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and
primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that
could meet desirable properties.

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database
system.

What are the differences between DDL, DML and DCL in SQL?

Ans: Following are some details of three.


DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME
come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come
under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?

Ans: HAVING is used to specify a condition for a group or an aggregate function used in select
statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping.
Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?

Ans:
NAME SECTION

abc CS1

bcd CS2

abc CS1

In the above table, we can find duplicate row using below query.

SELECT name, section FROM tbl

GROUP BY name, section


HAVING COUNT(*) > 1

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between
them. For example, consider the following two tables.
Student Table

ENROLLNO STUDENTNAME ADDRESS

1000 geek1 geeksquiz1


1001 geek2 geeksquiz2

1002 geek3 geeksquiz3

StudentCourse Table

COURSEID ENROLLNO

1 1000

2 1000

3 1000

1 1002

2 1003

Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName

FROM StudentCourse

INNER JOIN Customers

ON StudentCourse.EnrollNo = Student.EnrollNo

ORDER BY StudentCourse.CourseID;

The above query would produce following result.

COURSEID STUDENTNAME

1 geek1

1 geek2

2 geek1

2 geek3

3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and
increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the
value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one


Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create
view syntax.
CREATE VIEW view_name AS

SELECT column_name(s)

FROM table_name

WHERE condition

What are the uses of view?


1. Views can represent a subset of the data contained in a table; consequently, a view can limit the
degree of exposure of the underlying tables to the outer world: a given user may have permission to
query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.)
and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001,
transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of
all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed
automatically whenever the associated query is executed on a table. Triggers can be useful to maintain
integrity in database.

What is a stored procedure?


Ans: A stored procedure is like a function that contains a set of operations compiled together. It
contains a set of operations that are commonly used in an application to do some common database
tasks.

What is the difference between Trigger and Stored Procedure?


Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with
queries.

What is a transaction? What are ACID properties?


Ans: A Database Transaction is a set of database operations that must be treated as whole, means
either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit
operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database
transactions are processed reliably.

What are indexes?


Ans: A database index is a data structure that improves the speed of data retrieval operations on a
database table at the cost of additional writes and the use of more storage space to maintain the extra
copy of data.
Data can be stored only in one order on disk. To support faster access according to different values,
faster search like binary search for different values is desired, For this purpose, indexes are created on
tables. These indexes need extra space on disk, but they allow faster search according to different
frequently searched values.

What are clustered and non-clustered Indexes?


Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only
one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is
created whose leaf point to disk records. B-Tree or B+ tree are used for this purpose.

Q. There is a table where only one row is fully repeated. Write a Query to find the
Repeated row
Name Section

abc CS1

bcd CS2

abc CS1

In the above table, we can find duplicate row using below query.

SELECT name, section FROM tbl


GROUP BY name, section

HAVING COUNT(*) > 1

Q. Query to find 2nd highest salary of an employee?


SELECT max(salary) FROM EMPLOYEES WHERE salary IN

(SELECT salary FROM EMPLOYEEs MINUS SELECT max(salary)

FROM EMPLOYEES);

OR

SELECT max(salary) FROM EMPLOYEES WHERE


salary <> (SELECT max(salary) FROM EMPLOYEES);

Consider the following Employee table. How many rows are there in the result of
following query?

ID salary DeptName
1 10000 EC
2 40000 EC
3 30000 CS
4 40000 ME
5 50000 ME
6 60000 ME
7 70000 CS
;
SELECT E.ID

FROM Employee E

WHERE EXISTS (SELECT E2.salary

FROM Employee E2

WHERE E2.DeptName = 'CS'

AND E.salary > E2.salary)

Following 5 rows will be result of query as 3000 is the minimum salary of CS Employees
and all these rows are greater than 30000.
2
4
5
6
7
Q. Write a trigger to update Emp table such that, If an updation is done in Dep table
then salary of all employees of that department should be incremented by some
amount (updation)

Assuming Table name are Dept and Emp, trigger can be written as –

CREATE OR REPLACE TRIGGER update_trig

AFTER UPDATE ON Dept

FOR EACH ROW

DECLARE

CURSOR emp_cur IS SELECT * FROM Emp;

BEGIN

FOR i IN emp_cur LOOP

IF i.dept_no = :NEW.dept_no THEN


DBMS_OUTPUT.PUT_LINE(i.emp_no); -- for printing those

UPDATE Emp -- emp number which are

SET sal = i.sal + 100 -- updated

WHERE emp_no = i.emp_no;

END IF;

END LOOP;

END;

Q. There is a table which contains two column Student and Marks, you need to find
all the students, whose marks are greater than average marks i.e. list of above
average students.
SELECT student, marks

FROM table

WHERE marks > SELECT AVG(marks) from table;

Q.Name the student who has secured third highest marks using sub queries.
SELECT Emp1.Name

FROM Employee Emp1

WHERE 2 = (SELECT COUNT(DISTINCT(Emp2.Salary))

FROM Employee Emp2

WHERE Emp2.Salary > Emp1.Salary

*LOGIC- Number of people with salary higher than this person will be 2.
Q. Why we cannot use WHERE clause with aggregate functions like HAVING?

The difference between the having and where clause in SQL is that the where clause can NOT be used
with aggregates, but the having clause can. Please note: It is not a predefined rule but by and large you’ll
see that in a good number of the SQL queries, we use WHERE prior to GROUP
BY and HAVING after GROUP BY.
The Where clause acts as a pre filter where as Having as a post filter.
The where clause works on row’s data, not on aggregated data.
Let us consider below table ‘Marks’.

Student Course Score


a c1 40
a c2 50
b c3 60
d c1 70
e c2 80
Consider the query

SELECT Student, sum(Score) AS total

FROM Marks

This would select data row by row basis. The having clause works on aggregated data.
For example, output of below query

SELECT Student, sum(score) AS total FROM Marks

Student Total
a 90
b 60
d 70
e 80
When we apply having in above query, we get

SELECT Student, sum(score) AS total

FROM Marks having total > 70

Student Total
a 90
e 80
Q. Difference between primary key and unique key and why one should use unique
key if it allows only one null?
Primary key:
▪ Only one in a row(tuple).
▪ Never allows null value (only key field).
▪ Unique key identifier and cannot be null and must be unique.
Unique Key:
▪ Can be more than one unique key in one row.
▪ Unique key can have null values (only single null is allowed).
▪ It can be a candidate key.
▪ Unique key can be null and may not be unique.

Q. What’s the difference between materialized and dynamic view?

Materialized views
▪ Disk based and are updated periodically based upon the query definition.
▪ A materialized table is created or updated infrequently and it must be synchronized with its
associated base tables.
Dynamic views
▪ Virtual only and run the query definition each time they are accessed.
▪ A dynamic view may be created every time that a specific view is requested by the user.
Q. What is embedded and dynamic SQL?

Static or Embedded SQL


▪ SQL statements in an application that do not change at runtime and, therefore, can be hard-coded
into the application.
Dynamic SQL
▪ SQL statements that are constructed at runtime; for example, the application may allow users to
enter their own queries.
▪ Dynamic SQL is a programming technique that enables you to buildSQL statements dynamically at
runtime. You can create more general purpose, flexible applications by using dynamic SQL
because the full text of a SQL statement may be unknown at compilation.
S.No. Static (embedded) SQL Dynamic (interactive) SQL

In static SQL how database will be accessed is In dynamic SQL, how database will be accessed

1. predetermined in the embedded SQL statement. is determined at run time.

2. It is more swift and efficient. It is less swift and efficient.

3. SQL statements are compiled at compile time. SQL statements are compiled at run time.

Parsing, validation, optimization, and generation of Parsing, validation, optimization, and generation

4. application plan are done at compile time. of application plan are done at run time.

It is generally used for situations where data is It is generally used for situations where data is

5. distributed uniformly. distributed non-uniformly.

EXECUTE IMMEDIATE, EXECUTE and PREPARE EXECUTE IMMEDIATE, EXECUTE and

6. statements are not used. PREPARE statements are used.

7. It is less flexible. It is more flexible.

Q. What is the difference between CHAR and VARCHAR?

▪ CHAR and VARCHAR are differing in storage and retrieval.


▪ CHAR column length is fixed while VARCHAR length is variable.
▪ The maximum no. of character CHAR data type can hold is 255 character while VARCHAR can
hold up to 4000 character.
▪ CHAR is 50% faster than VARCHAR.
▪ CHAR uses static memory allocation while VARCHAR uses dynamic memory allocation.

ACID properties of Database.


A transaction is a very small unit of a program and it may contain several lowlevel tasks. A transaction
in a database system must maintain Atomicity, Consistency, Isolation, and Durability − commonly
known as ACID properties − in order to ensure accuracy, completeness, and data integrity.

• Atomicity − This property states that a transaction must be treated as an atomic unit, that is,
either all of its operations are executed or none. There must be no state in a database where a
transaction is left partially completed. States should be defined either before the execution of
the transaction or after the execution/abortion/failure of the transaction.

• Consistency − The database must remain in a consistent state after any transaction. No
transaction should have any adverse effect on the data residing in the database. If the database
was in a consistent state before the execution of a transaction, it must remain consistent after
the execution of the transaction as well.

• Durability − The database should be durable enough to hold all its latest updates even if the
system fails or restarts. If a transaction updates a chunk of data in a database and commits,
then the database will hold the modified data. If a transaction commits but the system fails
before the data could be written on to the disk, then that data will be updated once the system
springs back into action.

• Isolation − In a database system where more than one transaction are being executed
simultaneously and in parallel, the property of isolation states that all the transactions will be
carried out and executed as if it is the only transaction in the system. No transaction will affect
the existence of any other transaction.

How many Unique keys in one table?

The UNIQUE constraint ensures that all values in a column are different.

Both the UNIQUE and PRIMARY KEY constraints provide a guarantee for uniqueness for a column or set
of columns.

A PRIMARY KEY constraint automatically has a UNIQUE constraint.

However, you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per
table.

How many null values can have in primary key and unique key?
Difference between Primary and Unique is key that Primary key does not allow for null value whereas
Unique key allows null only once. Entering extra null value for unique key throws violation exception.

Difference between Order BY and Group By?

• ORDER BY is used to sort a result by a list of columns or expressions.

• GROUP BY is used to create unique combinations of a list of columns that can be used to form

summaries. A byproduct of this operation is that the grouping tends to be sorted; however, this isn’t a

guarantee.

Diff between Primary and Unique Key.


What is foreign Key?
What is normalization?
Difference between Delete and Truncat and drop statement?
What are joins in SQL? And how many types of joins?
What is an index?
Assume that we have a lot of records in the table and we want to find 2nd highest
salary. What would be the query?
We have a table with the single column with values 0,1,2,3 Now I want to add 2 to all
those values where we have 1 and I want to add 0 to all those values where we have
3.
Assume we have 2 tables A & B with 8 and 5 records and total 3 matching in between
If you perform inner join how many records will be there?
What about Left outer join in same table?
What about Right Outer Join in Same table?
Write down Syntax to perform left outer join?

Why a database is called as relational database model?


A database model represents the relationship between one or more databases. The relationship is
known as the relational database model. It is an extension of the normal databases without relations. It
provides flexibility and allows one database to be in relation with another database. It can access the
data from many databases at one time over the network.
What are entities and attributes referring to?
- Table consists of some properties that are known as attributes.

- These consist of the representation of entity in the table.

- They are represented by columns in the table.

- Entity is referred to the store data about any particular thing.

- It is the smallest unit inside the table.

What do you understand by relation in relational database model?


Relation in the relational database model is defined as the set of tuples that have the same attributes.
Tuple represents an object and also the information that the object contains. Objects are basically
instances of classes and used to hold the larger picture. Relation is described as a table and is organized
in rows and columns. The data referenced by the relation come in the same domain and have the same
constraints as well. Relations in the relational database model can be modified using the commands like
insert, delete etc.

Why domain is of high importance?


- Domain describes possible values grouped together that can be given for an attribute. It is considered
the same way as a constraint on the value of attribute.

- A domain can be attached to an attribute but only if the attribute is an element of specified set.

For example: XYZ doesn’t fulfill the domain constraint but the integer value as 899 fulfills the criteria of
domain constraint. Hence, domain is of high importance.

What is the difference between base and derived relation?

- Relational database means the relationship between different databases. In relational database user
can store and access all the data through the tables which are related to each other.

- Relationship between the store data is called base relations and implementation of it is called as
tables. Whereas, relations which don’t store the data, but can be found out by applying relational
operations on other relations are called as derived relations. When these are implemented they are
termed as views or queries.

- Derived relations are more useful then base relation, as they can have more information from many
relations, but they act as a single relation.

What are constraints in database?


Constraints are kind of restrictions that are applied to the database or on the domain of an attribute. For
example an integer attribute is restricted from 1-10 and not more than that. They provide the way to
implement the business logic and the rules in database. In database it can be implemented in the form
of check constraints that checks for the rules that haven’t been followed by the programmer. Constraint
also used to restrict the data that can be stored in the relations. Domain constraint can be applied to
check the domain functionality and keep it safe..

8. What are the two principles of relational database model? What is the difference between them?

The two principal rules for the relational model are as follows:

- Entity integrity: this is used to maintain the integrity at entity level

- Referential integrity: it is used to maintain integrity on all the values which have been referenced.

The differences between them are as follows:

- Entity integrity tells that in a database every entity should have a unique key; on the other hand
referential integrity tells that in the database every table values for all foreign keys will remain valid.

- Referential integrity is based on entity integrity but it is not the other way around.

- For example: if a table is present and there is a set of column out of which one column has parent key
set then to ensure that the table doesn’t contain any duplicate values, a unique index is defined on the
column that contains the parent key.

What is the difference between primary and foreign key?

- Primary key uniquely identify a relationship in a database, whereas foreign key is the key that is in
other relation and it has been referenced from the primary key from other table.

- Primary key remains one only for the table, whereas there can be more than one foreign key.

- Primary key is unique and won’t be shared between many tables, but foreign key will be shared
between more than one table and will be used to tell the relationship between them.

Why stored procedures are called as executable code?

Stored procedure stored inside the database. This also includes the executable code that usually collects
and customizes the operations like insert, encapsulation, etc. These stored procedures are used as APIs
for simplicity and security purposes. The implementation of it allows the developers to have procedural
extensions to the standard SQL syntax. Stored procedure doesn’t come as a part of relational database
model, but can be included in many implementations commercially.

What is an index representing in relational database model?

- Index is a way to provide quick access to the data and structure. It has indexes maintain and can be
created to combine attributes on a relation. Index allows the queries to filter out the searches faster and
matching data can be found earlier with simplicity.
- For example: It is same as the book where by using the index you can directly jump to a defined
section. In relational database there is a provision to give multiple indexing techniques to optimize the
data distribution.

What are the relational operations that can be performed on the database?

There are many relational operators that are used to perform actions on relational database. These
operators are as follows:

1. Union operator that combines the rows of two relations and doesn’t include any duplicate. It also
removes the duplicates from the result.

2. Intersection operator provides a set of rows that two relations have in common.

3. Difference operator provide the output by taking two relations and producing the difference of rows
from first that don’t exist in second.

4. Cartesian product is done on two relations. It acts as a cross join operator.

What do you understand by database Normalization?

- Normalization is very essential part of relational model.

- Normal forms are the common form of normalization.

- It helps in reducing redundancy to increase the information overall.

- It has some disadvantages as it increases complexity and have some overhead of processing.

- It consists of set of procedures that eliminates the domains that are non-atomic and redundancy of
data that prevents data manipulation and loss of data integrity.

What are the different types of normalization that exists in the database?

There are 9 normalizations that are used inside the database. These are as follows:

1. First normal form: in this table represents a relation that has no repeating groups.

2. Second normal form: non- prime attributes are not functional dependent on subset of any candidate
key.

3. Third normal form: in a table every non- prime attribute is non-transitively dependent on every
candidate key

4. Elementary key normal form: superkey dependency or elementary key dependency effects the
functional dependency in a table.

5. Boyce codd normal form: “every non-trivial functional dependency in the table is dependent on
superkey”.

6. Fourth normal form: “Every non-trivial multivalued dependency in the table is a dependent on a
superkey”.
7. Fifth normal form (5NF): “Every non-trivial join dependency in the table is implied by the superkeys of
the table”.

8. Domain/key normal form (DKNF): “Every constraint on the table is a logical consequence of the table's
domain constraints and key constraints”.

9. Sixth normal form (6NF): “Table features no non-trivial join dependencies at all”.

How de-normalization is different from normalization?

- Analytical processing databases are not very normalized. The operations which are used are read most
databases.

- It is used to extract the data that are ancient and accumulated over long period of time. For this
purpose de-normalization occurs that provide smart business applications.

- Dimensional tables in star schema are good example of de-normalized data.

- The de-normalized form must be controlled while extracting, transforming, loading and processing.

- There should be constraint that user should not be allowed to view the state till it is consistent.

- It is used to increase the performance on many systems without RDBMS platform.

What is the type of de-normalization?

Non-first normal form (NFA)

– It describes the definition of the database design which is different from the first normal form.

- It keeps the values in structured and specialized types with their own domain specific languages.

- The query language used in this is extended to incorporate more support for relational domain values
by adding more operators.

How many levels of data abstraction are available?

There are three levels of data abstraction available in database model and these are as follows:

1. Physical level: It is the lowest level that describes how data is stored inside the database.

2. Logical level: It is the next higher level in the hierarchy that provides the abstraction. It describes what
data are stored and the relationship between them.

3. View level: It is the highest level in hierarchy that describes part of the entire database. It allows user
to view the database and do the query.

What is the difference between extension and intension?

The major difference between extension and intension is that:

- Extension is time dependent, whereas intension includes a constant value.

- Extension tells about the number of tuples presented in a table at any instance, whereas intension
gives the name, structure and constraint of the table.
What are its two major subsystems of System R?

System R is being developed by IBM. Its purpose is to demonstrate the possible solution to build a
relational database system. The relational database system has to be such that which can interact with
the real life environment to sole real life scenarios.

The two subsystems that are included in it are:

1. Research storage: This includes the research information of the database.

2. System relational system: This includes the relational data that a system has to produce and keep
everything in relation.

What do you understand by Data Independence?

Data independence tells about the independence of the data inside the application. It usually deals with
the storage structure and represents the ability to modify the schema definition. It doesn’t affect the
schema definition which is being written on the higher level.

There are two types of data independence:

1. Physical data independence: It allows the modification to be done in physical level and doesn’t affect
the logical level.

2. Logical data independence: It allow the modification to be done at logical level and affects the view
level.

NOTE: Logical Data Independence is more difficult to achieve.

How view is related to data independence?

- View is a virtual table that doesn’t really exist, but it remains present so that user can view their data.

- It is derived from the base table. The view is stored in the data dictionary and represents the file
directly.

- The base table updation or reconstruction is not being reflected in views.

- It is related to the logical data independence as it is at the logical level and not at the physical level.

Why E-R models are used?

E-R model stands for entity-relationship model and it is used to represent a model with their
relationships. This is an object oriented approach and it is based on real world that consists of objects
which are called entities and relationship between them. Entities are further used inside the database in
the form of attributes.

What is the purpose of acid properties?

- ACID stands for Atomicity, Consistency, Isolation and durability and it plays an important role in the
database.
- These properties allow the database to be more convenient to access and use. This allows data to be
shared more safely in between the tables.

- If these properties are not being implemented then the data will become inconsistent and inaccurate.

- It helps in maintaining the accuracy of the data in the database.

What do you understand by cardinality and why it is used?

- Cardinality is important and used to arrange the data inside the database.

- It is related to the design part and need to be properly used in database.

- It is used in E-R diagrams and used to show the relationship between entities/tables.

- It has many forms like the basic is one to one, which associate one entity with another.

- Second is one to many: which relates one entity with many entities in a table.

- Third is many to many M: N that allows many entities to be related to many more.

- Last is many to one that allows the many entities to be associated with one entity.

What is the difference between DBMS and RDBMS?

- DBMS is persistent and accessible when the data is created or exists, but RDBMS tells about the
relation between the table and other tables.

- RDBS supports a tabular structure for data and relationship between them in the system whereas
DBMS supports only the tabular structure.

- DBMS provide uniform methods for application that has to be independently accessed, but RDBMS
doesn’t provide methods like DBMS but provide relationship which link one entity with another

SQL stands for

ANSWER: a) Structured Query Language

SQL was initially developed by

ANSWER: c) Donald D. Chamberlin and Raymond F. Boyce

SQL was designed with the purpose of managing data held in__

ANSWER: a) Relational Database Management System

Which is the correct syntax to retrieve all rows from the table?

ANSWER: a) select * from table_name;

What is the difference between delete and truncate command of SQL?

a) DROP command removes a table from the database & TRUNCATE removes all rows from a table
b) TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row
deletions.& Delete activates a trigger because the operation are logged individually

c) TRUNCATE TABLE always locks the table and page but not each row & DELETE statement is executed
using a row lock, each row in the table is locked for deletion

Restrictions on Dropping Tablespace

a) You cannot drop the SYSTEM tablespace.

b) You cannot drop a tablespace that contains a domain index or any objects created by a domain index.

c) You cannot drop an undo tablespace if it is being used by any instance or if it contains any undo data
needed to roll back uncommitted transactions.

If you want to add new data in a database which command will you use

ANSWER: a) Insert

Suppose your assistant, named Jene has not been previously authorized to add data about new
customers into the database, which of the following statement can be used to give her that
permission

ANSWER: a) Grant Insert

SQL select statement is used to

ANSWER: a) Retrieve data from database

To control access to the database which SQL statement/s used

a) Grant

b) Revoke

ANSWER: c) Both a & b

Select the non-aggregate function from the following

ANSWER: d) Round( )

Select the non-scalar function from the following

ANSWER: d) FIRST()

If the primary key is not included in the query result , duplicate rows can occur in result set then how
you can eliminate the duplicate rows of query result.

ANSWER: a) By using Distinct statement

What is true about FLOOR(n) function?

A) Returns smallest integer greater than or equal to n


B) Returns largest integer less than or equal to n

C) It is used with numeric data

D) It operates on character data

ANSWER: All of the above

Pseudo-column ________ returns a level of row in a tree-structured query.

ANSWER: b) LEVEL

Pseudo-column LEVEL can be used in ____statement where ______ is used.

ANSWER: b) Select , connect by

____ column displays the location of row in a database.

ANSWER: a) ROWID

To use the result of certain query repeatedly which clause will you use?

ANSWER: b) With

Which command will you use to delete entire table from database?

ANSWER: b) Drop

SQL ______performs a JOIN against equality or matching column(s) values of the associated tables.

ANSWER: a) Equi join

Exists clause is used for

ANSWER: a) Testing whether a given set is empty or not.

Which of the following queries will correctly show the tables owned by the user?

ANSWER: d) SELECT table_name from user_tables;

Data files are logically grouped together into an oracle logical structure called a

ANSWER: a) Tablespace

To create a table name Customer having fields Cust-name, Cust_address from the table Employee and
Customer table should not be populated with any record from Employee table which of the following
query will be correct?

ANSWER: c) Create table Customer (Cust-name, Cust_address) As Select emp_name, emp_address from
Employee where 1=2;

Which of the following tasks cannot be performed when using Alter Table clause?

A) Change the name of the table


B) Change the name of the column

C) Decrease the size of a column if table data exists

a) A & B

b) A,B, & C

c) Only C

d) B & C

ANSWER: b) A,B, & C

The _______ command is used to change or modify data values in a table

a) Update

b) Modify

c) Rename

d) Describe

ANSWER: a) Update

Up to how many columns can be combined to form a composite primary key for a table?

a) 16

b) 8

c) 18

d) 14

ANSWER: a) 16

Select from the following option which not true about primary key

a) Primary key can be Long & long Raw data type

b) Unique index is created automatically if there is a Primary Key

c) Primary key will not allow Null values

d) Primary key will not allow duplicate values

ANSWER: a) Primary key can be Long & long Raw data type

To compare one value with more than one or list of values then which of the following operator will
fulfil the need?

a) Like

b) IN
c) AND

d) Between

ANSWER: b) IN

Which of the following query is correctly give the user name of the currently logged in user?

a) SELECT USERENV FROM DUAL;

b) SELECT COALESCE FROM DUAL;

c) SELECT USER FROM DUAL;

d) SELECT USERENV FROM TABLE_NAME;

ANSWER: c) SELECT USER FROM DUAL;

The ___ operator is used to calculate aggregates and super aggregates for expressions within a
________.

a) ROLLUP, GROUP BY

b) ROLLUP, ORDER BY

c) CUBE , GROUP BY

d) ROLLUP,CUBE

ANSWER: a) ROLLUP, GROUP BY

________ allows grantee to in turn grant object privileges to other users.

a) With grant option

b) Grant

c) Revoke

d) Grant All

ANSWER: a) With grant option

Grant all on Customer to Reeta with grant option, what is the significance of ‘with grant option’ in this
query?

a) Give the user “Reeta” privileges to view only data on table Customer along with an option to further
grant permissions on the Customer table to other users.

b) Give the user “Reeta” all data manipulation privileges on table Customer.

c) Give the user “Reeta” all data manipulation privileges on table Customer along with an option to
further grant permissions on the Customer table to other users.
d) Give the user “Reeta” all data manipulation privileges on table Customer along with an option to not
further grant permissions on the Customer table to other users.

ANSWER: c) Give the user “Reeta” all data manipulation privileges on table Customer along with an
option to further grant permissions on the Customer table to other users.

A View is mapped to __________ statement.

a) Update

b) Alter

c) Create

d) Select

ANSWER: d) Select

What are the prerequisite for a View to be updateable?

a) Views defined from a single table. If user wants to Insert records with the help of a view, then the
primary key column and all the Not Null columns must be included in the view

b) The user can Update, Delete records with the help of a view even if the primary key column and Not
Null column(s) are executed from the view definition

c) Both a & b

d) None of the above

ANSWER: c) Both a & b

Which of the following query will correctly create the view of Employee table having fields
fname,lname,dept?

a) Create View emp_v In select fname,lname,dept from Employee;

b) Create View emp_v As select fname,lname,dept from Employee;

c) Create View emp_v like select fname,lname,dept from Employee;

d) Create View emp_v As select , , fname,lname,dept , ,from Employee;

ANSWER: b) Create View emp_v As select fname,lname,dept from Employee;

Which of the following column is not a part of USER_CONSTRAINTS?

a) OWNER

b) TABLE_NAME

c) SEARCH_CONDITION\

d) DB_DOMAIN
ANSWER: d) DB_DOMAIN

_______ used to sort the data in the table

a) Order by clause

b) Group by clause

c) Aggregate functions

d) Sequence

ANSWER: a) Order by clause

______ clause can be used to find unique values in situations to which ____ apply.

a) HAVING, DISTINCT does not

b) HAVING, DISTINCT

c) GROUP BY, DISTINCT

d) HAVING, GROUP BY

ANSWER: a) HAVING, DISTINCT does not.

Which of the following is not a valid SQL data type?

a) NUMBER

b) DATE

c) LONG

d) FRACTION

ANSWER: d) FRACTION

______ condition can’t contain sub queries or sequence.

a) Check

b) Unique

c) References

d) Index

ANSWER: a) Check

What is true about join?

a) You can join a maximum of two tables

b) You can join a maximum of two columns through

C) You can join two or more tables


d) None of the above

ANSWER: You can join two or more tables.

Joining a table to itself is referred to as __________.

a) Self-join

b) Cross-join

c) Outer Join

d) Full Outer Join

ANSWER: a) Self-join

A sub query is a form of an SQL statement that appears ______ another SQL statement.

a) At the start of

b) Inside

c) Outside

d) After

ANSWER: b) Inside

The____ data types are used to store binary data.

a) Raw

b) LONG

c) bfile

d) rowid

ANSWER: a) Raw

A____ level constraint must be applied if data constraint spans across multiple columns in a table.

a) Table

b) Row

c) Column

d) Database

ANSWER: a) Table

______ constraint can only applied at column level.

a) NOT NULL

b) CHECK
c) UNIQUE

d) PRIAMRY KEY

ANSWER: a) NOT NULL

EXTRACT() function returns ___________.

a) a value extracted from a date or an interval value

b) number of columns in a table

c) number of tables in a database

d) number of rows in a table

ANSWER: a) a value extracted from a date or an interval value

Which of the following is a string function?

a) UPPER( )

b) FLOOR( )

c) LEAST( )

d) ABS( )

ANSWER: a) UPPER( )

VSIZE( ) function returns ___________.

a) number of bytes in the internal representation of an expression

b) number of rows where expr is not null

c) largest integer value

d) returns a Unicode string

ANSWER: a) number of bytes in the internal representation of an expression.

What is Index?

- A pointer to data having physical representation is called as Index.


- Record can be located quickly and efficiently by creating Indices on existing tables.
- Each index in a table has some valid name and we can have more than one index in different columns of a table.
- We can speed up queries by setting up index in a column of a table.
- In a table , each row is examined by sql server to fulfil our query is known as table scan and it only happen when there is
index available to help the query.
- On large tables, the table scan has huge impact on performance.
- Clustered and Non clustered indexes are the most widely used indexes in a database.

What is Trigger?

- A Trigger is a process of firing an action when some event like Insert, Update or Delete occurs.
- A trigger can’t be called or even executed rather they are automatically become active by the DBMS whenever some
modification in associated table occur.
- Triggers are event driven and can attached to particular table in a database.
- Triggers are implicitly executed and stored procedures are also executed by triggers.
- Referential integrity is maintained by the trigger and they are managed and stored by DBMS.
- Triggers can be nested also, in which Insert, Update or Delete logic can be fired from the trigger itself.

What is a NOLOCK?

- NOLOCK is used to improve concurrency on a busy system.


- On data read, no lock can be taken on SELECT statement.
- When some other process is updating the data on the same time you are reading it is known as dirty read.
- Read (Shared) locks are taken by SELECT Statements.
- Simultaneous access of multiple SELECT statements is allowed in Shared lock but modification process is not allowed.
- The result to your system is blocking.
- Update will start on completion of all the reads.

What is the STUFF function and how does it differ from the REPLACE function?

- Using STUFF function we can overwrite the specified characters of a string.


The syntax of STUFF function is:
STUFF (stringToChange, startIndex, length, new_characters )

where stringToChange is the string which will have the characters those we want to overwrite, startIndex is the starting
position, length is the number of characters in the string that are to be overwrited, and new_characters are the new
characters to write into the string.

- While REPLACE function is used to replace specified character at all its existing occurrences.
- The syntax of REPLACE function is REPLACE (string_to_change, string_to_Replace, new_tring).
- Every occurrence of string_to_change will be replaced by new_string.

What are Self Join and Cross Join?

- When we want to join a table to itself then SELF JOIN is used.


- We can give one or more aliases to eliminate the confusion.
- A self join can be used as any type, if both the tables are same.
- The simple example where we can use SELF JOIN is if in a company have a hierarchal reporting structure and an employ
reports to another.
- A cross join give the number of rows in the first table multiplied by the number of rows in second table.
- The simple example where we can use CROSS JOIJ is if in an organization wants to combine every Employee with family
to see each Employee with each family member.

What are the advantages of using Stored Procedures?

- Procedure can reduce network traffic and latency, and can enhance application performance.
- Procedure execution plans can be reused, staying cached in the management tool's memory, reducing its overhead.
- Procedures provide the benefit of code reuse.
- The logic can be encapsulated using procedures and can help to change procedure's code without interacting to applica
- Procedures give more security to our data.

What is RANK function?

- RANK function can be used to give a rank to each row returned from a SELECT statment.
- For using this function first specify the function name, followed by the empty parentheses.
- Then mention the OVER function. For this function, you have to pass an ORDER BY clause as an argument. The clause
identifies the column on which you are going to apply the RANK function.

For Example:
SELECT RANK() OVER(ORDER BY BirthDate DESC) AS [RowNumber], FirstName, BirthDate FROM EmpDetails
- In the result you will see that the eldest employee got the first rank and the youngest employee got the last rank. Here t
rows with equal age will get same ranks.
- The rank depends on the row's position in the result set, but not on the sequential number of the row.
What are cursors and when they are useful?

- When we execute any SQL operations, SQL Server opens a work area in memory which is called Cursor.
- When it is required to perform the row by row operations which are not possible with the set-based operations then cu
used.

There are two of cursors:

1. Implicate Cursor
- SQL Server automatically manages cursors for all data manipulation statements. These cursors are called implicit cursors

2. Explicit Cursor
- When the programmer wants to perform the row by row operations for the result set containing more than one row, th
explicitly declare a cursor with a name.
- They are managed by OPEN, FETCH and CLOSE.
-%FOUND, %NOFOUND, %ROWCOUNT and %ISOPEN attributes are used in both types of cursors.

What is Similarity and Difference between Truncate and Delete in SQL?

- Similarity

- Both Truncate and Delete command will delete data from given table and they will not delete the table structure from t
database.

- Difference

1. TRUNCATE is a DDL (data definition language) command whereas DELETE is a DML (data manipulation language) comm

2. We can’t execute a trigger with TRUNCATE whereas with DELETE command, a trigger can be executed.

3. We can use any condition in WHERE clause using DELETE but it is not possible with TRUNCATE.

4. If table is referenced by any foreign key constraints then TRUNCATE cannot work.
5. TRUNCATE is faster than DELETE, because when you use DELETE to delete the data, at that time it store the whole data
rollback space from where you can get the data back after deletion, whereas TRUNCATE will not store data in rollback spa
and will directly delete it. You can’t get the deleted data back when you use TRUNCATE.

What are COMMIT and ROLLBACK in SQL?

- COMMIT statement is used to end the current transaction and once the COMMIT statement is exceucted the transaction
be permanent and undone.
- Syntax: COMMIT;
- Example:
BEGIN
UPDATE EmpDetails SET EmpName = ‘Arpit’ where Dept = ‘Developer’
COMMIT;
END;
-ROLLBACK statement is used to end the current transaction and undone the changes which was made by that transaction
- Syntax: ROLLBACK [TO] Savepoint_name;
- Example:
BEGIN
Statement1;
SAVEPOINT mysavepoint;
BEGIN
Statement2;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK TO mysavepoint;
Statement5;
END;
END;

What is a WITH(NOLOCK)?

- WITH(NOLOCK) is used to unlock the data which is locked by the transaction that is not yet committed. This command is
before SELECT statement.
- When the transaction is committed or rolled back then there is no need to use NOLOCK function because the data is alre
released by the committed transaction.
- Syntax: WITH(NOLOCK)
- Example:
SELECT * FROM EmpDetails WITH(NOLOCK)
WITH(NOLCOK) is similar as READ UNCOMMITTED.

What is difference between Co-related sub query and nested sub query?

- Correlated subquery executes single time for every row which is selected by the outer query.
- It has a reference to a value from the row selected by the outer query.
- Nested subquery executes only once for the entire nesting (outer) query. It does not contain any reference to the outer
query row.

- For example,
- Correlated Subquery:
select e.EmpFirstName, e.Salary, e.DeptId from Employee e where e.Salary = (select max(Salary) from Employee ee where
ee.DeptId = e.DeptId)

- Nested Subquery:
select EmpFirstName, Salary, DeptId from Employee where (DeptId, Salary) in (select DeptId, max(Salary) from Employee
group by DeptId)

Differentiate UNION, MINUS, UNION ALL and INTERSECT?

- INTERSECT - It will give all the distinct rows from both select queries.
- MINUS - It will give distinct rows returned by the first query but not by the second query.
- UNION - It will give all distinct rows selected by either first query or second query.
- UNION ALL - It will give all rows returned by either query with all duplicate records.

What is a join? Explain the different types of joins?

Using Join in a query, we can retrieve referenced columns or rows from multiple tables.

Following are different types of Joins:

1. JOIN: Return details from tables if there is at least one matching row in both tables.
2. LEFT JOIN: It will return all rows from the left table, even if there are no matching row in the right table.
3. RIGHT JOIN: It will return all rows from the right table, even if there is no matching row in the left table.
4. FULL JOIN: It will return rows when there is a match in either of tables.

What is DDL, DML and DCL?

SQL commands can be divided in three large subgroups.

1) DDL: The SQL commands which deals with database schemas and information of how the data will be generated in
database are classified as Data Definition Language.
-For example: CREATE TABLE or ALTER TABLE belongs to DDL.

2) DML: The SQL commands which deals with data manipulation are classified as Data Manipulation Language.
For example: SELECT, INSERT, etc.

3) DCL: The SQL commands which deal with rights and permission over the database are classified as DCL.
For example: GRANT, REVOKE

What is Index tuning?

- Query performance as well as speed improvement of a database can be done using Indexes.
- The process of enhancing the selection of indexes is called Index Tuning.

What is Index tuning?

Index tuning is part of database tuning for selecting and creating indexes. The index tuning goal is to
reduce the query processing time. Potential use of indexes in dynamic environments with several ad-hoc
queries in advance is a difficult task. Index tuning involves the queries based on indexes and the indexes
are created automatically on-the-fly. No explicit actions are needed by the database users for index
tuning.

1) Define Database.

A prearranged collection of figures known as data is called database.

2) What is DBMS?
Database Management Systems (DBMS) are applications designed especially which enable user
interaction with other applications.

3) What are the various kinds of interactions catered by DBMS?

The various kind of interactions catered by DBMS are:

Data definition

Update

Retrieval

Administration

4) Segregate database technology’s development.

The development of database technology is divided into:

Structure or data model

Navigational model

SQL/ relational model

5) Who proposed the relational model?

Edgar F. Codd proposed the relational model in 1970.

6) What are the features of Database language?

A database language may also incorporate features like:

DBMS-specific Configuration and management of storage engine

Computations to modification of query results by computations, like summing, counting, averaging,


grouping, sorting and cross-referencing Constraint enforcement Application Programming Interface

7) What do database languages do?

As special-purpose languages, they have:

Data definition language

Data manipulation language

Query language

8) Define database model.

A data model determining fundamentally how data can be stored, manipulated and organised and the
structure of the database logically is called database model.

9) What is SQL?
Structured Query Language (SQL) being ANSI standard language updates database and commands for
accessing.

10) Enlist the various relationships of database.

The various relationships of database are:

One-to-one: Single table having drawn relationship with another table having similar kind of columns.

One-to-many: Two tables having primary and foreign key relation.

Many-to-many: Junction table having many tables related to many tables.

11) Define Normalization.

Organized data void of inconsistent dependency and redundancy within a database is called
normalization.

12) Enlist the advantages of normalizing database.

Advantages of normalizing database are:

No duplicate entries

Saves storage space

Boasts the query performances.

13) Define Denormalization.

Boosting up database performance, adding of redundant data which in turn helps rid of complex data is
called denormalization.

14) Define DDL and DML.

Managing properties and attributes of database is called Data Definition Language(DDL).

Manipulating data in a database such as inserting, updating, deleting is defined as Data Manipulation
Language. (DML)

15) Enlist some commands of DDL.

They are:

CREATE: Create is used in the CREATE TABLE statement. Syntax is:

CREATE TABLE [column name] ( [column definitions] ) [ table parameters]

ALTER: It helps in modification of an existing object of database. Its syntax is:

ALTER objecttype objectname parameters.

DROP: It destroys an existing database, index, table or view. Its syntax is:

DROP objecttype objectname.


16) Define Union All operator and Union.

Full recordings of two tables is Union All operator.

A distinct recording of two tables is Union.

17) Define cursor.

A database object which helps in manipulating data row by row representing a result set is called cursor.

18) Enlist the cursor types.

They are:

Dynamic: it reflects changes while scrolling.

Static: doesn’t reflect changes while scrolling and works on recording of snapshot.

Keyset: data modification without reflection of new data is seen.

19) Enlist the types of cursor.

They types of cursor are:

Implicit cursor: Declared automatically as soon as the execution of SQL takes place without the
awareness of the user.

Explicit cursor: Defined by PL/ SQL which handles query in more than one row.

20) Define sub-query.

A query contained by a query is called Sub-query.

21) Why is group-clause used?

Group-clause uses aggregate values to be derived by collecting similar data.

22) Compare Non-clustered and clustered index

Both having B-tree structure, non-clustered index has data pointers enabling one table many non-
clustered indexes while clustered index is distinct for every table.

23) Define Aggregate functions.

Functions which operate against a collection of values and returning single value is called aggregate
functions

24) Define Scalar functions.

Scalar function is depended on the argument given and returns sole value.

25) What restrictions can you apply when you are creating views?

Restrictions that are applied are:

Only the current database can have views.


You are not liable to change any computed value in any particular view.

Integrity constants decide the functionality of INSERT and DELETE.

Full-text index definitions cannot be applied.

Temporary views cannot be created.

Temporary tables cannot contain views.

No association with DEFAULT definitions.

Triggers such as INSTEAD OF is associated with views.

26) Define “correlated subqueries”.

A ‘correlated subquery’ is a sort of sub query but correlated subquery is reliant on another query for a
value that is returned. In case of execution, the sub query is executed first and then the correlated
query.

27) Define Data Warehousing.

Storage and access of data from the central location in order to take some strategic decision is called
Data Warehousing. Enterprise management is used for managing the information whose framework is
known as Data Warehousing.

28) Define Join and enlist its types.

Joins help in explaining the relation between different tables. They also enable you to select data with
relation to data in another table.

The various types are:

INNER JOINs: Blank rows are left in the middle while more than equal to two tables are joined.

OUTER JOINs: Divided into Left Outer Join and Right Outer Join. Blank rows are left at the specified side
by joining tables in other side.

Other joins are CROSS JOINs, NATURAL JOINs, EQUI JOIN and NON-EQUI JOIN.

29) What do you mean by Index hunting?

Indexes help in improving the speed as well as the query performance of database. The procedure of
boosting the collection of indexes is named as Index hunting.

30) How does Index hunting help in improving query performance?

Index hunting helps in improving the speed as well as the query performance of database. The followed
measures are achieved to do that:

The query optimizer is used to coordinate the study of queries with the workload and the best use of
queries suggested based on this.

Index, query distribution along with their performance is observed to check the effect.
Tuning databases to a small collection of problem queries is also recommended.

31) Enlist the disadvantages of query.

The disadvantages of query are:

No indexes

Stored procedures are excessively compiled.

Triggers and procedures are without SET NOCOUNT ON.

Complicated joins making up inadequately written query.

Cursors and temporary tables showcase a bad presentation.

32) Enlist ways to efficiently code transactions.

Ways to efficiently code transactions:

User input should not be allowed while transactions.

While browsing, transactions must not be opened of data.

Transactions must be kept as small as possible.

Lower transaction segregation levels.

Least information of data must be accessed while transacting.

33) What is Executive Plan?

Executive plan can be defined as:

SQL Server caches collected procedure or the plan of query execution and used thereafter by
subsequent calls.

An important feature in relation to performance enhancement.

Data execution plan can be viewed textually or graphically.

34) Define B-trees.

A data structure in the form of tree which stores sorted data and searches, insertions, sequential access
and deletions are allowed in logarithmic time.

35) Differentiate Table Scan from Index Scan.

Iterating over all the table rows is called Table Scan while iterating over all the index items is defined as
Index Scan.

36) What do you mean by Fill Factor concept with respect to indexes?

Fill Factor can be defined as being that value which defines the percentage of left space on every leaf-
level page that is to be packed with data. 100 is the default value of Fill Factor.
37) Define Fragmentation.

Fragmentation can be defined as a database feature of server that promotes control on data which is
stored at table level by the user.

38) Differentiate Nested Loop, Hash Join and Merge Join.

Nested loop (loop over loop)

An outer loop within an inner loop is formed consisting of fewer entries and then for individual entry,
inner loop is individually processed.

E.g.

Select col1.*, col2.* from coll, col2 where coll.col1=col2.col2;

It’s processing takes place in this way:

For i in (select * from col1) loop

For j in (select * from col2 where col2=i.col1) loop

Results are displayed;

End of the loop;

End of the loop;

The Steps of nested loop are:

Identify outer (driving) table

Assign inner (driven) table to outer table.

For every row of outer table, access the rows of inner table.

Nested Loops is executed from the inner to the outer as:

outer_loop

inner_loop

Hash join

While joining large tables, the use of Hash Join is preferred.

Algorithm of Hash Join is divided into:

Build: It is a hash table having in-memory which is present on the smaller table.

Probe: this hash value of the hash table is applicable for each second row element.

Sort merge join

Two independent sources of data are joined in sort merge join. They performance is better as compared
to nested loop when the data volume is big enough but it is not good as hash joins generally.
The full operation can be divided into parts of two:

Sort join operation :

Get first row R1 from input1

Get first row R2 from input2.

Merge join operation:

‘while’ is not present at either loop’s end.

if R1 joins with R2

next row is got R2 from the input 2

return (R1, R2)

else if R1 < style=””> next row is got from R1 from input 1

else

next row is got from R2 from input 2

end of the loop

39) What is Database partitioning?

Division of logical database into independent complete units for improving its management, availability
and performance is called Database partitioning.

40) Explain the importance of partitioning.

Splitting of one table which is large into smaller database entities logically is called database
partitioning. Its benefits are:

To improve query performance in situations dramatically when mostly rows which are heavily accessed
are in one partition.

Accessing large parts of a single partition

Slower and cheaper storage media can be used for data which is seldom used.

41) Define Database system.

DBMS along with database is called Database system.

42) What do you mean by Query Evaluation Engine?

Query Evaluation Engine executes the low-level instructions that are generated by the compiler.

43) Define DDL Interpreter.

DDL statements are interpreted and recorded in tables called metadata.

44) Define Atomicity and Aggregation.


Atomicity: It’s an all or none concept which enables the user to be assured of incomplete transactions to
be taken care of. The actions involving incomplete transactions are left undone in DBMS.

Aggregation: The collected entities and their relationship are aggregated in this model. It is mainly used
in expressing relationships within relationships.

45) Enlist the various transaction phases.

The various transaction phases are:

Analysis Phase.

Redo Phase

Undo Phase

46) Define Object-oriented model.

Compilations of objects make up this model in which values are stored within instance variables which is
inside the object. The object itself comprises bodies of object for its operation which are called methods.
Objects containing same kind of variables and methods are called classes.

47) Define Entity.

It can be defined as being a ‘thing’ with an independent existence in the real world.

48) What do you mean by Entity type?

A set of entries having similar attributes are entity types.

49) Define Entity Set.

Compilation of all entries of any particular type of entry in the database is called Entity Set.

50) What do you mean by Entity type extension?

Compilation of similar entity types into one particular type which is grouped together as an entity set.

You might also like