Showing posts with label Database Quizzes. Show all posts
Showing posts with label Database Quizzes. Show all posts

Monday, 23 July 2018

Relational model in DBMS Multiple choice questions with answers

Relational model in DBMS Multiple choice questions with answers

Multiple Choice Questions 30:

1. Which one of the following is correct?
a) Each candidate key is a primary key
b) Each primary key is a foreign key
c) Each foreign key must refer a primary key of a relation.
d) Each foreign key refers a candidate key in a relation.
Answer:
d) Each foreign key refers a candidate key in a relation.
Foreign key attribute refers attribute that contains unique values. It need not be the primary key always.

2. The value of an attribute in a table may be NULL because,
a) the value is not known
b) the value does not exist
c) the value is not applicable
d) all of the above
Answer:
d) all of the above.
NULL refers to all the options a, b, and c.

3. Consider a relation office with the following schema;
Office(Cabin_no, Room_no, Phone)
Room number is unique. Each room consists of approximately 20 cabins and each cabin number is unique with respect to room number. The same cabin number may be used in different rooms. Each room has unique phone number.
Which of the following is correct?
a) Room_no is a candidate key
b) Phone is a candidate key
c) (Cabin_no, Phone) and (Cabin_no, Room_no) are the candidate keys.
d) (Room_no, Phone) and (Room_no, Cabin_no) are the candidate keys.
Answer:
c) (Cabin_no, Phone) and (Cabin_no, Room_no) are the candidate keys.
Room_no is unique and each room has 20 cabins hence, retrieving data with Room_no as key will end up in at least 20 records. The same is applicable for Phone.
Cabin_no is unique for each room[or phone]. So, (cabin_no, phone) or (cabin_no, room_no) can uniquely identify records.

4. Consider the following schema of relation R;
R (A, B, C)
Attributes A, B, and C are all unique valued attributes. Which of the following is TRUE for R?
a) A is a candidate key for R
b) B is a candidate key for R
c) (A, C) is a super key for R
d) all of the above
Answer:
d) all of the above
As all attributes are unique valued attributes, each one of them is a candidate key on its own. Also, the combination of candidate keys cannot form another candidate key but a super key.

5. Which of the following is usually chosen as a primary key for a relation.
a) A candidate key that is composite
b) A super key
c) A candidate key that is minimal
d) All of the above
Answer:
c) A candidate key that is minimal
A candidate key that is composite can also be chosen as primary key. But in practice people usually prefers a minimal candidate key, that is, a candidate key that has minimal number of attributes. For example, if in a relation R(A, B, C), A is a candidate key and (B,C) is another candidate key we prefer A as the primary key though (B, C) can also act as a primary key.

***********


 

Go to Advanced DBMS Concepts page




multiple choice questions in relational model of DBMS
MCQs in relational model
MCQ about super key, candidate key and primary key
relational data model in database
solved quiz questions with answer in relational model
 

Wednesday, 25 April 2018

Structured Query Language MCQ interview TRUE/FALSE questions

Structured Query Language MCQ interview TRUE/FALSE questions 

Structured Query Language MCQ interview questions - TRUE / FALSE questions


1. We cannot use HAVING clause without GROUP BY clause in SQL.
    TRUE
    FALSE

2. There are often multiple ways of writing an SQL query in relational algebra.
    TRUE
    FALSE

3. One weakness of triggers is that they can only be activated after an update/insert/delete, not before.
    TRUE
    FALSE

4. Relational algebra was invented to formalize the underlying operations of the SQL language.
    TRUE
    FALSE

5. As a query language, SQL is more declarative than relational algebra.
    TRUE
    FALSE

6. An attribute declared as UNIQUE can have NULL as its value.
    TRUE
    FALSE

7. MODIFY TABLE is one of the data defnition language commands in SQL.
    TRUE
    FALSE

8. SQL domains (created using CREATE DOMAIN) are user-defined data types.
    TRUE
    FALSE

