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

ELNing 4

Uploaded by

lamnam12101999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

ELNing 4

Uploaded by

lamnam12101999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

APPENDIX-D DBMS Interview Questions and Answers

Q. 1. What is database?
Ans. A database is a logically coherent collection of data with some inherent meaning,
representing some aspect of real world and which is designed, built and populated with data for a
specific purpose.
Q. 2. What is DBMS?
Ans. It is a collection of programs that enables user to create and maintain a database. In other
words it is gereral-purpose software that provides the users with the processes of defining,
constructing and manipulating the database for various applications.
Q. 3. What is a Database system?
Ans. The database and DBMS software together is called as Database system.
Q. 4. Advantages of DBMS?
Ans. (i) Redundancy is controlled.
(ii) Unauthorised access is restricted.
(iii) Providing multiple user interfaces.
(iv) Enforcing integrity constraints.
(v) Providing backup and recovery.
Q. 5. Disadvantage in File Processing System?
Ans. (i) Data redundancy and inconsistency.
(ii) Difficult in accessing data.
(iii) Data isolation.
(iv) Data integrity.
(v) Concurrent access is not possible. (vi) Security problems.
Q. 6. Describe the three levels of data abstraction ?
Ans. There are three levels of abstraction
(i) Physical level : The lowest level of abstraction describes how data are stored.
(ii) Logical level : The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
(iii) View level :The highest level of abstraction describes only part of entire database.
Q. 7. Define the "integrity rules"
Ans. There are two Integrity rules.
(i) Entity Integrity : States that "Primary key cannot have NULL value"
(ii) Referential Integrity : States that "Foreign Key can be either a NULL value or should be Primary
Key value of other relation.
Q. 8. What is extension and intension?
Ans. Extension—It is the number of tuples present in a table at any instance. This is time
dependent.
Intension —It is a constant value that gives the name, structure of table and the constraint laid on it.
285 DATABASE MANAGEMENT SYSTEMS

Q. 9. What is System R? What are two major subsystems?


Ans. System R was designed and developed over a preiod of 1974 -79 at IBM San Jose Research
Ccnter. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational
System that can be used in a real life environment to solve real life problems, with performance at
least comparable to that of existing system. Its two subsystems are
(i) Research Storage
(ii) System Relational Data System.
Q. 10. How is the data structure of System R different from the relationl structure?
Ans. Unlike Relational systems in System R
(i) Domains are not supported
(ii) Enforcement of candidatc key uniqueness is optional
(iii) Enforcement of entity integrity is optional (iv) Referential integrity is not enforced
Q. 11. What is Data Independence?
Ans. Data independence means that "the application is independent of the storage structure and
access strategy of data". In other words, the ability to modify the schema definition in one level
should not affect the schema definition in the next higher level. 'IWo types of Data Independence:
(i) Physical Data Independence : Modification in physical level should not affect the Logical level.
(ii) Logical Data Independence : Modification in logical level should not affect the view level.
Note : Logical Data Independence is more difficult to achieve
Q. 12. What is a view? How it is related to data independence?
Ans. A view may be thought of as a virtual table, that is, a table that does not really exist in its own
right but is instead derived from one or more underlying base table. In other words, there is no
stored file that direct represents the view instead a definition of view is stored in data dictionary.
Growth and restructuring of base tables is not reflected in views. Thus, the view can insulate users
from the effects of restructuring and growth in the database. Hence accounts for logical data
independence.
Q. 13. What is Data Model?
Ans. A collection of conceptual tools for describing data, data relationships data semantics and
constraints.
Q. 14. What is E-R model?
Ans. This data model is based on real world that consists of basic objects called entities and of
relationship among these objects. Entities are described in a database by a set of attributes.
Q. 15. What is Object Oriented model?
Ans. This model is based of collection of object. An object contains values stored in instance
variables with in the object. An object also contains bodies of code that operate on the object. These
bodies of code are called methods. Objects that contain sace types of values and the same methods
are grouped together into classes.
Q. 16. What is an Entity?
Ans. It is a 'thing' in the real world with an independent existence.
Q. 17. What is an Entity type
Ans. It is a collection (set) of entities that have same attributes.
Q. 18. What is an Entity type set?
Ans. It is a collection of all entities of particular entity type in the database.
APPENDIX-D 286

