Showing posts with label ER Model. Show all posts
Showing posts with label ER Model. Show all posts

Tuesday, September 1, 2020

Entity Relationship (ER) model quiz

ER model multiple choice questions with answers explained, simple quiz questions from ER model in database management system

Entity Relationship Model Multiple Choice Questions

1. Which of the following questions cannot be answered using the given ER model?  

entity relationship diagram

(a) What is the total number of particular product purchased by a customer?

(b) What is the price of the product which was purchased by a particular customer in a particular date?

(c) What is the total number of particular product that is ordered through a specific order number?

(d) What is the address of customer who placed more number of orders to date?

 

Answer: Option (d)

 

2. Statement A: The cardinality of a relation is the number of tuples it contains.

Statement B: The degree of a relation is the number of records it contains.

Which statement(s) is/are correct?

a) Only B

b) A and B

c) Only A

d) Neither A nor B

 

Answer: Option (c)

 

3. The file organization technique used in a table is hidden from the application programmers in the database environment. What kind of data hiding is this?

a) Conceptual level data hiding

b) Physical level data hiding

c) View level data hiding

d) External level data hiding

 

Answer: Option (b)

File organization is about how the data are organized in the database file. It is one of the physical level components in database.

 

4. “SELECT regno, name, dob FROM students WHERE gender = ‘M’”. This is NOT a type of which among the following languages.

a) Data Definition Language

b) Procedural Data Manipulation Language

c) Declarative Data Manipulation Language

d) Non-procedural Data Manipulation Language

 

Answer: Options (a) and (b)

The query given is a Data Manipulation Language (DML) query. And, SQL DMLs are non-procedural DML also called as Declarative DML.

 

5. Suppose that there are two entity sets A and B with attributes a1, a2, a3 and b1, b2, b3 respectively. Here, a1 is the key for A and b2 is the key for B. If there exists a many-to-many relationship R from A to B with an attribute r1, what would be the schema for R after converting the ER diagram into schemas?

a. R(a1, a1)

b. R(a1, b2)

c. R(a1, b1, b2)

d. R(a1, b2, r1)

 

Answer: Option (d)

While reducing many-to-many relationship into relation schema, we create a separate table with the primary keys of participating entity sets as the attributes along with descriptive attributes if any. In this question, r1 is the descriptive attribute.

 

***************

Related links:



Go back to DBMS Quizzes/MCQs page



Go to Normalization - Solved Exercises page



 


 

 

Friday, August 14, 2020

Entity Relationship Model (ER model) Quiz Questions with solutions

 ER model solved quiz, Entity relationship model into conceptual schema solved quiz, ERD solved exercises

Entity Relationship Model - Quiz Questions

 

Entity Relationship Diagram

 Figure 1: for questions 1 to 3

1. What are the relation schemas that we get when we reduce the ERD in Figure 1?

(a) Teacher(ERP, Name, Qualification, Address, Phone); Subject(Sub_ID, Sub_Name, Syllabus, Medium); Teaches(ERP, Sub_ID)

(b) Teacher(ERP, Name, Qualification, Address, Phone, Sub_ID); Subject(Sub_ID, Sub_Name, Syllabus, Medium)

(c) Teacher(ERP, Name, Qualification, Address, Phone); Subject(Sub_ID, Sub_Name, Syllabus, Medium, ERP)

(d) Teacher(ERP, Name, Qualification, Address, Phone, Sub_ID); Subject(Sub_ID, Sub_Name, Syllabus, Medium, ERP)

 

Answer:

Option (c)

Relationship ‘Teaches’ is a one-to-many relationship from Teacher to Subject. As per the ERD reduction rule, the primary key of one side relation (Teacher) will be included as the foreign key in the many side relation (Subject).

 

2. Let us suppose that we have 1000 subject entities and 400 teacher entities. What would be the number of records in Subject relation after the reduction of ERD in figure 1 to relation schemas?

(a) 1000

(b) 400

(c) 1400

(d) 600

 

Answer:

Option (a)

The number of records in either subject or teacher won’t change in one-to-many relationship due to reduction of ERD.

 

3. Let us suppose that we have 1000 subject entities and 400 teacher entities. What would be the number of records in Subject relation after the reduction of ERD in figure 1 to relation schemas and two more new teachers added to the teacher entity?

(a) 1000

(b) 1002

(c) 400

(d) 402

 

Answer:

Option (a)

Addition of records will change the count only in the added entity set for one-to-many relationship.

 

Figure 2: to answer questions 4 to 6

 

4. In ER diagram of figure 2, what are ‘Date’ and ‘Hours’ attributes called?

(a) Relational attributes

(b) Descriptive attributes

(c) Derived attributes

(d) Additional attributes

 

Answer:

Option (b)

Attributes attached to the relationship set is called descriptive attributes. They are usually added in many-to-many relationship if we need to define the relationship with more clarity.

 

5. Reduction of ERD in figure 2 will lead to following relation schemas.

(a) EMP(Emp_ID, EName, Department, Address, Street, City, Gender); PRJ(PName, Country, Client, Cost); Handles(Emp_ID, PName, Date, Hours)

(b) EMP(Emp_ID, EName, Department, Address, Gender); PRJ(PName, Country, Client, Cost); Handles(Emp_ID, PName)

(c) EMP(Emp_ID, EName, Department, Address, Gender, PName); PRJ(PName, Country, Client, Cost, Emp_ID); Handles(Date, Hours)

(d) EMP(Emp_ID, EName, Department, Street, City, Gender); PRJ(PName, Country, Client, Cost); Handles(Emp_ID, PName, Date, Hours)

 

Answer:

Option (d)

In ERD of figure 2, ‘address’ (of entity set EMP) is a composite attribute which will be including component attributes (street and city) only after reduction.

Also, ‘Handles’ is a many-to-many relationship with descriptive attributes. The conversion of this relationship will include the primary keys of participating entity sets as foreign keys along with descriptive attributes if any.

 

6. If we have 300 and 200 entities in EMP and PRJ entity sets respectively, what would be the maximum number of entities the Handle relationship set would have?

(a) 300

(b) 200

(c) 500

(d) 60000

 

Answer:

Option (d)

Many-to-many relationship will have all possible combinations of entities from participating entity sets. If m and n are the number of entities in participating entity sets, then the maximum number in relationship set will be m*n.

 

*************************

Related links:



Go back to DBMS Quizzes/MCQs page



Go to Normalization - Solved Exercises page




 

 

 

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents