Adds MCQs.

This commit is contained in:
Tanmay 2022-07-18 12:57:23 +01:00
parent d6c1c2c61c
commit 7f3252f436
2 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# Questions
1. Joe Bloggs is helping us build Scaler. He is trying to delete some batches but the database throws an error that the batch is used by a tuple in another table. Which type of integrity constraint is being enforced here?
>A. User-defined integrity \
B. Domain integrity \
C. Entity integrity \
D. Referential integrity
---
2. Which of the following is not an example of domain integrity constraints?
>A. Validating that input is correct data type \
B. Ensuring value is not null if a non-nullable column \
C. Making sure each row is unique \
D. Checking if the value exceeds maximum length
---
3. Joe Bloggs is taking some time off to build his house. A house can have many rooms. What is the cardinality of house to room?
>A. One to Many (1:m) \
B. One to One (1:1) \
C. Many to Many (m:n)
---
4. Let us say a house has a house_id and a room has room_id.
Given the cardinality of house to room, which is the ideal place to store their relationship i.e. reference?
>A. room_id in house \
B. Separate table for room_id and house_id \
C. Array of room_ids in house \
D. house_id in room
---
# Answers
1. D. `Referential integrity`
2. C `Making sure each row is unique`
3. A `One to Many (1:m)`
4. D `house_id in room`

View File

@ -0,0 +1,32 @@
# Questions
1. Joe Bloggs is creating a social media today. However, Joe has kept user and group information in the same table. Now whenever Joe removes a user, the group information is also gone. Which type of anomaly is this?
>A. Insertion \
B. Updation \
C. Deletion
---
2. A user has an ID, name, email and group ID. One user can only have one email and it is unique.
Which of the following dependencies is not correct?
>A. ID -> NAME \
B. EMAIL -> NAME \
C. EMAIL -> GROUP ID \
D. NAME -> GROUP ID
---
3. Joe has created a table for group members where the columns are `Group ID, User ID, Rating, Group Name`. The primary key here is `Group ID, User ID`.
Which type of functional dependency exists?
>A. No functional dependency \
B. Transitive \
C. Partial
---
4. Joe has identified that one of his tables does not satisfy 1NF constraints. Which of the following types of ERD attributes are allowed under 1NF?
>A. Composite \
B. Multivalued \
C. Derived \
D. Index
---
# Answers
1. A. `Deletion`
2. D `NAME -> GROUP ID`
3. C `Partial`
4. C `Derived`