Q, 19. What is an Extension of entity type?


Ans. The collection of entites of a particular entity type are grouped together into an entity set.
Q. 20. What is Weak Entity set?
Ans. An entity set may not have sufficient attributes to form a primary key, and its primary key
compromises of its partial key and primary key of its parent entity, then it is said Weak Entity set.
Q. 21. What is an attribute?
Ans. It is a particular property, which describes the entity.
Q. 22. What is a Relation Schema and a Relation ?
Ans. A relation Schema denoted by R (Al, A2,..., An) is made up of the relation name R and thc list
of attributes Al that it contains. A relation is defined as a set of tuples. Let r be the relation which
contains set tuples (tl, t2, t3,...tn). Each tuple is an ordered list of n-values t = (v1,v2,...vn).
Q. 23. What is degree of a Relation ?
Ans. It is the number of attribute of its relation schema.
Q. 24. What is Relationship ?
Ans. It is an association among two or more entites.
Q. 25. What is Relationship set?
Ans. The collection (or set) of similar relationships.
Q. 26. What is Relationship type ?
Ans. Relationship type defines a set of associations or a relationship set among a given set of entity
types.
Q. 27. What is degree of Relationship type ? Ans. It is
the number of entity type participating.
Q. 28. What is DDL (Data Definition Language)?
Ans. A database schema specifies by a set of definitions expressed by a special language called
DDL.
Q, 29, What is VDL (View Definition Language)?
Ans. It specifies user views and their mappings to the conceptual schema
Q. 30. What is Data Storage-Definition Language?
Ans. The storage structures and access methods used by database system are specified by a set of
definition in a special typc of DDL called data storage-definition language.
Q. 31. What is DML (Data Manipulation Language)?
Ans. This language that enable user to access or manipulate data as organised by appropriate data
model.
Procedural DML or Low level : DML requires a user to specify what data are needed and how to
get those data.
Non-Procedural DML or High level: DML requires a user to specify what data are needed without
specifying how to get those data.
Q. 32. What is VDL (View Definition Language)?
Ans. It specifies user views and their mappings to the conceptual schema.
Q. 33. What is DML Compiler'?
287 DATABASE MANAGEMENT SYSTEMS

