Saturday, September 19, 2020

Database Systems MCQ

 Q.1 When R∩S = ะค , then the cost of computing R|><|S is

(A) the same as R × S

(B) greater the R × S

(C) less than R × S

(D) cannot say anything

Ans: (A)

 

Q.2 In SQL the word ‘natural’ can be used with

(A) inner join

(B) full outer join

(C) right outer join

(D) all of the above

Ans: (A)

 

Q.3 The default level of consistency in SQL is

(A) repeatable read

(B) read committed

(C) read uncommitted

(D) serializable

Ans: (D)

 

Q.4 If a transaction T has obtained an exclusive lock on item Q, then T can

(A) read Q

(B) write Q

(C) both read and write Q

(D) write Q but not read Q

Ans: (C)

 

Q.5 Shadow paging has

(A) no redo

(B) no undo

(C) redo but no undo

(D) neither redo nor undo

Ans: (A)

 

Q.6 If the closure of an attribute set is the entire relation then the attribute set is a

(A) superkey

(B) candidate key

(C) primary key

(D) not a key

Ans: (A)

 

Q.7 DROP is a ______________ statement in SQL.

(A) Query

(B) Embedded SQL

(C) DDL

(D) DCL

Ans: (C)

 

Q.8 If two relations R and S are joined, then the non matching tuples of both R and S are ignored in

(A) left outer join

(B) right outer join

(C) full outer join

(D) inner join

Ans: (D)

 

Q.9 The keyword to eliminate duplicate rows from the query result in SQL is

(A) DISTINCT

(B) NO DUPLICATE

(C) UNIQUE

(D) None of the above

Ans: (C)

 

Q.10 In 2NF

(A) No functional dependencies (FDs) exist.

(B) No multivalued dependencies (MVDs) exist.

(C) No partial FDs exist.

(D) No partial MVDs exist.

Ans: (C)

 

Q.11 Which one is correct statement?

Logical data independence provides following without changing application programs:

(i) Changes in access methods.

(ii) Adding new entities in database

(iii) Splitting an existing record into two or more records

(iv) Changing storage medium

(A) (i) and (ii) (B) (iv) only, (C) (i) and (iv) (D) (ii) and (iii)

Ans: (D)

 

Q.12 In an E-R, Y is the dominant entity and X is a subordinate entity. Then which of the following is incorrect :

(A) Operationally, if Y is deleted, so is X

(B) existence is dependent on Y.

(C) Operationally, if X is deleted, so is Y.

(D) Operationally, if X is deleted, & remains the same.

Ans: (C)

 

Q.13 Relational Algebra is

(A) Data Definition Language .

(B) Meta Language

(C) Procedural query Language

(D) None of the above

Ans: (C)

 

Q.14 Which of the following aggregate functions does not ignore nulls in its results?.

(A) COUNT .

(B) COUNT (*)

(C) MAX

(D) MIN

Ans: (B)

 

Q.15 R (A,B,C,D) is a relation. Which of the following does not have a lossless join dependency preserving BCNF decomposition

(A) A->B, B->CD

(B) A->B, B->C, C->D .

(C) AB->C, C->AD

(D) A->BCD

Ans: (D)

 

Q.16 Consider the join of relation R with a relation S. If R has m tuples and S has n tuples, then the maximum and minimum size of the join respectively are

(A) m+n and 0

(B) m+n and |m-n|

(C) mn and 0

(D) mn and m+n

Ans: (C)

 

Q.17 Maximum height of a B+ tree of order m with n key values is

(A) Logm(n)

(B) (m+n)/2

(C) Logm/2(m+n)

(D) None of these

Ans: (D)

 

Q.18 Which one is true statement :

(A) With finer degree of granularity of locking a high degree of concurrency is possible.

(B) Locking prevents non – serializable schedules.

(C) Locking cannot take place at field level.

(D) An exclusive lock on data item X is granted even if a shared lock is already held on X.

Ans: (A)

 

Q.19 Which of the following statement on the view concept in SQL is invalid?

(A) All views are not updateable

(B) The views may be referenced in an SQL statement whenever tables are referenced.

(C) The views are instantiated at the time they are referenced and not when they are defined.

(D) The definition of a view should not have GROUP BY clause in it.

Ans: (D)

 

Q.20 Which of the following concurrency control schemes is not based on the serializability property?

(A) Two – phase locking

(B) Graph-based locking

(C) Time-stamp based locking

(D) None of these

Ans: (D)

 

Q.21 Which of the following is a reason to model data?

(A) Understand each user’s perspective of data

(B) Understand the data itself irrespective of the physical representation

(C) Understand the use of data across application areas

(D) All of the above

Ans: (D)

 

Q.22 If an entity can belong to only one lower level entity then the constraint is

(A) disjoint

(B) partial

(C) overlapping

(D) single

Ans: (B)

 

Q.23 The common column is eliminated in

(A) theta join

(B) outer join

(C) natural join

(D) composed join

Ans: (C )

 

Q.24 In SQL, testing whether a subquery is empty is done using

(A) DISTINCT

(B) UNIQUE

(C) NULL

(D) EXISTS

Ans: (D)

 

Q.25 Use of UNIQUE while defining an attribute of a table in SQL means that the attribute

values are

(A) distinct values

(B) cannot have NULL

(C) both (A) & (B)

(D) same as primary key

Ans: (C)

Friday, September 18, 2020

Database Systems MCQ

 Q.1 Which of the following relational algebra operations do not require the participating tables to be union-compatible?

(A) Union 

(B) Intersection

(C) Difference 

(D) Join

Ans: (D)


