Two Mark Questions DBMSD
Two Mark Questions DBMSD
2. Define DBMS
A database-management system (DBMS) is a collection of interrelated data and a set of programs to
access those data. The collection of data, usually referred to as the database, contains information
relevant to an enterprise. The primary goal of a DBMS is to provide a way to store and retrieve
database information that is both convenient and efficient.
4. What is the difference between file systems and database systems? (or)
Compare file systems and database systems (or)What are the advantages of database
systems?
Data redundancy and inconsistency
Difficulty in accessing data
Data isolation
Integrity problems
Atomicity problems
Concurrent-access anomalies
Security problems
5. Define atomicity
Atomicity states that database modifications must follow an “all or nothing” rule. Each transaction is
said to be “atomic.” If one part of the transaction fails, the entire transaction fails.
8. Define instance.
The collection of information stored in the database at a particular moment is called an instance of
the Database.
1
9. Define schema
The overall design of the database is called the database schema. Schemas are changed infrequently,
if at all.
17. What are the different types of users work with the database system?
Naive users
Application programmers
Sophisticated users
Specialized users
2
18. What is the use of naïve users?
Naive users are unsophisticated users who interact with the system by invoking one of the
application programs that have been written previously. Naive users may also simply read reports
generated from the database.
3
23. Define E-R Model
Entity-Relationship (ER) model, a high-level data model that is useful in developing a conceptual
design for a database. Creation of an ER diagram, which is one of the first steps in designing a
database, helps the designer(s) to understand and to specify the desired components of the
database and the relationships among those components. An ER model is a diagram containing
entities or "items", relationships among them, and attributes of the entities and the relationships.
Derived The value for this type of attribute can Calculate Age from date_of_Birth
attribute be derived from
the values of other related attributes or
entities.
30. Give example for one to one and one to many relationships.
One to one
One employee belongs to one organization.
One dog belongs to one person (or one family).
One person has one passport.
A car model is made by one company.
One to many
A car and its parts. Each part belongs to one car and one car has multiple parts.
A movie theater and screens. One theatre usually has multiple screens and each screen
belongs to one theatre.
An ERD and its tables. An entity-relationship diagram has one or more tables and each of
thos tables belongs to one diagram.
Houses in a street. One street had multiple houses and a house belongs to one street.
5
36. Define weak entity sets
An entity set may not have sufficient attributes to form a primary key. Such an entity set is termed a
weak entity set.
6
44. What are the features of E-R model?
It has a high degree of data independence and seeks to remove redundancy in data
representation based on mathematical theorem.
The ER model is a top-down approach in system design
It can be used as a basis for the unification of different views of data such as; network model,
relational or entity modeling
It was developed after the relational database when the industry shifted its attention to
transaction processing
46. Why is it better to use the n-ary relationship over the binary relationship?
The n-ary relation can accept more entity relations than binary which only accepts two. An n-ary
relationship set shows more clearly that several entities participate in a single relationship.
47. What is the difference between a single inheritance and multiple inheritances?
Single inheritance is when a given entity set is involved in a lower entity set in only one ISA
relationship. A multiple inheritance is when it is involved in more than one ISA relationship.
7
3. Define foreign key.
A foreign key is a field in a relational table that matches the primary key column of another table.
The foreign key can be used to cross-reference tables.
9. Define Views.
Any relation that is not part of the logical model, but is made visible to a user as a virtual relation, is
called views. The syntax for view is,
CREATE OR REPLACE VIEW <view_name> AS
SELECT <column_name>
FROM <table_name>;
8
10. Define Materialized Views
Database systems allow view relations to be stored, but they make sure that, if the actual relations
used in the view definition change, the view is kept up to date. Such views are called materialized
views.
11
30. What are the advantages of distributed databases?
1. Local autonomy
2. No reliance on a central site (bottleneck, vulnerability)
3. Continuous operation (reliability, availability)
4. Location independence
5. Fragmentation independence
6. Replication independence
7. Distributed Query Processing (optimization)
8. Distributed Transaction Management (concurrency, recovery)
9. Hardware independence
10. OS independence
11. Network independence
12. DBMS independence
UNIT –III
1. Define normalization
Database normalization is the process of removing redundant data from the database to improve
storage efficiency, data integrity, and scalability. Normalization generally involves splitting existing
tables into multiple ones, which must be re-joined or linked each time a query is issued.
13
11. Define First Normal Form.
A relation is said to be in First Normal Form (1NF) if and only if each attribute of the relation is
atomic.
It does not allows the composite and multi valued attributes.
3NF BCNF
A relation schema R is in 3NF if for every nontrivial A relation schema R is in Boyce- Codd Normal
FD X-> Y in R, X is not a candidate key Form (BCNF) if for every nontrivial FD X-> Y in
R, X is a candidate key
3NF has some redundancy BCNF removes all redundancies caused by
FD’s
Performance is Lesser than BCNF Better Performance than 3NF
14
join dependency is called trivial. The join dependency plays an important role in the Fifth normal
form, also known as project-join normal form.
UNIT IV
1. Define transaction.
A transaction is a unit of program execution that accesses and possibly updates various data items.
A transaction must see a consistent database.
15
7. Define schedule.
Schedules – sequences that indicate the chronological order in which instructions of concurrent
transactions are executed
a schedule for a set of transactions must consist of all instructions of those
transactions
must preserve the order in which the instructions appear in each individual
transaction.
8. Define serializability.
Serializability is the classical concurrency scheme. It ensures that a schedule for executing
concurrent transactions is equivalent to one that executes the transactions serially in some order. It
assumes that all accesses to the database are done using read and write operations.
17
Deadlock occurs when one transaction T in a set of two or more transactions is waiting for some
item that is locked by some other transaction in the set.
25. What are the two phases available in two phase locking protocol?
Phase 1: Growing Phase
transaction may obtain locks
transaction may not release locks
Phase 2: Shrinking Phase
transaction may release locks
transaction may not obtain locks
27. What benefit does strict two phase locking provides? What are its disadvantages?
Cascading rollbacks can be avoided by a modification of two-phase locking called the strict two-
phase locking protocol. This protocol requires not only that locking be two phase, but also that all
exclusive-mode locks taken by a transaction be held until that transaction commits. This
requirement ensures that any data written by an uncommitted transaction are locked in exclusive
mode until the transaction commits, preventing any other transaction from reading the data.
ADVANTAGE: It produces only cascade less schedules, recovery is very easy.
DISADVANTAGE: The set of schedules obtainable is a subset of those obtainable
19
36. Define log.
A log is kept on stable storage. The log is a sequence of log records, and maintains a record of
update activities on the database.
UNIT V
1. What are the various physical storage media?
20
Flash memory is also known as electrically erasable programmable read-only memory
(EEPROM).
Reading data from flash memory takes less than 100 nanoseconds (a nanosecond is 1/1000
of a microsecond), which is roughly as fast as reading data from main memory.
Writing data to flash memory is more complicated—data can be written once, which takes
about 4 to 10 microseconds, but cannot be overwritten directly.
4. Define access time, seek time, rotational latency, data transfer rate & mean time to failure
Access time – the time it takes from when a read or write request is issued to when data transfer
begins. Consists of:
Seek time – time it takes to reposition the arm over the correct track.
Rotational latency – time it takes for the sector to be accessed to appear under the head.
Data-transfer rate – the rate at which data can be retrieved from or stored to the disk.
Mean time to failure (MTTF) – the average time the disk is expected to run continuously without
any failure.
7. What is RAID?
RAID stands for Redundant Array of Inexpensive Disks. RAID is the organization of multiple disks
into a large, high performance logical disk. Disk arrays stripe data across multiple disks and access
them in parallel to achieve:
Higher data transfer rates on large data accesses and
Higher I/O rates on small data accesses.
Data striping also results in uniform load balancing across all of the disks, eliminating hot spots that
otherwise saturate a small number of disks, while the majority of disks sit idle.
21
9. What are the various file organizations?
Heap – a record can be placed anywhere in the file where there is space
Sequential – store records in sequential order, based on the value of the search key of each
record
Hashing – a hash function computed on some attribute of each record; the result specifies in
which block of the file the record should be placed
14. What are the factors that should be considered while choosing indexing methods?
• access type
• access time
• insertion time
• deletion time
• space overhead
22
An index record appears for every Index records are created only for some of the
search key value in file. records.
This record contains search key value To locate a record, we find the index record
and a pointer to the actual record. with the largest search key value less than or
equal to the search key value we are looking for.
Faster Slower
The secondary indices provide alternate access paths to the data by allowing different fields in the
record to be used as index keys. Each secondary index is stored in a separate area with its own
storage allocation, and any number of secondary indices can be dynamically created and deleted.
Index names for a file must be unique.
19. When is it preferable to use dense index rather than sparse index? Explain your answer.
Dense index: An index record appears for every search-key value in the file. In a dense primary
index, the index record contains the search-key value and a pointer to the first data record with that
search-key value. The rest of the records with the same search key-value would be stored
sequentially after the first record, since, because the index is a primary one, records are sorted on
the same search key.
Advantages:
it is generally faster to locate a record.
In dynamic Hashing, the size of the directory grows with the number of collisions to accommodate
new records and avoid long overflow page chains.
24