Ans. It translates DML statements in a query language into low-level instruction that the query
evaluation engine can understand.
Q. 34. What is Query evaluation engine?
Ans. It executes low-level instruction generated by compiler.
Q. 35. What is DDL Interpreter?
Ans. It interprets DDL statements and record them in tables containing metadata.
Q. 36. What is Record-at-a-time-?
Ans. The low level or Procedural DML can specify and retrieve each record from a set of records.
This retrive of a record is said to be Record-at-a-time.
Q. 37. What is Set-at-a-time or Set-oriented?
Ans. The High level or Non-procedural DML can specify and retrive many records in a single DML
statement. This retrieve of a record is said to be set-at-a-time or Set-oriented.
Q. 38. What is Relational Algebra?
Ans. It is procedural query language. It consists of a set of operations that take one or two relations
as input and produce a new relation.
Q. 39. What is Relational Calculus?
Ans. It is an applied predicate calculus specifically tailored for relational databases proposed by
E.F. Codd, e.g., of languages based on it are DSL ALPHA, QUEL.
Q. 40. How does Thple-oriented relational calculus differ from domain-oriented relational
calculus ?
Ans. The tuple-oriented calculus uses a tuple variables, i.e., variable whose only permitted values
are tuples of that relation, e.g., QUEL.
The domain-oriented calculus has domain variables, i.e., variables that range over the underlying
domains instead of over relation, e.g., ILL, DEDUCE.
Q. 41. What is normalization?
Ans. It is a process of analysing the given relation schemas based on their Functional Dependencies
(FDs) and primary key to achieve the properties (i) Minimizing redundancy
(ii) Minimizing insertion, deletion amd update anomalies.
Q. 42. What is Functional Dependency?
Ans. A Functional dependency is denoted by X Y between two sets of attributes X and Y that are
subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The
constraint is for any two tuples tl and t2 in r if t I[X] = t 2[Xl then they have t I[Y] = t 2[Y]. This
means the value of X component of a tuple uniquely determines the value of component Y.
Q. 43. When is a functional dependency F said to be minimal?
Ans. (i) Every dependency in F has a single attribute for its right hand side. (ii). We cannot replace
any dependency X A in F with a dependency Y A where Y is a proper subset of x and still have a
set of dependency that is equivalent to F.
(iii) We cannot remove any dependency from F and still have set of dependency that is equivalent
to F.
Q. 44. What is Multivalued dependency?
APPENDIX-D 288

Ans. Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are
both subsets of R, specifies the following constraint on any relation r of R: if two tuples t 1 and t2
exist in r such that t I[X] t 2[X] then t3 and t4 should also exist in r with the following propertics

t 3 [Y] - t 1 [Y] andt4[Y] t3


[Z] = t2 [Z] and t4 [Z] = ti [Z]
where [Z = (R - (XUY))]
Q. 45. What is Lossless join property?
Ans. It guarantees that the spurious tuple generation does not occur with respect to relation schemas
after decomposition.
Q. 46. What is 1 NF (Normal Form) ?
Ans. The domain of attribute must include only atomic ( simple, indivisible) values.
Q. 47. What is Fully Functional dependency?
Ans. It is based on concept of full functional dependency. A functional dependency X Y is full
functional dependency if removal of any attribute A from X means that the dependency does not
hold any more, i.e., {X — A} + Y.
Q. 48. What is 2NF?
Ans. A relation schema R is in 2NF if it is in INF and every non-prime attribute A in R is fully
functionally dependent on primary key. Q. 49. What is 3NF?
Ans. A relation schema R is in 3NF if it is in 2NF and for every FD X -+ A either of the following
is true
(i) X is a Super-key of R.
OR (ii) A is a prime attribute of R.
In other words, if every non prime attribute is non-transitively dependent on primary key. Q.
50. What is BCNF (Boyce-Codd Normal Form)?
Ans. A relation schema R is in BC-NF if it is in 3NF and satisfies an additional cofistraint that for
cvery FD X -+ A, X must be a candidate key.
Q. 51. What is 4NF?
Ans. A relation schema R is said to be in 4NF if for every Multivalued dependency X -»Y that
holds over R, one of following is true (i) X is subset or equal to (or) X -»Y = R. (ii) X is a super
key.
Q. 52. What is 5NF?
Ans. A Relation schema R is said to be 5NF if for every join dependency {R 1, R 2 ,..., Rn} that
holds R, one the following is true (i) Ri = R for some i.
(ii) The join dependency is implied by the set of FD, over R in which the left side is key of R.
Note : ONF : Optimal Normal Form
A model limited to only simple (elemental) facts, as expressed in Object Role Model notation.
DKNF : Domain-Key Normal Form
A model free from all modification anomalies.
Remember, these normalization guidelines are cumulative. For a database to be in 3NF, it must first
fulfill all the criteria of a 2NF and INF database.
Q. 53. What is RDBMS?
289 DATABASE MANAGEMENT SYSTEMS

Ans. Relational Data Base Management Systems (RDBMS) are database management systems that
maintain data records and indices in tables. Relationships may be created and maintained across and
among the data and tables. In a relational database, relationships between data items are expressed
by means of tables. Interdependencies among these tables are expressed by data values rather than
by pointers. This allows a high degree of data independence. An RDBMS has the capability to
recombine the data items from different files, providing powerful tools for data usage.
Q. 54. What is Stored Procedure?
Ans. A stored procedure is a named group of SQL statements that have been previously created and
stored in the server database. Stored procedures accept input parameters so that a single procedure
can be used over the network by several clients using different input data. And when the procedure
is modified, all clients automatically get the new version. Stored procedures reduce network traffic
and improve performance. Stored pocedures can be used to help ensue the integrity of the database.
e.g. sp_helpdb. sp_renamedb, sp.depends etc.
Q. 55. What is cursors?
Ans. Cursor is a database object used by applications to manipulate data in a set on a row-by-row
basis, instead of the typical SOL commands that operate on all the rows in the set at one time.
In order to work with a cursor we need to perform some steps in the following order :
Declare cursor
Open cursor
Fetch row from the cursor
Process fetched row
Close cursor
Deallocate cursor
Q. 56. What it 'frigger?
Ans. A trigger is a SOL procedure that initiates an action when an event (INSERT, DELETE or
UPDATE) occurs. Triggers are stored in and managed by the DBMS. Triggers are used to maintain
the referential integrity of data by changing the data in a systematic fashion. A trigger cannot be
called or executed; the DBMS automatically fires the trigger as a result of a data modification to the
associated table. Triggers can be viewed as similar to stored procedures in that both consist of
procedural logic that is stored at the database level. Stored procedures, however, are not event-drive
and are not attached to a specific table as triggers are. Stored procedures are explicitly executed by
invoking a CALL to the procedure while triggers are implicitly executed. In addition, triggers can
also execute stored procedures.
Nasted Trigger: A trigger can also contain INSERT, UPDATE and DELETE logic within itself, so
when the trigger is fired because of data modification it can also cause another data modification,
thereby firing another trigger. A trigger that contains data modification logic within itself is called a
nested trigger.
Q. 57. What is View?
Ans. A simple view can be thought of as a subset of a table. It can be used for retrieving data, as
well as updating or deleting rows. Rows updated or deleted in the view are updated or deleted in the
table the view was created with. It should also be noted that as data in the original table changes, so
does data in the view, as views are the way to look at part of the original table. The results of using
a view are not permanently stored in the database. The data accessed through a view is actually
constructed using standard T-SQL select command and can come from one to many different base
tables or even other views.
APPENDIX-D 290

Q. 58. What is Index?


Ans. An index is a physical structure containing pointers to the data Indices are created in an
existing table to locate rows more quickly and efficiently. It is possible to create an index on one or
more columns of a table, and each index is given a name. The users cannot see the indexes, they are
just used to speed up queries. Effective indexes are one of the best ways to improve performance in
a database application. A table scan happens when there is no index avaliable to help a query. In a
table scan SQL Server examines every row in the table to satisfy the query results. Table scans are
sometimes unavoidable, but on large tables, scans have terrific impact on performance.
Clustered indexes define the physical sorting of a database tables rows in the storage media. For
this reason, each database table may have only one clustered index. Non-clustered indexes are
created outside of the database table and contain a sorted list of references to the table itself. Q. 59.
Explain the persistent property for databases.
Ans. Presistent means that data resides on stable storage such as a magnetic disk.
For example : Organizations need to retain data about customers, suppliers, and inventory on stable
storage because these data are repetitively used. A variable in a computer program is not presistent
because it resides in main memory and disappears after the program terminates. Persisitency does
not mean that data lasts forever. When data are no longer relevant (such as a supplier going out of
business), they are removed or achived.
Q. 60. Explain the inter- related property for databases.
Ans. Inter-related means that data stored as separate units can be connected to provide a whole
picture. For example, a customer database relates customer data (name, address, ...) to order data
(order number, order data,...) to facilitate order processing. Databases contain both entities and
relationships among entities. An entity is a cluster of data usually about a single topic that can be
accessed together. An entity may denote a person, place, thing, or event.
Q. 61. Explain the shared property for databases.
Ans. Shared means that a database can have multiple uses and users. A database provides a
common memory for multiple functions in an organization. For example, a personnel database can
support payroll calculation, performance evalutions, government reporting requirements, and so on.
Many users can use a database at the same time. For example, many customers can simultaneoulsy
make airline reservations. Unless two users are trying to change the same part of the database at the
same time, they can proceed without waiting.
Q. 62. What is the connection between nonprocedural access and application (form or report)
development? Can nonprocedural access be used in application development?
Ans. The connection between nonprocedural access and application (form or report) development is
that non-procedual access is used in application development to indicate data requirements. Non-
procedural access makes form and report creation possible without extensive coding. As part of
creating a form or report, the user indicates the data requirements using a non-procedural language
(SQL) or graphical tool.
Q. 63. What is difference between a form and a report?
Ans. Data entry forms provide a convenient way to enter and edit data, while reports enhance the
appearance of data that is displayed or printed.
Q. 64. What is a procedural language interface?
Ans. A procedural language interface adds the full capabilities of a computer programming
language. Non-procedural access and application development tools, though convenient and
291 DATABASE MANAGEMENT SYSTEMS

powerful, are sometimes not efficient enough or do not provide the level of control
necessary for application development. When these tools are not adequate, DBMSs
provide the full capabilities of a programming language. A procedural language interface combines
a non-procedural language such as COBOL or Visual Basic.
Q. 65. What is a transaction?
Ans. A transaction is a unit of work that should be processed reliably without interference from
other users and without loss of data due to failures. Examples of transactions are withdrawing cash
at an ATM, making an airline reservation, and registering for a course.
Q. 66. What features does a DBMS provide to support transaction processing?
Ans. A DBMS ensures that transactions are free of interference from other users, parts of a
transaction are not lost due to a failure, and transactions do not make the database
inconsistent. Transaction processing is largely a "behind the scenes" affair. The user does not know
the details about transaction processing other than the assurances about reliability.
Q. 67. What is an enterprise DBMS?
Ans. An enterprise DBMS supports databases that are often critical to the functioning of an
organization. Enterprise DBMSs usually run on powerful servers and have a high cost. Q. 68. What is
a desktop DBMS?
Ans . A desktop DBMS runs on personal and small servers. It supports limited transaction
processing features but has a much lower cost then an enterise DBMS. Desktop DBMSs support
databases used by work teams and small businesses .
Q. 69. What were the prominent features of first generation DBMSs?
Ans. File structures and proprietary program interfaces were the prominent features of first
generation database software.
Q. 70. What were the prominent features of second generation DBMSs ?
Ans. Networks and hierarchies of related records along with standard program interfaces
were the prominent features of second generation database software.
Q. 71. What were the prominent features of third generation DBMSs ?
Ans. Non -procedural languages, optimization, and transaction processing were the prominent
features of third generation database software.
Q. 72. What are the prominent features of fourth generation DBMSs ?
Ans. Support for multi-media data, active databases, data warehouses, and distributed processing
are the prominent features of generation database software.
Q. 73. For the database you described in question 1, make a table to depict differences among
schema levels. Use Table 1-4 as a guide. Ans.
Schema level Description
External The registration form View, the report of grade View, the faculty assignment
form View, and the report of faculty workload View
APPENDIX-D 292

Conceptual Student, Enrollment, Course, Faculty, and Enrollment tables and


relationships
Internal Files needed to store the tables; extra files to improve performance
Q. 74. In a client-server architecture, why are processing capabilities divided between a client and a
server? In other words, why not have the server do all the processing?
Ans. To improve performance and availability of data, distributed processing allows geographically
dispersed computers to cooperate when providing data access. Work can be balanced between a
server and a client to efficiently process data access requests.
Q. 75. In a client-server architecture, why are data sometimes stored on several computers rather
than on a single computer?
Ans. Because data can be stored in different locations for management and security, data are
sometimes stored on several computers rather than on a single computer.
Q. 76. What is the purpose of the mappings in the Three Schema Architecture? Is the user or the
DBMS responsible for using the mappings ?
Ans. The purpose of the mappings in the Three Schema Architecture is to describe how a schema at
a higher level is derived from a schema at a lower level. The DBMS, not the user, is responsible for
using the mappings.
Q. 77. Explain how the Three Schema Architecture supports data independence?
Ans. The three Schema Architecture is a standard that serves as a guideline about how data
independence can be achieved. The spirit of the Three Schema Architecture is widely implemented
in third-and fourth-generation DBMS. In the Three Schema Architecture, the DBMS uses schemas
and mappings to ensure data independence. Typically, applications access a database using a view.
The DBMS converts an application's request into a request using the conceptual schema rather than
the view. The DBMS then transforms the conceptual schema request into a request using the
internal schema. Most changes to the conceptual or internal schema do not affect applications
because applications do not use the lower schema levels.
Q. 78. What's the difference between a primary key and a unique key?
Ans. Both primary key and unique enforce uniqueness of the column of which they are defined. But
by default primary key creates a clustered index on the column, where as unique creates a
nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs,
but unique key allows NULL.
Q. 79. How to implement one-to-one, one-to-many and many-to-many relationships while designing
tables?
Ans.
• One-to-One relationship can be implemented as a single table and rarely as two tables with
primary and foreign key relationships.
• One-to-Many relationships are implemented by splitting the data into two tables with primary
key and foreign key relationships.
• Many-to-Many relationships are implemented using a junction table with the keys from both
the tables forming the composite primary key of the junction table.
• Q. 80. What is difference detween DELETE and TRUNCATE commands?
293 DATABASE MANAGEMENT SYSTEMS

Ans. Delete command removes the rows from a table based on the condition that we provide with a
WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in
the table after we run the truncate command.
TRUNCATE
• TRUNCATE is faster and uses fewer system and transaction log resources than DELETE.
• TRUNCATE removes the data by deallocating the data pages used to store the table's data, and
only the page deallocations are recorded in the transaction log.
• TRUNCATE removes all rows from a table, but the table structure and its columns,
constraints, indexes and so on remain. The counter used by an identity for new rows is reset to
the seed for the column.
• You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.
Because TRUNCATE TABLE is not logged, it cannot activate a trigger.
• TRUNCATE can not be Rolled back.
• TRUNCATE is DDL Command. • TRUNCATE resets identity of the table.
DELETE
• DELETE remove rows one at a time and records an entry in the transation log for each deleted
row. If you want to retain the identity counter, use DELETE instead. If you want to remove
table definition and its data, use the DROP TABLE statement.
• DELETE can be used with or without a WHERE clause DELETE Activates Triggers.
• DELETE can be rolled back.
• DELETE is DML Command.
• DELETE does to reset identity of the table.
Q. 81. When is the use of UPDATE STATISTICS command?
Ans. This command is basically used when a large processing of data has occurred. If a large
amount of deletions, any modification or Bulk Copy into the tables has occurred, it has to update
the indexes to take these changes into account. UPDATE STATISTICS updates the indexes on
these table accordingly.
Q. 82. What types of joins are possible with SQL Server? Ans. Joins are used in queries to explain
how different tables are related. Joins also let you select data from a table depending upon data
from another table.
Types of Joins : INNER JOINs, OUTER JOINs, NATURAL JOINs, OUTER JOINs are further
classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS
Q. 83. What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
Ans. Specifies a search condition for a group or an aggregate. Having can be used only with the
SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not
used, HAVING behaves like a WHERE clause. Having clause is basically used only with the
GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the
GROUP BY function in a query.
Q. 84. What is sub-query? Explain properties of sub-query.
APPENDIX-D 294

Ans. Sub-queries are often referred to as sub-selects, as they allow a SELECT statement to be
executed arbitrarily within the body of another SQL statement. A sub-query is executed by
enclosing it in a set of parentheses. Sub-queries are generally used to return a single row as an
atomic value, though they may be used to compare values against multiple rows with the IN
keyword.
A sub query is a SELECT statement that is nested within another T-SQL statement. A sub query
SELECT statement if executed independently of the T-SQL statement, in which it is nested, will
return a result set. Meaning a sub query SELECT statement can standalone and is not depended on
the statement in which it is nested. A sub query SELECT statement can return any number of
values, and can be found in the column list of a SELECT statement, a FROM, GROUP BY,
HAVING, and or ORDER BY clauses of a T-SQ statement. A Sub query anywhere an expression
can be used.
Properties of Sub-Query
• A sub query must be enclosed in the parenthesis.
• A sub query must be put in the right hand of the comparison operator, and
• A sub query cannot contain an ORDER-BY clause. ' A query can contain more than one sub-
queries. Q. 85. What are types of sub-queries?
Ans. Single-row sub query, where the sub query returns only one row.
Multiple-row sub query, where the sub query returns multiple rows, and Multiple
column sub query, where the sub query returns multiple columns.
Q. 86. What is log shipping?
Ans. Log shipping is the process of automating the backup of database and transaction log files on a
production SQL server, and then restoring them onto a standby server. Enterprise Editions only
supports log shipping. In log shipping the transactional log file from one server is automatically
updated into the backup database on the other server.
If one server fails, thc other server will have the same databasc can be used this as the Disaster
Recovery plan. The key feature of log shipping is that is will automatically backup transaction logs
throughout the day and automatically restore them on the standby server at defined interval.
Q. 87. What is the difference between a local and a global variable?
Ans. A local temporary table exists only for the duration of a connection or, if defined inside a
compound statement, for the duration of the compound statement.
A global temporary table remains in the database permanently, but the rows exist only within a
given connection. When connection are closed, the data in the global temporary table disappears.
However, the table definition remains with the database for access when database is opened next
time.
Q. 88. What are the properties of the Relational tables?
Ans. Relation tables have six properties :
Values are atomic.
Column values are of the same kind.
Each row is unique
The sequence of columns is insignificant.
Each column must have a unique name.
Q. 89. What is De-normalization?
295 DATABASE MANAGEMENT SYSTEMS

Ans. De-normalization is the process of attempting to optimize the performance of a database by


adding redundant data. If is sometimes necessary because current DBMSs implement the relational
model poorly. A true relational DBMS would allow for a fully normalized database at the logical
level, while providing physical storage of data that is turned for high performance. De-
normalization is a technique to move from higher to lower normal forms of database modeling in
order to speed up database access.
Q. 90. What is the difference between clustered and a non-clustered index?
Ans. A clustered index is a special type of index that reorders the way records in the table are
physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered
index contain the data pages.
A non clustered index is a special type of index in which the logical order of the index does not
match the physical stored order of the rows on disk. The leaf node of a non clustered index does not
consist of the data pages. Instead, the leaf nodes contain index rows.
Q. 91. What are the different index configurations a table can have?
Ans. A table can have one of the following index configurations :
No indexes
A clustered index
A clustered index and many non clustered indexes
A non clustered index
Many non clustered indexes
Q. 92. Why would you choose a database system instead of simply storing data in operating
system files? When would it make sense not to use a database system?
Ans. A database is an integrated collection of data usually so large that is has to be stored on
secondary storage devices such as disks or tapes. This data can be maintained as a collection of
operating system files, or stored in a DBMS (database management system).
The advantages of using a DBMS are :
Data independence and efficient access. Database application programs are independent of the
details of data representation and storage. The conceptual and external schemas provide
independence from physical storage decisions and logical design decisions respectively. In
addition, a DBMS provides efficient storage retrieval mechanisms, including support for very
large files, index structures and query optimization.
Reduced application developement time. Since, the DBMS provides several important
functions required by application, such as concurrency control and crash recovery, high level
query facilities, etc., only application-specific code need to be written. Even this is facilitated
by suites of application development tools available from vendors for many database
management systems.
Data integrity and security. The view mechanism and the authorization facilities of a DBMS
provide a powerful access control mechanism. Further, updata to the data that violate the
semantics of the data can be detected and rejected by the DBMS if users specify the
appropriate integrity constraints.
Data administration. By providing a common umbrella for a large collection of data that is
shared by several users, a DBMS facilitates maintenance and data administration tasks. A good
DBA can effectively shield end-users from the chores of fine-tuning the data representation,
periodic back-ups etc.
APPENDIX-D 296

Concurrent access and crash recoveyy A DBMS supports the notion of a transaction, which is
conceptually a single user's sequential program. Users can write transactions as if their
programs were running in isolation against the database. The DBMS executes the actions of
transactions in an interleaved fashion to optain good performance, but schedules them in such
a way as to ensure that conflicting operations are not permitted to proceed concurrently.
Further, the DBMS maintains a continuous log of the changes to the data, and if there is a
system crash, it can restore the database to a transaction-consistent state. That is, the actions of
in complete transactions are undone, so that the database state reflects only the actions of
completed transactions. Thus, if each complete transaction, executing alone, maintains the
consistency criteria, then the database state after recovery from a crash is consistent.
If these advantages are not important for the application at hand, using a collections of files may be
a better solution because of the increased cost and overhead of purchasing and maintaining a
DBMS.
Q. 93. Explain the difference logical and physical data independence.
Ans. Logical data independence means that users are shielded from changes in the logical structure
of the data, while physical data independence insulate users from changes in the physical strong of
the data.
Q. 94. What are the reponsibilities of a DBA? If we assume that the DBA is never interested in
running his or her own queries, does the DBA still need to understand query optimization?
Why'?
Ans. The DBA is responsible for :
• Designing the logical and physical schemas, as well as widely-used portions of the external
schema.
• Security and authorization
• Data availability and recovery from failures.
• Database tuning : The DBA is responsible for evolving the database, in particular the conceptual
and physical schemas, to ensure adequate performance as user requirements change.
A DBA needs to understand query optimization even if he/she is not interested in running his or her
own queries because some of these reponsibilities (database besign and tuning) are related to query
optimization. Unless the DBA understands the performance needs of widely used queries, and how
the DBMS will optimize and execute these queries, good design and tuning decisions cannot bc
made.

1. Define Database?
2. What is a DBMS?
3. What is the need for database systems?
4. Define tuple?
5. What are the reponsibilities of DBA?
6. Define schema?
7. Define entity and give example?
297 DATABASE MANAGEMENT SYSTEMS

8. What is meant by fQreign key?


9. What are the difference between Unique Key and Primary Key?
10. Dcfinc meta data?
11. What are the disadvantages of database systems?
12. What is meant by weak entities? Give example
13. What is domian relational calculus?
14. Definc OucryLanguage?
15. Define Data model?
16. What are thc 3 levels of data abstraction?
17. What are the advantages of relational model?
18. Define relation and relationship set?
19. Define attribute. List its types?
20. What is meant by entity set?
21. What are the different types of data models?
22. What is the difference between candidate key and super key?
23. What is meant by relational model?
24. What arc the components of storage manager?
25. What is the difference between composite and simple attributes?
26. Compare database systems and file systems.
27. Give the distinction between primary key, candidate key and super key.
28. What is derived attribute?
29. What is the difference between weak and strong entity set?
30. What is the difference between a procedural and non-procedural languages?

You might also like