Major links



Quicklinks


📌 Quick Links
[ DBMS ] [ DDB ] [ ML ] [ DL ] [ NLP ] [ DSA ] [ PDB ] [ DWDM ] [ Quizzes ]


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

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.

☰ Quick Links - Browse Related MCQs
🚨 Quiz Instructions:
Attempt all questions first.
✔️ Click SUBMIT at the end to unlock VIEW ANSWER buttons.
Quiz Mode:

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

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.

☰ Quick Links - Browse Related MCQs
🚨 Quiz Instructions:
Attempt all questions first.
✔️ Click SUBMIT at the end to unlock VIEW ANSWER buttons.
Quiz Mode:

 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




 

 

 

Thursday, August 13, 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

  Use this ER diagram to answer the questions below;


Entity Relationship Diagram

1. While reducing the above ER diagram into schema, we will get only two conceptual schemas namely, Pilot and Plane.

(a) TRUE                                 (b) FALSE

Answer:

Option (b)

We will get three. The relationship will also be converted into separate schema as it is a many-to-many relationship.

 

2. Which of the following is correct about reduction of the given ER diagram into schema?

(a) Pilot(PID, PName, Hours_Flying, Address, Phone), Plane(Plane_ID, Operator, Source, Destination, Model), flies(PID, Plane_ID)

(b) Pilot(PID, PName, Hours_Flying, Address, Phone), Plane(Plane_ID, Operator, Source, Destination, Model), flies(PID, Plane_ID)

(c) Pilot(PID, PName, Hours_Flying, Address, Phone), Plane(Plane_ID, Operator, Source, Destination, Model, PID)

(d) Pilot(PID, PName, Hours_Flying, Address, Phone, Plane_ID), Plane(Plane_ID, Operator, Source, Destination, Model)

Answer:

Option (b).

Though option (a) looks very similar to option (b), the keys are missing in (a).

 

3. Which of the following statement(s) is/are true about the given ER diagram?

(a) A pilot flies zero or more planes

(b) Each pilot flies only one plane

(c) A plane is operated by only one pilot

(d) A plane is operated by zero or more pilots

Answer:

Options (a) and (d)

‘flies’ is a many-to-many relationship. As per the ERD, a pilot entity is related to zero or more plane entities. And, a plane entity is related to zero or more pilot entities. Hence, both options (a) and (d) are correct.

 

4. Inclusion of PID in the schema of Plane or Plane_ID in the schema of Pilot results in __________

(a) No redundancy

(b) Minimal redundancy

(c) Data redundancy

(d) None of the above

Answer:

Option (c)

If we include PID in the schema of plane, then for each plane operated by the particular pilot, the pilot id will be repeated. Also, if the plane is operated by more than one pilot, the Plane_ID, Operator, Source, Destination, and Model attribute values are repeated.

Example:

Why don’t we include the primary key of participating entity sets into one another in case if the relationship is many-to-many?

Pilot:

PID

PName

Hours_Flying

Address

Phone

P101

Kumar

1300

Chennai

0078675645

P102

Martin

200

Vellore

9011110000

Plane:

Plane_ID

Operator

Source

Destination

Model

PL_1

Jet

Chennai

New Delhi

X123

PL_3

Air India

Bengaluru

Chennai

AS10

If suppose, pilots P101 and P102 have operated plane PL_1 during some flights, then inclusion of PID into Plane will result in redundancy as follows;

Plane with PID as foreign key:

Plane_ID

Operator

Source

Destination

Model

PID

PL_1

Jet

Chennai

New Delhi

X123

P101

PL_1

Jet

Chennai

New Delhi

X123

P102

PL_3

Air India

Bengaluru

Chennai

AS10

P102

 

5. Which of among the following are true if we create a separate table for the relationship ‘flies’?

(a) PID and Plane_ID are foreign keys referencing the relations Pilot and Plane respectively

(b) PID and Plane_ID together forms the key for ‘flies’

(c) PID is the only key of ‘flies’

(d) Plane_ID is the only key of ‘flies’

Answer:

Options (a) and (b)

While we create separate table for many-to-many relationship, we include the keys of participating entity sets into the new table as foreign keys and also, all the attributes (except descriptive attribute, if any) will together form the key for the new table.

 

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

Related links:



Go back to DBMS Quizzes/MCQs page



Go to Normalization - Solved Exercises page


ER model quiz questions with answers

ER model MCQ with answers explained

Easy to understand multiple choice questions in ER model dbms

Please visit, subscribe and share 10 Minutes Lectures in Computer Science

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