9. The information about "Who is authorized to access the table" cannot be included in the CREATE TABLE command in SQL.
    TRUE
    FALSE

10. It is not possible to use WHERE clause and then use GROUP BY clause in the same query.
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page


Go to DBMS MCQ for Engineering Students home page


Go to Solved Exercises in DBMS page



Score =

Correct answers:



dbms quiz SQL model quiz structured query language quiz database management systems mcq for interviews SQL MCQ for interviews SQL true or false questions for engineering students DBMS mcq with answers for university students

Database management system data storage and access MCQ for engineering students

Database management system data storage and access MCQ for engineering students

Database management system data storage and access MCQ for engineering students - TRUE / FALSE questions


1. The second and higher levels must be sparse in an index of multiple levels on sequential files.
    TRUE
    FALSE

2. Hash index is efficient in answering range queries, such as finding studetns with age between 18 and 21.
    TRUE
    FALSE

3. The order of insertions into a B+ tree will affect the tree's final structure at the end.
    TRUE
    FALSE

4. Disk seek time and data transfer time are the only two components needed to access a page on disk.
    TRUE
    FALSE

5. Dynamic hash tables support range queries.
    TRUE
    FALSE

6. Query optimization is a major concept that enables declarative SQL queries, because it automatically generates query plans, without having users to write procedural queries.
    TRUE
    FALSE

7. Pointer swizzling refers to the techniques that convert disk pointers to memory addresses.
    TRUE
    FALSE

8. For buffer management, a policy like LRU may be inefficient for transaction processing in RDBMS, but it will not affect correctness.
    TRUE
    FALSE

9. For disk latency, seek time refers to the time for the head to find the desired sector– i.e., for the disk to rotate so the first of the sectors containing the desired data reaches the head.
    TRUE
    FALSE

10. Seek time is part of the disk latency time.
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page


Go to DBMS MCQ for Engineering Students home page



Score =

Correct answers:



dbms quiz entity relationship model quiz disk storage and access in dbms quiz database management systems mcq for interviews define rotational latency, seek time, data transfer time data accessibility in dbms quiz DBMS mcq with answers for university students

Saturday, 31 March 2018

database management systems interview questions 1

General Quiz in DBMS - TRUE / FALSE questions


1. Any candidate key of a relation is a super key for that relation.
    TRUE
    FALSE

2. All attributes of a relation together form a super key for the relation.
    TRUE
    FALSE

3. A relation decomposition is not always lossless.
    TRUE
    FALSE

4. One weakness of triggers is that they can only be activated for insertion and update operations case, while "bag semantics" requires additional work.
    TRUE
    FALSE

5. The default policy for the foreign-key constraint sets the value of a foreign-key to null when the tuple of its referenced attribute gets deleted.
    TRUE
    FALSE

6. Join is one of the ve basic operation in relational algebra.
    TRUE
    FALSE

7. In a relation R(X, Y, Z, T), if XY --> Y Z then X --> Z.
    TRUE
    FALSE

8. The primary key of a relation may contain a NULL value as a value for their components.
    TRUE
    FALSE

9. Every isa relation in the ER model is one-one.
    TRUE
    FALSE

10. If a relation R is in 3NF, R is also in BCNF.
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page

Score =

Correct answers:
dbms quiz entity relationship model quiz normalization quiz ER multiple choice questions Normalization MCQ

Monday, 26 March 2018

DBMS general quiz and interview questions 4

General Quiz in DBMS - TRUE / FALSE questions


1. Logical and physical addresses are both representations for the database address.
    TRUE
    FALSE

2. Secondary indexes are always dense.
    TRUE
    FALSE

3. In B-trees, we sometimes need to have overflow blocks.
    TRUE
    FALSE

4. Dynamic hash tables support range queries. case, while "bag semantics" requires additional work.
    TRUE
    FALSE

5. Dynamic programming is a bottom-up method, where we consider only the best plan for each subexpression of the logical-query plan.
    TRUE
    FALSE

6. In undo logging, it is not always possible to recover some consistent state of a database system if the system crashes during recovery.
    TRUE
    FALSE

7. Two-phase locking prevents deadlocks.
    TRUE
    FALSE

8. Concurrency control by timestamps is superior to that by locks if most transactions are read-only.
    TRUE
    FALSE

9. In fixed-length records, a character field of type CHAR is NOT allowed.
    TRUE
    FALSE

10. Hash index is efficient in answering range queries, such as "finding products with price higher than 100".
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page



Score =

Correct answers:

Saturday, 24 March 2018

DBMS general quiz 3

General Quiz in DBMS - TRUE / FALSE questions


1. Triggers can operate on insertion, deletion, and updates.
    TRUE
    FALSE

2. A user application executes a database Trigger by invoking “RUN TRIGGER triggername”.
    TRUE
    FALSE

3. Secondary storage is volatile.
    TRUE
    FALSE

4. Seek time is part of the disk latency time. case, while "bag semantics" requires additional work.
    TRUE
    FALSE

5. When an index is clustered it requires that the data records are sorted in the search key order of the index.
    TRUE
    FALSE

6. B+ trees can include duplicate keys.
    TRUE
    FALSE

7. When a sparse index is used, each record must have an entry in the index.
    TRUE
    FALSE

8. In fixed-length records, a character field of type CHAR is NOT allowed.
    TRUE
    FALSE

9. Spanned records refer to records that are longer than blocks and therefore are broken into fragments.
    TRUE
    FALSE

10. In SQL, without GROUP BY, we cannot use HAVING.
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page


Go to DBMS online quizzes page



dbms quiz to solve, database quiz with answers, try and score in database quiz, true or false questions in dbms, interview questions in dbms
Score =

Correct answers:

Wednesday, 21 March 2018

True or False questions in DBMS with answers

General Quiz in DBMS


1. An extensible hash table always squares the number of buckets when it has to grow.
    TRUE
    FALSE

2. A Cartesian product of two relations is the same as their union. TRUE/FALSE.
    TRUE
    FALSE

3. Selection is a "tuple at a time" operation, while Union is a "full relation" operation.
    TRUE
    FALSE

4. From the perspective of query processing, "set semantics" of a union operation is the easy case, while "bag semantics" requires additional work.
    TRUE
    FALSE

5. In two pass algorithms based on hashing, for binary operations, all tuples that need to be considered together in the operation are in a pair of buckets with the same hash value.
    TRUE
    FALSE

6. According to dependency theory, it is always bad if a relation has more than one key.
    TRUE
    FALSE

7. "Pushing selections down" refers to the choice of processing selections "early" during query optimization, which is often advantageous because it means fewer tuples need to be manipulated in later steps.
    TRUE
    FALSE

8. If your schema is in 3NF but not in 4NF, then you probably need to revise it.
    TRUE
    FALSE

9. Among the "ACID" properties of a good database system, the "I" stands for "inexpensive".
    TRUE
    FALSE

10. In Redo logging, OUTPUTs are done "early", i.e., before commit.
    TRUE
    FALSE

Go to TRUE/FALSE general quizzes page


Go to DBMS MCQ for Engineering Students home page


Go to Solved Exercises in DBMS page



Score =

Correct answers:

General quiz questions in DBMS

Multiple choice questions 20 in DBMS

General Quiz in DBMS


1. A mathematical definition of a relationship (as in an E/R model) is: if A and B are sets, then a relationship R is a subset of the set A U B.
    TRUE
    FALSE

2. There is no formal way to specify multiple keys in an E/R diagram.
    TRUE
    FALSE

3. A "weak entity set" is not an entity set, it is a special type of relationship between two entity sets.
    TRUE
    FALSE

4. Let's say you examined all the tuples in a relation at a particular time, and found that no two tuples have the same value for a particular attribute A. You can designate A to be a key for the relation.
    TRUE
    FALSE