Q.2 Which of the following is not a property of transactions?

(A) Atomicity 

(B) Concurrency

(C) Isolation 

(D) Durability

Ans: (B)


Q.3 Relational Algebra does not have

(A) Selection operator. 

(B) Projection operator.

(C) Aggregation operators. 

(D) Division operator.

Ans: (C)


Q.4 Checkpoints are a part of

(A) Recovery measures. 

(B) Security measures.

(C) Concurrency measures. 

(D) Authorization measures.

Ans: (A)


Q.5 Tree structures are used to store data in

(A) Network model. 

(B) Relational model.

(C) Hierarchical model. 

(D) File based system.

Ans: (C)


Q.6 The language that requires a user to specify the data to be retrieved without specifying exactly how to get it is

(A) Procedural DML. 

(B) Non-Procedural DML.

(C) Procedural DDL. 

(D) Non-Procedural DDL.

Ans: (B)


Q.7 Precedence graphs help to find a

(A) Serializable schedule. 

(B) Recoverable schedule.

(C) Deadlock free schedule. 

(D) Cascadeless schedule.

Ans: (A)


Q.8 The rule that a value of a foreign key must appear as a value of some specific table is called a

(A) Referential constraint. 

(B) Index.

(C) Integrity constraint. 

(D) Functional dependency.

Ans: (A) The rule that a value of a foreign key must appear as a value of some specific table is called a referential constraint. (Referential integrity constraint is concerned with foreign key)


Q.9 The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is

(A) View 

(B) Order by

(C) Group by 

(D) Having

Ans: (B) The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is ORDER BY. (ORDER BY clause is used to arrange the result of the SELECT statement)


Q.10 What is a disjoint less constraint?

(A) It requires that an entity belongs to no more than one level entity set.

(B) The same entity may belong to more than one level.

(C) The database must contain an unmatched foreign key value.

(D) An entity can be joined with another entity in the same level entity set.

Ans: (A) Disjoint less constraint requires that an entity belongs to no more than one level entity set. (Disjoint less constraint means that an entity can be a member of at most one of the subclasses of the specialization.)


Q.11 According to the levels of abstraction, the schema at the intermediate level is called

(A) Logical schema. 

(B) Physical schema.

(C) Subschema. 

(D) Super schema.

Ans: According to the levels of abstraction, the schema at the intermediate level is called conceptual schema. (Note: All the options given in the question are wrong.)


Q.12 It is an abstraction through which relationships are treated as higher level entities

(A) Generalization. 

(B) Specialization.

(C) Aggregation. 

(D) Inheritance.

Ans: (C ) It is an abstraction through which relationships are treated as higher level entities Aggregation. (In ER diagram, aggregation is used to represent a relationship as an entity set.)


Q.13 A relation is in ____________ if an attribute of a composite key is dependent on an attribute of other composite key.

(A) 2NF 

(B) 3NF

(C) BCNF 

(D) 1NF

Ans: (B) A relation is in 3 NF if an attribute of a composite key is dependent on an attribute of other composite key. (If an attribute of a composite key is dependent on an attribute of other composite key then the relation is not in BCNF, hence it has to be decomposed.)


Q.14 What is data integrity?

(A) It is the data contained in database that is non redundant.

(B) It is the data contained in database that is accurate and consistent.

(C) It is the data contained in database that is secured.

(D) It is the data contained in database that is shared.

Ans: (B) (Data integrity means that the data must be valid according to the given constraints. Therefore, the data is accurate and consistent.)


Q.15 What are the desirable properties of a decomposition

(A) Partition constraint. 

(B) Dependency preservation.

(C) Redundancy. 

(D) Security.

Ans: (B) What are the desirable properties of a decomposition – dependency preserving. (Lossless join and dependency preserving are the two goals of the decomposition.)


Q.16 In an E-R diagram double lines indicate

(A) Total participation. 

(B) Multiple participation.

(C) Cardinality N. 

(D) None of the above.

Ans: (A)


Q.17 The operation which is not considered a basic operation of relational algebra is

(A) Join. 

(B) Selection.

(C) Union. 

(D) Cross product.

Ans: (A)


Q.18 Fifth Normal form is concerned with

(A) Functional dependency. 

(B) Multivalued dependency.

(C) Join dependency. 

(D) Domain-key.

Ans: (C)


Q.19 Block-interleaved distributed parity is RAID level

(A) 2. 

(B) 3

(C) 4. 

(D) 5.

Ans: (D)


Q.20 Immediate database modification technique uses

(A) Both undo and redo. 

(B) Undo but no redo.

(C) Redo but no undo. 

(D) Neither undo nor redo.

Ans: (A)


Q.21 In SQL the statement select * from R, S is equivalent to

(A) Select * from R natural join S. 

(B) Select * from R cross join S.

(C) Select * from R union join S. 

(D) Select * from R inner join S.

Ans: (B)


Q.22 Which of the following is not a consequence of concurrent operations?

(A) Lost update problem. 

(B) Update anomaly.

(C) Unrepeatable read. 

(D) Dirty read.

Ans: (B)


Q.23 As per equivalence rules for query transformation, selection operation distributes over

(A) Union. 

(B) Intersection.

(C) Set difference. 

(D) All of the above.

Ans: (D)


Q.24 The metadata is created by the

(A) DML compiler 

(B) DML pre-processor

(C) DDL interpreter 

(D) Query interpreter

Ans: (C)


Q.25 When an E-R diagram is mapped to tables, the representation is redundant for

(A) weak entity sets 

(B) weak relationship sets

(C) strong entity sets 

(D) strong relationship sets

Ans: (B)

Search Aptipedia