250+ TOP MCQs on Entity-Relationship Design Issues and Answers

Database online test on “Entity-Relationship Design Issues”.

1. Let us consider phone_number ,which can take single or several values . Treating phone_numberas an _________ permits instructors to have several phone numbers (including zero) associated with them.
a) Entity
b) Attribute
c) Relation
d) Value

Answer: a
Clarification: Treating a phone as an attribute phone_number implies that instructors have precisely one phone number each.

2. The total participation by entities is represented in E-R diagram as
a) Dashed line
b) Double line
c) Double rectangle
d) Circle

Answer: b
Clarification: It is used to represent the relation between several attributes.

3. Given the basic ER and relational models, which of the following is INCORRECT?
a) An attribute of an entity can have more than one value
b) An attribute of an entity can be composite
c) In a row of a relational table, an attribute can have more than one value
d) In a row of a relational table, an attribute can have exactly one value or a NULL value

Answer: c
Clarification: It is possible to have several values for a single attribute provide it is a multi-valued attribute.

4. Which of the following indicates the maximum number of entities that can be involved in a relationship?
a) Minimum cardinality
b) Maximum cardinality
c) ERD
d) Greater Entity Count

Answer: b
Clarification: In SQL (Structured Query Language), the term cardinality refers to the uniqueness of data values contained in a particular column (attribute) of a database table.

5. In E-R diagram generalization is represented by
a) Ellipse
b) Dashed ellipse
c) Rectangle
d) Triangle

Answer: d
Clarification: Ellipse represents attributes, rectangle represents entity.

6. What is a relationship called when it is maintained between two entities?
a) Unary
b) Binary
c) Ternary
d) Quaternary

Answer: b
Clarification: Binary word usually represents two attributes.

7. Which of the following is a low level operator?
a) Insert
b) Update
c) Delete
d) Directory

Answer: d
Clarification: Directory is a low level to word on in file system.

8. Key to represent relationship between tables is called
a) Primary key
b) Secondary Key
c) Foreign Key
d) None of the mentioned

Answer: c
Clarification: Primary key of one relation used as an attribute in another relation is called foreign key.

9. A window into a portion of a database is
a) Schema
b) View
c) Query
d) Data dictionary

Answer: b
Clarification: View is a logical portion of a database which is needed by some users.

10. A primary key is combined with a foreign key creates
a) Parent-Child relation ship between the tables that connect them
b) Many to many relationship between the tables that connect them
c) Network model between the tables that connect them
d) None of the mentioned

Answer: a
Clarification: Using the two relationships mother and father provides us a record of a child’s mother, even if we are not aware of the father’s identity; a null value would be required if the ternary relationship parent is used. Using binary relationship sets is preferable in this case.

250+ TOP MCQs on Application Security and Answers

Database Multiple Choice Questions on “Application Security”.

1. In _________________ attacks, the attacker manages to get an application to execute an SQL query created by the attacker.
a) SQL injection
b) SQL
c) Direct
d) Application

Answer: a
Clarification: Application security has to deal with several security threats and issues beyond those handled by SQL authorization.

2. A Web site that allows users to enter text, such as a comment or a name, and then stores it and later display it to other users, is potentially vulnerable to a kind of attack called a ___________________ attack.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting

Answer: c
Clarification: In such an attack, a malicious user enters code written in a client-side scripting language such as JavaScript or Flash instead of entering a valid name or comment.

3. _________ is an attack which forces an end user to execute unwanted actions on a web application in which he/she is currently authenticated.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting

Answer: b
Clarification: Cross-site request forgery, also known as a one-click attack or session riding and abbreviated as CSRF or XSRF.

4. Many applications use _________________ where two independent factors are used to identify a user.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting

Answer: a
Clarification: The two factors should not share a common vulnerability.

5. Even with two-factor authentication, users may still be vulnerable to_____________attacks.
a) Radiant
b) Cross attack
c) scripting
d) Man-in-the-middle

Answer: d
Clarification: In such attacks, a user attempting to connect to the application is diverted to a fake Web site, which accepts the password from the user, and uses it immediately to authenticate to the original application.

