Download File

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Relational algebra wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

SQL wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Database wikipedia , lookup

Serializability wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Clusterpoint wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
IMPORTANT 2 MARKS
UNIT -I
What do you mean by simple and composite attribute? [Nov/Dec 2013]
A composite attribute is an attribute composed of multiple components, each with an independent existence. Some attributes
can be further broken down or divided into smaller components with an independent existence of their own.
2. Define query [Nov/Dec 2013]
Queries are the primary mechanism for retrieving information from a database and consist of questions presented to the
database in a predefined format. Many database management systems use the Structured Query Language (SQL) standard query
format
State the difference between security and integrity. [Nov/Dec 2013]
Data integrity = making sure the data is correct and not corrupt
Data security = making sure only the people who should have access to the data are the only ones who can access the data, also,
keeping straight who can read the data and who can write data.
Which operators are called as unary operators and why are they called so? [Nov/Dec 2013]
A recursive relationship is a relationship between the instances of a single entity type. It is a relationship type in which
the same entity type is associated more than once in different roles. Thus, the entity relates only to another instance of its own type.
For example, a recursive binary relationship 'manages' relates an entity PERSON to another PERSON by management. Recursive
relationships are sometimes called unary relationships
Define trivial functional dependency. [Nov/Dec 2013]
When the right-hand side of the functional dependency is a subset of the left-hand side, it is called trivial dependency.
An example of trivial dependency can be given as:
Eg: FD: {BOOK-ID, CITY-ID} {BOOK-ID}
Trivial dependencies are satisfied by all relations. For example, X —> X is satisfied by all relations involving attribute X.
Define functional dependency. [Nov/Dec 2013]
A functional dependency is a many-to-one relationship between two sets of attributes X and Y of a given table T. Here X and
Y are subsets of the set of attributes of table T. Thus, the functional dependency X—> Y is said to hold in relation R if and only if,
whenever two tuples (rows or records) of T have the same value of X, they also have the same value for Y.
Give example for one to one and one to many relationships. [May/June 2013]
There are three basic constructs of connectivity for binary relationship namely, one to-one (1:1), one-to-many (1: N), and many-tomany (M:N).
In case of one-to-one connection, exactly one PERSON manages the entity DEPT and each person manages exactly one DEPT.
Therefore, the maximum and minimum connectivity are exactly one for both the entities.
In case of one-to-many (1: N), the entity DEPT is associated to many PERSON, whereas each person works within exactly one DEPT.
The maximum and minimum connectivity to the PERSON side are of unknown value N, and one respectively. Both maximum and
minimum connectivity on DEPT side are one only. In case of many-to-many (M: N) connectivity, the entity PERSON may work on
many PROJECTS and each project may be handled by many persons.
Therefore, maximum connectivity for PERSON and PROJECT are M and N respectively, and minimum connectivity are each defined
as one.
If the values of M and N are 10 and 5 respectively, it means that the entity PERSON may be a member of a maximum 5 PROJECTS,
whereas, the entity PROJECT may contain maximum of 10 PERSONs.
What are primary key constrains? [May/June 2013]
The PRIMARY KEY constraint uniquely identifies each record in a database table. Primary keys must contain unique
values. A primary key column cannot contain NULL values. Each table should have a primary key, and each table can have only ONE
primary key.
Write the purpose of Trigger. [May/June 2013]
Audit changes (e.g. keep a log of the users and roles involved in changes) enhance changes (e.g. ensure that every
change to a record is time-stamped by the server's clock) enforce business rules (e.g. require that every invoice have at least one line
item) execute business rules (e.g. notify a manager every time an employee's bank account number changes) replicate data (e.g. store a
record of every change, to be shipped.
Define Boyce Code Normal Form. [May/June 2013]
Boyce proposed a normal form known as Boyce-Codd normal form (BCNF). Relation R is said to be in BCNF if for every nontrivial
FD: X —> Y between attributes X and Y holds in R. That means:
X is super key of R.
X —> Y is a trivial FD, that is, Y cz X
What is the need for Normalization? [May/June 2013]
The process of normalization provides the following to the database designers:
A formal framework for analyzing relation schemas based on their keys and on the functional dependencies among their attributes.
A series of normal form tests that can be carried out on individual relation schemas so that the relational database can be normalized to
any desired degree.
Distinguish the terms primary key and super key. [Nov/Dec 2012]
Primary key is chosen by the database designer as the principal means of identifying an entity in the entity set.
A super key is a set of one or more attributes that collectively allows us to identify uniquely an entity in the entity set.
Specify the difference between physical and logical data independence. [Nov/Dec 2012]
Logical data independence:
It makes it possible to change the structure of the data independently of modifying the applications or programs that make use of the
data.
There is no need to rewrite current applications as part of the process of adding to or removing data from then system.
Physical data independence:
This approach has to do with altering the organization or storage procedures related to the data, rather than modifying the data itself.
Accomplishing this shift in file organization or the indexing strategy used for the data does not require any modification to the
external structure of the applications, meaning that users of the applications are not likely to notice any difference at all in the function
of their programs.
Mention the six fundamental operations of relational algebra and their symbols. [Nov/Dec 2012]
(i) projection (n) (ii)selection(a) (iii) Cartesian product (X) (iv) Union(D) (v) Set difference (-) (vi)rename(p).
List two reasons why null values might be introduced into the database. [Nov/Dec 2012]
Special requirement for its use in SQL joins.
Special handling required by aggregate function & SQL grouping operator.
Define Multi valued dependency. [Nov/Dec 2012]
A multi valued dependency is a full constraint between two sets of attributes in a relation. In contrast to the functional
independency, the multi valued dependency requires that certain tuples be present in a relation. Therefore, a multi valued dependency
is also referred as a tuples-generating dependency. The multi valued dependency also plays a role in 4NF normalization.
Show that, if a relational database is in BCNF, then it is also in 3NF. [Nov/Dec 2012]
A relation schema R is in third normal form (3NF) if for all:
a —> b in F* at least one of the following holds:
a —> b is trivial (i.e., b I a)
a is a super key for R
List four significant differences between a file-processing system and a DBMS. [May/June 2012]
Some main differences between a database management system and a file-processing system are:
Both systems contain a collection of data and a set of programs which access that data. A database management system coordinates
both the physical and the logical access to the data, whereas a file- processing system coordinates only the physical access.
A database management system reduces the amount of data duplication by ensuring that a physical piece of data is available to all programs authorized to have access to it, whereas data written by one program in a file-processing system may not be readable by another
program.
A database management system is designed to allow flexible access to data (i.e., queries), whereas a file-processing system is
designed to allow predetermined access to data (i.e., compiled programs).
A database management system is designed to coordinate multiple users accessing the same data at the same time. A file-processing
system is usually designed to allow one or more programs to access different data files at the same time. In a file-processing system, a
file can be accessed by two programs concurrently only if both programs have read-only access to the file.
What are the different types of Data Models? [May/June 2012]
Data models can be broadly classified into the following three categories:
Record-based data models
Object-based data models
Physical data models
Give an example of a relation schema R and a set of dependencies such that R is in BCNF, but not in 4NF.
[May/June 2012]
3NF example-there may still be redundancies
Consider R(A, B. C, D), A ® D, and D ® A.
BCD is also a key for R
Therefore R is in 3NF
However, A and D values may still occur redundantly
A
Al
Al
Al
a2
B
Bl
b2
b2
b2
C
cl
c2
c3
c3
D
dl
dl
dl
d2
Why are certain functional dependencies called as trivial functional dependencies? [May/June 2012]
When the right-hand side of the functional dependency is a subset of the left-hand side, it is called trivial dependency. An
example of trivial dependency can be given as:
FD: {BOOK-ID, CITY-ID} {BOOK-ID}
Trivial dependencies are satisfied by all relations. For example, X —> X is satisfied by all relations involving attribute X. In general, a
functional dependency of the form X —> Y is trivial if Y c X. Trivial dependencies are not used in practice. They are eliminated to
reduce the size of the functional dependencies.
Define data model [Nov/Dec 2011]
Data model is a collection of conceptual tools for describing data, data relationships, data semantics and consistency
constraints.
Types of data model are:
E-R Model.
Relational Model.
Hierarchical Model
Network Model
Object oriented Model
Object Relational Model
Explain derived attribute with an example [Nov/Dec 2011]
Derived attribute is one that represents a value that is derivable from the value of a related attribute or set of attributes
E.g. the age attribute can be derived from the Date of Birth attribute.
Consider the following relation: R (A, B, C, D, E)
The primary key of the relation is AB. The following functional dependencies hold:
A->C B —> D AB —> E
Is the above relation in second normal form?
[Nov/Dec 2011]
Yes, the above relation is in second normal form because it is in 1st normal form and satisfies partial dependency
Consider the following relation: R (A, B, C, D)
The primary key of the relation is A. The following functional dependencies hold:
A^B, C B —> D
Is the above relation in third normal form?
[Nov/Dec 2011]
No, the above relation is not in 3 normal forms. As it do not satisfy transitive dependency.
UNIT-II
Brief about Cascading rollback. [Nov/Dec 2013]
A cascading rollback occurs in database systems when a transaction (T1) causes a failure and a rollback must be performed.
Other transactions dependent on T1's actions must also be rolled backed due to T1's failure, thus causing a cascading effect. That is,
one transaction's failure causes many to fail.
Write down the SQL facilities for recovery. [Nov/Dec 2012]
SQL server is designed to recover from system and media failure and recovery system can scale to machines with very large
buffer pools and thousand of disk drives.
Describe a circumstance in which you would choose to use embedded SQL rather than using SQL alone.
List two major problems with processing of update operations expressed in terms of views.
Since the view may not have all the attributes of the underlying tables, insertion of a tuple into the view will insert tuples into the
underlying tables, with those attributes not participating in the view getting null values. This may not be desirable, especially if the
attribute in question is part of the primary key of the table.
(b) If a view is a join of several underlying tables and asn insertion results in tuples with nulls in the join columns, the desired effect of
the insertion will not be achieved. In other words, an update to a view may not be expressible at all as updates to base relations.
List down the SQL facilities for concurrency
LIST OF SQL FACILITIES
Query Optimizer - Translates SQL into an ordered expression of relational DB operators (Select, Project, Join)
Query Executor - Executes the ordered expression by running a program for each operator, which in turn accesses records of files
Access methods - provides indexed record-at-a-time access to files (OpenScan, GetNext, ...)
Page-oriented files - Read or Write (page address)
What benefit does strict two-phase locking provide? What disadvantages result? [May/June 2012]
ADVANTAGE: It produces only cascade less schedules, recovery is very easy.
DISADVANTAGE: The set of schedules obtainable is a subset of those obtainable from plain two phase locking, thus concurrency is
reduced.
Consider the following relation:
EMP (ENO, NAME, DATE_OF_BIRTH, SEX, DATE_OF_JOINING, BASIC_PAY, DEPT) Develop an SQL query that will
find and display the average BASIC _ PAY in each DEPT.
[Nov/Dec 2011]
SQL > select DEPT, avg (BASIC_PAY) from EMP group by DEPT
8. List the two types of embedded SQL SELECT statements.
[Nov/Dec 2011]
Open
Fetch
List the two commonly used Concurrency Control techniques. [Nov/Dec 2011]
Lock Based Protocols
To ensure serializability, it is required that data items should be accessed in mutual exclusive manner, eg two phase locking Protocol.
Time stamp Based Protocols.
It ensures serializability. It selects an ordering among transactions in advance using timestamps.
List the SQL statements used for transaction control. [Nov/Dec 2011]
Commit: It saves all transactions that have not already been saved to the database since the last commit or rollback command
was issued.
Rollback: It is used to undo transactions that have not already been saved to the database.
Save point: It establishes a point back to which you may roll.
Set Transaction: It establishes properties for current transaction
UNIT-III
What is a rigorous two phase locking protocol? [Nov/Dec 2013]
Two-phase locking (also called 2PL) is a method or a protocol of controlling concurrent processing in which all locking
operations precede the first unlocking operation. Thus, a transaction is said to follow the two phase locking protocol if all locking
operations (such as read_lock, write_lock) precede the first unlock operation in the transaction.
Define Atomicity in transaction management. [May/June 2013]
Atomicity means that either all the work of a transaction or none of it is applied. With atomicity property of the transaction, other
operations can only access any of the rows involved in transactional access either before the transaction occurs or after the transaction
is complete, but never while the transaction is partially complete.
List ACID properties. [May/June 2013]
Transaction has, generally, following four properties, called ACID:
Atomicity
Consistency
Isolation
Durability
Define two phase locking. [May/June 2013]
Two-phase locking (also called 2PL) is a method or a protocol of controlling concurrent processing in which all locking operations
precede the first unlocking operation. Thus, a transaction is said to follow the two phase locking protocol if all locking operations
(such as read_lock, write_lock) precede the first unlock operation in the transaction.
What are two pitfalls (problems) of lock-based protocols? [April/May 2011]
Shared mode lock:
If a transaction T has obtained a shared mode lock on item Q, then T.so T can read, but cannot write Q.
Exclusive mode lock:
If transaction T has obtained a shared mode lock on item Q, then T can read & also write Q.
What are three kinds of intent locks? [April/May 2011]
The three kinds of intent locks are:
Intent shared (IS)
Intent exclusive (IX)
Shared intent exclusive (SIX)
7. What do you mean by a transaction? [April/May 2011]
A transaction is a logical unit of work which alters or accesses the database.
It begins with the execution of begin transaction keyword.
8. What do you mean by concurrency control? [Nov/Dec 2009]
Concurrency control:
Concurrency control is the technique used to control concurrent execution of transaction.
The concurrency control schemes are based on the serializability property.
9. What are the two schedules conflict equivalent? [Nov/Dec 2008]
When they satisfy the following condition:
T1 READ(i) AND T2 READ(i) -DO NOT CONFLICT
T1 READ(i) AND T2 WRITE(i) -THEY CONFLICT
T1 WRITE (i) AND T2 READ(i) -THEY CONFLICT
T1 WRITE (i) AND T2 WRITE(i) -THEY CONFLICT
10. Define deadlock. [Apr/May 2008]
A system is in deadlock if there are set of transactions such that every transaction in the set is waiting for another transaction in
the set is waiting for another transaction in the set.
Eg: In a set of transactions namely {T1,T2,…..,Tn}
Such that T1 is waiting for T2 and T2 for T3….likewise Tn-1 for Tn and finally Tn is waiting for T0.
UNIT-IV
What is the need for RAID? [May/June 2013]
In a RAID system, a combination of data stripping (also called parallelism) and data redundancy is implemented. Data is
distributed over several disks and redundant information is stored on multiple disks. Thus, in case of disk failure the redundant
information is used to reconstruct the content of the failed disk. Therefore, failure of one disk does not lead to the loss of data. The
RAID system increases the performance and improves reliability of the resulting storage system.
What is the basic difference between static hashing and dynamic hashing? [May/June 2013]
Static hashing
Numbers of buckets are fixed. Numbers of Buckets are not fixed.
Dynamic hashing
As the file grows, performance decreases. Performance does not degrade as the file grows. Space overhead is more. Minimum space
lies overhead.
What can be done to reduce the occurrence of bucket overflows in a hash file organizations? [Nov/Dec 2012]
To reduce bucket overflow the number of bucket is chosen to be (nr/ fr) * (l+d). We handle bucket overflow by using
Overflow chaining (closed hashing)
Open hashing
How might the type of index available influence the choice of a query processing strategy? [Nov/Dec 2012]
Possible solutions are:
Choose a better hash function
Allocate more buckets (increase space available)
Mention the different Hashing techniques. [May/June 2012]
The various different hashing techniques are:
Static External Hashing
Dynamic Hashing
Linear Hashing
Static External Hashing
One of the file fields is designated to be the hash key, K, of the file.
Collisions occur when a new record hashes to a bucket that is already full.
An overflow file is kept for storing such records. Overflow records that hash to each bucket can be linked together.
To reduce overflow records, a hash file is typically kept 70-80% full.
The hash function h should distribute the records uniformly among the buckets; otherwise, search time will be increased because many
overflow records will exist.
Dynamic Hashing
Good for database that grows and shrinks in size
Allows the hash function to be modified dynamically
Linear Hashing
This is another dynamic hashing scheme, an alternative to Extendible Hashing.
LH handles the problem of long overflow chains without using a directory, and handles duplicates.
Idea: Use a family of hash functions hO, hi, h2,...
When is it preferable to use a dense index rather than a sparse index? Explain your answer. [May/June 2012]
Let us take an example of a PURCHASE record of considering only three data items namely,
Supplier name (SUP-NAME)
Order number (ORD- NO) and
Order value (ORD-VALUE), which shows dense indexing for record of PURCHASE file.
Suppose that we are looking up records for the supplier name "KEY System":
Using the dense index, pointer is followed directly to the first record with SUP-NAME "KLY System".
This record is processed and the pointer in that record is followed to locate the next record in order of search-key (SUP-NAME).
The processing of records is continued until a record for supplier name other than "KLY System" is encountered. In case of sparse
indexing there is no index entry for supplier name "KLY System".
Since the last entry in alphabet order before "KLY System" is "JUSCO Ltd", that pointer is followed. Then the PURCHASE file is
read in sequential order until the first "KLY System" record is found, and processing begins at that point.
What are ordered indices? [Nov/Dec 2011]
Each index structure is associated with a particular' search Key.
If the file containing the records is sequentially ordered, a primaiy index is an index whose search key also defines the sequential order
of the file.
Primary indices are also called as ordered indices or clustering indices.
Distinguish between sparse index and dense index. [Nov/Dec 2011]
Dense Index:
In a dense primary index, the index record contains the search key value and a pointer to the first data record with the search key value
rest of the records with the same search key.
Sparse Index:
An index record appears for only some of the search key values to locate a record, we find the index entiy with the largest search key
less than or equal to the search key value for which we are looking.
What are the advantages and disadvantages of indexed sequential file? [April/May 2011]
Advantage:
Records are stored in sequential order, according to the value of a "search key" of each record.
Disadvantage:
Over flow occurs in indexed sequential file organization.
Which are the factors to be considered for the evaluation of indexing and hashing techniques? [April/May 2011]
The factors to be considered for the evaluation of indexing and hashing techniques are access type, access time, insertion time,
deletion time and space overhead.
What is the drawback of flash memory? [April/May 2011]
The drawback of flash memory is that an entire block must be erased and written over at a time.
Give the measures of the quality of the disk?



Seek time
Rotational Latency
Data Transfer Rate

Mean Time to failure
What is stripping and mirroring?
Stripping: Data is segmented to equal size partitions which are transparently distributed across multiple disks. It improves I/O
performance by allowing multiple I/O to be serviced in parallel.
Mirroring: Creating identical copy (redundantly) for ensuring consistency during disk failure and also called as shadowing.
UNIT-V
1. In SQL how will you create a structured type? Give an example. [Nov/Dec 2009]
The basic structure of a SQL expression consists of three clauses: select, from, and where.
A typical SQL query has the form
Select a,(Column name) A1,A2,…An from r (table name) r1.....rn where p(cond);
Example: SELECT Roll no, name FROM emp WHERE salary>10,000;
2. How do the XML data differ from that of Relational data? [Nov/Dec 2009]
Relational Databases are widely used in existing applications. XML data are stored in Relational databases. Converting Relational
data to XML data is none straight forward converting XML data to Relational data is straight forward
More applications are generated relational schema
Many applications are not generated XML data.
Simple storage in Relational Database.
Complicated storage in XML database.
3. What are structured data types? What are collection types, in particular? [Nov/Dec 2008]
The different types of structured data types are namely:
4. State the advantages of distributed systems.[Apr/May 2008]
In a distributed database, data can be stored in different systems like personal computers, servers, mainframes, etc.
1) A user doesn’t know where the data is located physically. Database presents the data to the user as if it were located locally.
2) Database can be accessed over different networks.
3) Data can be joined and updated from different tables which are located on different machines.
5. What is data warehousing?[Apr/May 2008]
A data warehouse is constructed by integrating data from multiple heterogeneous sources. It supports analytical reporting,
structured and/or ad hoc queries and decision making. This tutorial adopts a step-by-step approach to explain all the necessary
concepts of data warehousing.
6. Compare DBMS with IR [Nov/Dec 2006]
IR
DBMS
Imprecise Semantics
Precise Semantics
Keyword search
SQL
Unstructured data format
Structured data
Read-Mostly. Add docs occasionally
Expect reasonable number of updates
Page through top k results
Generate full answer
Deals with querying issues like keyword search, relevance
ranking,..
Deals with transaction issues like concurrency control,
recovery,….s
7. List out the different types of DAC Mechanisms



Discretionary Access control(DAC)
Mandatory Access control(MAC)
Role Based Access control(RBAC)
8. Define cryptography and explain its types
Cryptography is a technique of encoding and decoding messages so that they are not understood by anybody other than person
who sends and intended recipient.
There are two types namely:
Symmetric cryptography: Secret key cryptography.
Asymmetric cryptography: public/private key cryptography.
9. Explain the different types of privileges with an example for each
10. What the two types are of commit protocols that can be used in a distributed system.