MCQ D

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

lOMoARcPSD|36090799

Question bank [moderate]

Database Concepts (Assiut University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Hager khaled kh ([email protected])
lOMoARcPSD|36090799

An ________ is a set of entities of the same type that share the same properties, or
attributes.
a) Entity set
b) Attribute set
c) Relation set
d) Entity model

Answer: a
Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation

Answer: c
The descriptive property possessed by each entity set is _________
a) Entity
b) Attribute
c) Relation
d) Model

Answer: b
The function that an entity plays in a relationship is called that entity’s _____________
a) Participation
b) Position
c) Role
d) Instance

Answer: c
The attribute name could be structured as an attribute consisting of first name, middle initial,
and last name. This type of attribute is called
a) Simple attribute
b) Composite attribute
c) Multivalued attribute
d) Derived attribute

Answer: b
The attribute AGE is calculated from DATE_OF_BIRTH. The attribute AGE is
a) Single valued
b) Multi valued
c) Composite
d) Derived

Answer: d

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

Not applicable condition can be represented in relation entry as


a) NA
b) 0
c) NULL
d) Blank Space

Answer: c
Which of the following can be a multivalued attribute?
a) Phone_number
b) Name
c) Date_of_birth
d) All of the mentioned

Answer: a
Which of the following is a single valued attribute
a) Register_number
b) Address
c) SUBJECT_TAKEN
d) Reference

Answer: a
In a relation between the entities the type and condition of the relation should be specified.
That is called as______attribute.
a) Desciptive
b) Derived
c) Recursive
d) Relative

Answer: a
_____________ express the number of entities to which another entity can be associated
via a relationship set.
a) Mapping Cardinality
b) Relational Cardinality
c) Participation Constraints
d) None of the mentioned

Answer: a
An entity in A is associated with at most one entity in B, and an entity in B is associated with
at most one entity in A.This is called as
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one

Answer: b

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

An entity in A is associated with at most one entity in B. An entity in B, however, can be


associated with any number (zero or more) of entities in A.
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one

Answer: d
Data integrity constraints are used to:
a) Control who is allowed access to the data
b) Ensure that duplicate records are not entered into the table
c) Improve the quality of data entered for a specific property
d) Prevent users from changing the values stored in the table

Answer: c
Establishing limits on allowable property values, and specifying a set of acceptable,
predefined options that can be assigned to a property are examples of:
a) Attributes
b) Data integrity constraints
c) Method constraints
d) Referential integrity constraints

Answer: b
Which of the following can be addressed by enforcing a referential integrity constraint?
a) All phone numbers must include the area code
b) Certain fields are required (such as the email address, or phone number) before the
record is accepted
c) Information on the customer must be known before anything can be sold to that customer
d) Then entering an order quantity, the user must input a number and not some text (i.e., 12
rather than ‘a dozen’)

Answer: c
______ is a special type of integrity constraint that relates two relations & maintains
consistency across the relations.
a) Entity Integrity Constraints
b) Referential Integrity Constraints
c) Domain Integrity Constraints
d) Domain Constraints

Answer: b

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

Which one of the following uniquely identifies the elements in the relation?
a) Secondary Key
b) Primary key
c) Foreign key
d) Composite key

Answer: b
Drop Table cannot be used to drop a table referenced by a _________ constraint.
a) Local Key
b) Primary Key
c) Composite Key
d) Foreign Key

Answer: d
____________ is preferred method for enforcing data integrity
a) Constraints
b) Stored Procedure
c) Triggers
d) Cursors

Answer: a

Which of the following gives a logical structure of the database graphically?


a) Entity-relationship diagram
b) Entity diagram
c) Database diagram
d) Architectural representation

Answer: a
. The entity relationship set is represented in E-R diagram as
a) Double diamonds
b) Undivided rectangles
c) Dashed lines
d) Diamond

Answer: d
The Rectangles divided into two parts represents
a) Entity set
b) Relationship set
c) Attributes of a relationship set
d) Primary key

Answer: a

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

Consider a directed line(->) from the relationship set advisor to both entity sets instructor
and student. This indicates _________ cardinality
a) One to many
b) One to one
c) Many to many
d) Many to one