6. A single ______________ further allows the user to be authenticated once, and multiple applications can then verify the user’s identity through an authentication service without requiring reauthentication.
a) OpenID
b) Sign-on system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)

Answer: b
Clarification: Once the user logged in at one site, he does not have to enter his user name and password at other sites that use the same single sign-on service.

7. The ___________________ is a standard for exchanging authentication and authorization information between different security domains, to provide cross-organization single sign-on.
a) OpenID
b) Sign-on system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)

Answer: c
Clarification: The user’s password and other authentication factors are never revealed to the application, and the user need not register explicitly with the application.

8. The __________ standard is an alternative for single sign-on across organizations, and has seen increasing acceptance in recent years.
a) OpenID
b) Single-site system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)

Answer: a
Clarification: The user’s password and other authentication factors are never revealed to the application, and the user need not register explicitly with the application.

9. _______________ allows a system administrator to associate a function with a relation; the function returns a predicate that must be added to any query that uses the relation.
a) OpenID
b) Single-site system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)

Answer: d
Clarification: Some database systems provide mechanisms for fine-grained authorization.

10. VPD provides authorization at the level of specific tuples, or rows, of a relation, and is therefore said to be a _____________ mechanism.
a) Row-level authorization
b) Column-level authentication
c) Row-type authentication
d) Authorization security

Answer: a
Clarification: Oracle Virtual Private Database (VPD) allows a system administrator to associate a function with a relation.

250+ TOP MCQs on Selection Operation and Answers

Database Multiple Choice Questions on “Selection Operation”.

1. In query processing, the ___________ is the lowest-level operator to access data.
a) Index Search
b) Linear search
c) File scan
d) Access paths

Answer: c
Clarification: File scans are search algorithms that locate and retrieve records that fulfill a selection condition.

2. In a ____________ the system scans each file block and tests all records to see whether they satisfy the selection condition.
a) Index Search
b) Linear search
c) File scan
d) Access paths

Answer: b
Clarification: An initial seek is required to access the first block of the file.

3. Index structures are referred to as __________ since they provide a path through which data can be located and accessed.
a) Index Search
b) Linear search
c) File scan
d) Access paths

Answer: d
Clarification: A primary index is an index that allows the records of a file to be read in an order that corresponds to the physical order in the file.

4. Search algorithms that use an index are referred to as
a) Index Search
b) Linear search
c) File scan
d) Access paths

Answer: a
Clarification: Selection predicates are used to guide in the choice of the index to use in processing the query.

5. Which algorithm uses equality comparison on a key attribute with a primary index to retrieve a single record that satisfies the corresponding equality condition.
a) A2
b) A4
c) A5
d) A6

Answer: a
Clarification: A2 – primary index, equality on key.

6. The strategy can retrieve a single record if the equality condition is on a key; multiple records may be retrieved if the indexing field is not a key is
a) A2
b) A4
c) A5
d) A6

Answer: b
Clarification: A4 – Secondary index, equality.

7. The algorithm that uses a secondary ordered index to guide retrieval for comparison conditions involving <,≤,≥, or > is
a) A2
b) A4
c) A5
d) A6

Answer: d
Clarification: A6 – Secondary index, comparison.

8. The ___ algorithm scans each index for pointers to tuples that satisfy an individual condition.
a) A2
b) A4
c) A9
d) A6

Answer: c
Clarification: A9 – Conjunctive selection by an intersection of identifiers.

9. If access paths are available on all the conditions of a disjunctive selection, each index is scanned for pointers to tuples that satisfy the individual condition. This is satisfied by
a) A10
b) A7
c) A9
d) A6

Answer: a
Clarification: A10 – Disjunctive selection by union of identifiers.

10. Conjunctive selection using one index. This is
a) A10
b) A7
c) A9
d) A6

Answer: b
Clarification: To reduce the cost of A7 we choose a i and one of algorithms A1 through A6 for which the combination results in the least cost for i (r ). The cost of algorithm A7 is given by the cost of the chosen algorithm.