5. SQL allows you to not only create a new table, but also to delete an existing table from the database.
    TRUE
    FALSE

6. In translating subclass entity sets into the relational model, the "use nulls approach" creates the fewest relations.
    TRUE
    FALSE

7. In relational algebra, the schema of R1 - R2 includes the attributes of R1 that are not attributes of R2.
    TRUE
    FALSE

8. A Theta-join is a Cartesian product operation followed by a projection operation.
    TRUE
    FALSE

9. Schema refinement using the 3rd Normal Form is lossless (avoids information loss).
    TRUE
    FALSE

10. A clustered index is one where each data record has an entry in the index, while in an unclustered index, only some records have an entry.
    TRUE
    FALSE

Score =

Correct answers:
Go back to GENERAL QUIZ in DBMS PAGE

Tuesday, 20 September 2016

Multiple Choices Questions in DBMS

Advanced concepts in DBMS

Multiple choices questions in DBMS / MCQ in DBMS / Solved multiple choice questions in DBMS / MCQ on all areas of Database Management Systems



TOPICS

  • Database Systems - Introduction
  • Entity-Relationship Model (ER model)
  • Structured Query Language (SQL)

Thursday, 3 March 2016

Normal forms and normalization MCQ

Multiple choice questions with answers explained on the concepts Normal forms and normalization, Normalization quiz with answers



Quiz


1. Carefully observe the relational schema given below, and select one of the following that would violate the 2NF property?
Student (Register_No, Name, Phone, Branch, Course_No, Course_Name)
(a) Register_No, Name
(b) Course_No, Course_Name
(c) Register_No, Phone
(d) Phone, Branch
Why? – It is very evident that course_name is dependent on attribute course_no, and register_no, course_no would be the primary key for this relation. Hence, course_name shows partial dependency. But, no partial dependency is permitted for a relation to be in 2NF.

2. The rule that a value of a foreign key must appear as a value of some specific table is
called a ______
(a) Referential integrity
(b) Entity integrity
(c) Unique integrity
(d) Dependent integrity
Why? – For referential integrity to hold in a relational database, any field in a table that is declared a foreign key can contain either a null value, or only values from a parent table’s referenced columns (primary key or candidate keys). In other words, when a foreign key value is used it must reference a valid, existing primary key in the parent table.

3. For a relation R with schema R (A, B, C, D), let us assume that A is the primary key. And, R consists of the set of functional dependencies F = {A B, A → C, AB → C, C D}. Which of the following would violate the 3NF rule?
(a) AB → C
(b) C D
(c) A → BCD
(d) None of the above
Why? – 3NF – “no non-key attribute should depend on another non-key attribute” (i.e, no Transitive dependency). In this question, a non-key attribute D is fully functionally dependent on another non-key attribute C. Hence, it violates 3NF.

4. For a relation R (A, B, C, D), we assume that the key is (A, B), a composite key. With this information, we would say which of the following is TRUE for R.
(a) R may be in 2NF
(b) R may be in 3NF
(c) R may be in BCNF
(d) Not enough information
Why? – The only information given is the primary key of the table. And the primary is a composite key. Hence, we would say that the table can be in 2NF. We need the set of functional dependencies for deciding further.

5. Consider a relation R (A, B, C) with F = {A B, C B}. Assume that we decompose R into R1 (A, B) and R2 (A, C). Which of the following is TRUE for this case?
(a) R1 and R2 are in BCNF
(b) Dependency preserving decomposition
(c) R1 and R2 are in 3NF
(d) All of the above
Why? – If we have a relation with just two attributes we cannot look for partial key dependency, non-key dependency, or multiple candidate keys. Hence, the relation is in 3NF and BCNF.
The decomposition given above is not dependency preserving decomposition. Because, the decomposition results in elimination of C B.










SQL exercises for beginners one

SQL Exercises for Beginners / Simple SQL Exercises with Answers / Solved SQL exercises / SQL solved exercises with simple conditions / So...