Answer: b
We indicate roles in E-R diagrams by labeling the lines that connect ___________ to
__________
a) Diamond , diamond
b) Rectangle, diamond
c) Rectangle, rectangle
d) Diamond, rectangle

Answer: d
An entity set that does not have sufficient attributes to form a primary key is termed a
__________
a) Strong entity set
b) Variant set
c) Weak entity set
d) Variable set

Answer: c
For a weak entity set to be meaningful, it must be associated with another entity set, called
the
a) Identifying set
b) Owner set
c) Neighbour set
d) Strong entity set

Answer: a
Weak entity set is represented as
a) Underline
b) Double line
c) Double diamond
d) Double rectangle

Answer: c

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

If you were collecting and storing information about your music collection, an album would
be considered a(n) _____
a) Relation
b) Entity
c) Instance
d) Attribute

Answer: b
What term is used to refer to a specific record in your music database; for instance;
information stored about a specific album?
a) Relation
b) Instance
c) Table
d) Column

Answer: b

The section relation


Course_id Sec_id Semester Year

BIO-101 1 Spring 2010

CS-102 4 Summer 2009

EE-201 3 Fall 2010

FIN-301 1 Spring 2011

The teaches relation


Id Course_id Sec_id Semester

1001 CS-101 1 Fall

1002 EE-201 2 Spring

1003 FIN-301 3 Fall

1004 BIO-101 1 Summer

Which one of the following can be treated as a primary key in teaches relation?
a) Id

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

b) Semester
c) Sec_id
d) Year

Answer: a
The primary key in the section relation is
a) Course_id
b) Sec_id
c) Both Course_id and Sec_id
d) All the attributes

Answer: c

Which of the following Id is selected for the following query?


a) 1003
b) 1001
c) None
d) Error message appears

Answer: d
SELECT Id, Course_id, Building FROM SECTION s AND teaches t WHERE t.year=2009;

Which of the following Id are displayed?


a) 1003
b) 1001
c) Both 1003 and 1001
d) Error message appears

Answer: c
The query which selects the Course_id ‘CS-101’ from the section relation is
a) Select Course_id from section where Building = ‘Richard’;
b) Select Course_id from section where Year = ‘2009’;
c) Select Course_id from teaches where Building = ‘Packyard’;
d) Select Course_id from section where Sec_id = ‘3’;

Answer: b
CREATE TABLE SECTION
(Course_id VARCHAR (8),
Sec_id VARCHAR (8),
Semester VARCHAR (6),
YEAR NUMERIC (4,0),
Building NUMERIC (15),
PRIMARY KEY (course id, sec id, semester, YEAR),
FOREIGN KEY (course id) REFERENCES course);

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

Which of the following has an error in the above create table for the relation
section
a) Primary key (course id, sec id, semester, year)
b) Foreign key (course id) references course
c) Year numeric (4,0)
d) Building numeric (15)

Answer: d
The relation with primary key can be created using
a) Create table instructor (Id, Name)
b) Create table instructor (Id, Name, primary key(name))
c) Create table instructor (Id, Name, primary key (Id))
d) Create table instructor ( Id unique, Name )

Answer: c
How can the values in the relation teaches be deleted?
a) Drop table teaches;
b) Delete from teaches;
c) Purge table teaches;
d) Delete from teaches where Id =’Null’;

Answer: b
In the above teaches relation ” Select * from teaches where Year = ‘2010’”
displays how many rows?
a) 2
b) 4
c) 5
d) 1

Answer: d

The relation changes can be got back using ________ command


a) Flashback
b) Purge
c) Delete
d) Getback

Answer: a
Let us consider phone_number ,which can take single or several values .
Treating phone_numberas an _________ permits instructors to have several phone
numbers (including zero) associated with them.
a) Entity
b) Attribute

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

c) Relation
d) Value

Answer: a
The total participation by entities is represented in E-R diagram as
a) Dashed line
b) Double line
c) Double rectangle
d) Circle

Answer: b
Given the basic ER and relational models, which of the following is INCORRECT?
a) An attribute of an entity can have more than one value
b) An attribute of an entity can be composite
c) In a row of a relational table, an attribute can have more than one value
d) In a row of a relational table, an attribute can have exactly one value or a
NULL value