250+ TOP MCQs on Transactions as SQL Statements and Answers

Basic Database Questions and Answers on “Transactions as SQL Statements”.

1. Which of the following is not a property of transactions?
a) Atomicity
b) Concurrency
c) Isolation
d) Durability

Answer: d
Clarification: ACID properties are the properties of transactions.

2. SNAPSHOT is used for (DBA)
a) Synonym
b) Tablespace
c) System server
d) Dynamic data replication

Answer: d
Clarification: Snapshot gets the instance of the database at that time.

3. Isolation of the transactions is ensured by
a) Transaction management
b) Application programmer
c) Concurrency control
d) Recovery management

Answer: c
Clarification: ACID properties are the properties of transactions.

4. Constraint checking can be disabled in existing _______________ and _____________ constraints so that any data you modify or add to the table is not checked against the constraint.
a) CHECK, FOREIGN KEY
b) DELETE, FOREIGN KEY
c) CHECK, PRIMARY KEY
d) PRIMARY KEY, FOREIGN KEY

Answer: a
Clarification: Check and foreign constraints are used to constraint the table data.

5. Problems occurs if we don’t implement a proper locking strategy
a) Dirty reads
b) Phantom reads
c) Lost updates
d) Unrepeatable reads

Answer: d
Clarification: In a concurrent execution of these transactions, it is intuitively clear that they conflict, but this is a conflict not captured by our simple model. This situation is referred to as the phantom phenomenon, because a conflict may exist on “phantom” data.

6. Which of the following fixed database roles can add or remove user IDs?
a) db_accessadmin
b) db_securityadmin
c) db_setupadmin
d) db_sysadmin

Answer: a
Clarification: The database can be accessed by assigning the roles.

7. By default sql server has ___________ isolation level
a) READ COMMITTED
b) READ UNCOMMITTED
c) SERIALIZABLE
d) REPEATABLE READ

Answer: a
Clarification: Read committed is used to commit the default read operation.

8. Which of the following statements is/are not true for SQL profiler?
a) Enables you to monitor events
b) Check if rows are being inserted properly
c) Check the performance of a stored procedure
d) ALL of the mentioned

Answer: c
Clarification: Read committed is used to commit the default read operation.

9. Which of the following is the original purpose of SQL?
a) To specify the syntax and semantics of SQL data definition language
b) To specify the syntax and semantics of SQL manipulation language
c) To define the data structures
d) All of the mentioned

Answer: d
Clarification: Read committed is used to commit the default read operation.

10. SQL can be used to:
a) Create database structures only
b) Query database data only
c) Modify database data only
d) All of the mentioned

Answer: d
Clarification: In a concurrent execution of these transactions, it is intuitively clear that they conflict, but this is a conflict not captured by our simple model. This situation is referred to as the phantom phenomenon, because a conflict may exist on “phantom” data.

250+ TOP MCQs on Transactions and Answers

Database Multiple Choice Questions on “Transactions”.

1. A _________ consists of a sequence of query and/or update statements.
a) Transaction
b) Commit
c) Rollback
d) Flashback

Answer: a
Clarification: Transaction is a set of operation until commit.

2. Which of the following makes the transaction permanent in the database?
a) View
b) Commit
c) Rollback
d) Flashback

Answer: b
Clarification: Commit work commits the current transaction.

3. In order to undo the work of transaction after last commit which one should be used?
a) View
b) Commit
c) Rollback
d) Flashback

Answer: c
Clarification: Rollback work causes the current transaction to be rolled back; that is, it undoes all the updates performed by the SQL statements in the transaction.

4. Consider the following action:

TRANSACTION.....
Commit;
ROLLBACK;

What does Rollback do?
a) Undoes the transactions before commit
b) Clears all transactions
c) Redoes the transactions before commit
d) No action

Answer: d
Clarification: Once a transaction has executed commit work, its effects can no longer be undone by rollback work.

5. In case of any shut down during transaction before commit which of the following statement is done automatically?
a) View
b) Commit
c) Rollback
d) Flashback

Answer: c
Clarification: Once a transaction has executed commit work, its effects can no longer be undone by rollback work.

6. In order to maintain the consistency during transactions, database provides
a) Commit
b) Atomic
c) Flashback
d) Retain

Answer: b
Clarification: By atomic, either all the effects of the transaction are reflected in the database, or none are (after rollback).

7. Transaction processing is associated with everything below except
a) Conforming an action or triggering a response
b) Producing detail summary or exception report
c) Recording a business activity
d) Maintaining a data

Answer: a
Clarification: None.

8. A transaction completes its execution is said to be
a) Committed
b) Aborted
c) Rolled back
d) Failed

Answer: a
Clarification: A complete transaction always commits.

9. Which of the following is used to get back all the transactions back after rollback?
a) Commit
b) Rollback
c) Flashback
d) Redo

Answer: c
Clarification: None.

10. ______ will undo all statements up to commit?
a) Transaction
b) Flashback
c) Rollback
d) Abort

Answer: c
Clarification: Flashback will undo all the statements and Abort will terminate the operation.

250+ TOP MCQs on Extended E-R Features and Answers

Database Multiple Choice Questions on “Extended E-R Features”.

1. The entity set person is classified as student and employee. This process is called _________
a) Generalization
b) Specialization
c) Inheritance
d) Constraint generalization

Answer: b
Clarification: The process of designating subgroupings within an entity set is called specialization.

2. Which relationship is used to represent a specialization entity?
a) ISA
b) AIS
c) ONIS
d) WHOIS

Answer: a
Clarification: In terms of an E-R diagram, specialization is depicted by a hollow arrow-head pointing from the specialized entity to the other entity.

3. The refinement from an initial entity set into successive levels of entity subgroupings represents a ________ design process in which distinctions are made explicit.
a) Hierarchy
b) Bottom-up
c) Top-down
d) Radical

Answer: c
Clarification: The design process may also proceed in a bottom-up manner, in which multiple entity sets are synthesized into a higher-level entity set on the basis of common features.

4. There are similarities between the instructor entity set and the secretary entity set in the sense that they have several attributes that are conceptually the same across the two entity sets: namely, the identifier, name, and salary attributes. This process is called
a) Commonality
b) Specialization
c) Generalization
d) Similarity

Answer: c
Clarification: Generalization is used to emphasize the similarities among lower-level entity sets and to hide the differences.

5. If an entity set is a lower-level entity set in more than one ISA relationship, then the entity set has
a) Hierarchy
b) Multilevel inheritance
c) Single inheritance
d) Multiple inheritance

Answer: d
Clarification: The attributes of the higher-level entity sets are said to be inherited by the lower-level entity sets.

6. A _____________ constraint requires that an entity belong to no more than one lower-level entity set.
a) Disjointness
b) Uniqueness
c) Special
d) Relational

Answer: a
Clarification: For example, student entity can satisfy only one condition for the student type attribute; an entity can be either a graduate student or an undergraduate student, but cannot be both.

7. Consider the employee work-team example, and assume that certain employees participate in more than one work team. A given employee may therefore appear in more than one of the team entity sets that are lower level entity sets of employee. Thus, the generalization is _____________
a) Overlapping
b) Disjointness
c) Uniqueness
d) Relational

Answer: a
Clarification: In overlapping generalizations, the same entity may belong to more than one lower-level entity set within a single generalization.

8. The completeness constraint may be one of the following: Total generalization or specialization, Partial generalization or specialization. Which is the default?
a) Total
b) Partial
c) Should be specified
d) Cannot be determined

Answer: b
Clarification: Partial generalization or specialization – Some higher-level entities may not belong to any lower-level entity set.

9. Functional dependencies are a generalization of
a) Key dependencies
b) Relation dependencies
c) Database dependencies
d) None of the mentioned

Answer: a
Clarification: The subclasses are combined to form the superclass.

10. Which of the following is another name for a weak entity?
a) Child
b) Owner
c) Dominant
d) All of the mentioned

Answer: a
Clarification: A parent may be called as a strong entity.