Answer: c
Which of the following indicates the maximum number of entities that can be
involved in a relationship?
a) Minimum cardinality
b) Maximum cardinality
c) ERD
d) Greater Entity Count

Answer: b
In E-R diagram generalization is represented by
a) Ellipse
b) Dashed ellipse
c) Rectangle
d) Triangle

Answer: d
What is a relationship called when it is maintained between two entities?
a) Unary
b) Binary
c) Ternary
d) Quaternary

Answer: b
Which of the following is a low level operator?
a) Insert
b) Update

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

c) Delete
d) Directory

Answer: d
Key to represent relationship between tables is called
a) Primary key
b) Secondary Key
c) Foreign Key
d) None of the mentioned

Answer: c
A window into a portion of a database is
a) Schema
b) View
c) Query
d) Data dictionary

Answer: b

A primary key is combined with a foreign key creates


a) Parent-Child relation ship between the tables that connect them
b) Many to many relationship between the tables that connect them
c) Network model between the tables that connect them
d) None of the mentioned

Answer: a

The entity set person is classified as student and employee. This process is
called _________
a) Generalization
b) Specialization
c) Inheritance
d) Constraint generalization

Answer: b
Which relationship is used to represent a specialization entity?
a) ISA
b) AIS
c) ONIS
d) WHOIS

Answer: a

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

The refinement from an initial entity set into successive levels of entity
subgroupings represents a ________ design process in which distinctions are
made explicit.
a) Hierarchy
b) Bottom-up
c) Top-down
d) Radical

Answer: c

There are similarities between the instructor entity set and the secretary entity
set in the sense that they have several attributes that are conceptually the
same across the two entity sets: namely, the identifier, name, and salary
attributes. This process is called
a) Commonality
b) Specialization
c) Generalization
d) Similarity

Answer: c
If an entity set is a lower-level entity set in more than one ISA relationship, then
the entity set has
a) Hierarchy
b) Multilevel inheritance
c) Single inheritance
d) Multiple inheritance

Answer: d
A _____________ constraint requires that an entity belong to no more than one
lower-level entity set.
a) Disjointness
b) Uniqueness
c) Special
d) Relational

Answer: a
Consider the employee work-team example, and assume that certain employees
participate in more than one work team. A given employee may therefore
appear in more than one of the team entity sets that are lower level entity sets
of employee. Thus, the generalization is _____________

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

a) Overlapping
b) Disjointness
c) Uniqueness
d) Relational

Answer: a
The completeness constraint may be one of the following: Total generalization or
specialization, Partial generalization or specialization. Which is the default?
a) Total
b) Partial
c) Should be specified
d) Cannot be determined

Answer: b
Functional dependencies are a generalization of
a) Key dependencies
b) Relation dependencies
c) Database dependencies
d) None of the mentioned

Answer: a
Which of the following is another name for a weak entity?
a) Child
b) Owner
c) Dominant
d) All of the mentioned

Answer: a
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));

CREATE TABLE course


(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name) __________ department);

CREATE TABLE instructor


(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name) _______ department);

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

CREATE TABLE SECTION


(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
room_number VARCHAR (7),
time_slot id VARCHAR (4),
PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______) ______ course);

CREATE TABLE teaches


(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR) REFERENCES SECTION,
FOREIGN KEY (ID) _______ instructor);

Which is the main relation which is used in the university database which is
referenced by all other relation of the university?
a) Teaches
b) Course
c) Department
d) Section

Answer: c
The department relation has the an entry budget whose type has to be replaced
by
a) Varchar (20)
b) Varchar2 (20)
c) Numeric (12,2)
d) Numeric

Answer: c
In the course relation, the title field should throw an error in case of any missing
title. The command to be added in title is
a) Unique
b) Not null
c) 0
d) Null

Answer: b

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

In the above DDL command the foreign key entries are got by using the keyword
a) References
b) Key reference
c) Relating
d) None of the mentioned

Answer: a
Identify the error in the section relation
a) No error
b) Year numeric (4,0)
c) Building varchar (15)
d) Sec_id varchar (8)

Answer: a
The following entry is given in to the instructor relation .

(100202,Drake,Biology,30000)

Identify the output of the query given


a) Row(s) inserted
b) Error in ID of insert
c) Error in Name of insert
d) Error in Salary of the insert

Answer: b
Which of the following can be used as a primary key entry of the instructor
relation.
a) DEPT_NAME
b) NAME
c) ID
d) All of the mentioned

Answer: c
In the section relation which of the following is used as a foreign key?
a) Course_id
b) Course_id,sec_id
c) Room_number
d) Course_id,sec_id,room_number

Answer: a
In order to include an attribute Name to the teaches relation which of the
following command is used?
a) Alter table teaches include Name;
b) Alter table teaches add Name;
c) Alter table teaches add Name varchar;

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

d) Alter table teaches add Name varchar(20);

Answer: d
To replace the relation section with some other relation the initial step to be
carried out is
a) Delete section;
b) Drop section;
c) Delete from section;
d) Replace section new_table ;

Answer: b

The instructor relation


ID Name Dept_name

10101 Hayley Comp.Sci.

12121 Jackson Finance

15151 Nathan Music

22222 April Biology

34345 Crick Comp.Sci.


The course relation
Course_id Title Dept_na

CS-101 Robotics Comp.Sc

BIO-244 Genetics Biology

PHY-333 Physical Principles Physics

MUS-562 Music Video Production Music

FIN-101 Investment Banking Finance

Which of the following command is used to display the departments of the


instructor relation?
a) Select * from instructor where Dept_name = Finance;
b) Select * from instructor ;
c) Select dept_name from instructor;

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

d) Select dept_name for instructor where Name=Jackson;

Answer: c
Select distinct Dept_name from instructor ;
How many row(s) are displayed ?
a) 4
b) 3
c) 5
d) Error

Answer: a
Suppose the Authority want to include a new instructor for the title
Neuroscience what command should be inserted ?
a) Insert into instructor values(12111,Emma,NeuroScience,200000);
b) Insert into course values(12111,Introduction,NeuroScience,2);
c)

Insert into instructor values(12111,Emma,Biology,200000);

Insert into course values(BIO-112,Introduction to Neuro


Science,NeuroScience,2);

d) Insert into course values(12111,Emma,NeuroScience,200000);

Answer: c
If a person all the people in Music department gets fired which of the following
has to be performed on the instructor relation ?
a) Delete Dept_name=Music in instructor;
b) Delete from instructor where Dept_name=Music;
c) Remove Dept_name= Music
d) All of the mentioned

Answer: b
What will be displayed as the value of name for the above query?
a) Hayley
b) Jackson
c) Hayley and Crick
d) Crick

Answer: d
SELECT Name
FROM instructor
WHERE salary > SOME (SELECT salary FROM instructor WHERE dept_name =
'Comp.Sci.');

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

How many rows are selected ?


a) 3
b) 4
c) 2
d) 1

Answer: d
How will you select the Names whose first letter is E ?
a)

SELECT Name
FROM instructor
WHERE Name LIKE ’A%;

b)

SELECT Name
FROM course
WHERE Name LIKE ’A%;

c)

SELECT Dept_name
FROM instructor
WHERE Name LIKE ’A%;

d)

SELECT Name
FROM instructor
WHERE Dept_name LIKE ’A%;

Answer: a
Which function is used to find the count of distinct departments?
a) Dist
b) Distinct
c) Count
d) Count,Dist

Answer: a
Which function is used to identify the title with Least scope?
a) Min(Credits)
b) Max(Credits)
c) Min(title)
d) Min(Salary)

Answer: a

Downloaded by Hager khaled kh ([email protected])


lOMoARcPSD|36090799

A domain is ______ if elements of the domain are considered to be indivisible


units.
a) Atomic
b) Subatomic
c) Substructure
d) Subset

Answer: a
Identify the composite attributes
a) Salary
b) Credits
c) Section_id
d) None of the mentioned

Answer: d
Which one is based on multi-valued dependency:
a) First
b) Second
c) Third
d) Fourth

Answer: d
The term for information that describes what type of data is available in a
database is:
a) Data dictionary
b) data repository
c) Index data
d) Metadata

Answer: d
A data type that creates unique numbers for key columns in Microsoft Access is:
a) Autonumber
b) Boolean
c) Sequential key
d) Sequential number

Answer: a

Downloaded by Hager khaled kh ([email protected])

You might also like