Database Systems Design and Implementation
Database Systems Design and Implementation
Database Systems Design and Implementation
2. Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation
Answer: c
Explanation: For example, each person in a university is an entity.
10. 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
Explanation: Consider the entity sets student and section, which participate in a
relationship set takes. We may wish to store a descriptive attribute grade with the
relationship to record the grade that a student got in the class.
7. ______ 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
Explanation: None.
8. 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
Explanation: Primary key checks for not null and uniqueness constraint.
4. 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
Explanation: This indicates that an instructor may advise at most one student, and
a student may have at most one advisor.
5. 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
Explanation: Diamond represents a relationship set and rectangle represents a
entity set.
6. 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
Explanation: An entity set that has a primary key is termed a strong entity set.
9. 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
Explanation: An entity set is a logical container for instances of an entity type
and instances of any type derived from that entity type.
10. 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
Explanation: The environment of database is said to be an instance. A database
instance or an ‘instance’ is made up of the background processes needed by the
database.
3.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
SELECT * FROM teaches WHERE Sec_id = 'CS-101';
Which of the following Id is selected for the following query?
a) 1003
b) 1001
c) None
d) Error message appears
Answer: d
Explanation: The value CS-101 matches the Course_id but not Id.
4.
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
Explanation: Two rows are select in the above query.
5. 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
Explanation: The year ‘2009’ should be selected from the section relation.
6.
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);
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
Explanation: It should be replaced by Year Building varchar (15).
9. In the above teaches relation ” Select * from teaches where Year = ‘2010’”
displays how many rows?
a) 2
b) 4
c) 5
d) 1
Answer: a
Explanation: There are two tuples with the year is 2009.
10. The relation changes can be got back using ________ command.
a) Flashback
b) Purge
c) Delete
d) Getback
Answer: a
Explanation: Purge deletes the table and delete cleans the table entry.
3. 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
Explanation: It is possible to have several values for a single attribute provide
it is a multi-valued attribute.
4. 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
Explanation: In SQL (Structured Query Language), the term cardinality refers to the
uniqueness of data values contained in a particular column (attribute) of a
database table.
3. 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
Explanation: The design process may also proceed in a bottom-up manner, in which
multiple entity sets are synthesized into a higher-level entity set on the basis of
common features.
4. 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
Explanation: Generalization is used to emphasize the similarities among lower-level
entity sets and to hide the differences.
5. 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
Explanation: The attributes of the higher-level entity sets are said to be
inherited by the lower-level entity sets.
7. 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 _____________
a) Overlapping
b) Disjointness
c) Uniqueness
d) Relational
Answer: a
Explanation: In overlapping generalizations, the same entity may belong to more
than one lower-level entity set within a single generalization.
1. 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
Explanation: Department is the only relation which forms the main part of the
university database.
2. 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
Explanation: Department is the only relation which forms the main part of the
university database.
3. 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
Explanation: By specifying not null the value cannot be left blank.
4. 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
Explanation: References (table_name) give the prior table name for the entry.
7. 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
Explanation: The value ID can only be primary key unlike dept_name which is used as
a foreign key.
10. 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
Explanation: Droping the table drops all the references to that table.
4. 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
Explanation: The values have to be inserted into both the relations to be intact .
5. 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
Explanation: Delete from table_name where condition .
6.
SELECT DISTINCT T.name
FROM instructor AS T, instructor AS S
WHERE T.salary > S.salary AND S.dept name = ’Comp.Sci.’;
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
Explanation: Only the greatest salary in Comp.Sci dept is selected for the query.
7.
SELECT Name
FROM instructor
WHERE salary > SOME (SELECT salary FROM instructor WHERE dept_name = 'Comp.Sci.');
How many rows are selected ?
a) 3
b) 4
c) 2
d) 1
Answer: d
Explanation: This displays the names of instructors with salary greater than that
of some (at least one) instructor in the Biology department .
10. 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
Explanation: Max is used to find the highest element and Min is used to find the
lowest element
3. Consider the relation given below and ind the maximum normal form applicable to
them
i. R(A, B) WITH productions { A --> B }
ii. R(A, B) WITH productions { B --> A }
iii. R(A, B) WITH productions {A —> B, B --> A }
iv. R(A, B, C) WITH productions {A -->B, B --> A, AB --> C }
a) i, ii and iii are in 3NF and iv is in BCNF
b) i and ii are in BCNF and iii and iv are in 3NF
c) All are in 3NF
d) All are in BCNF
Answer: d
Explanation: One of the more desirable normal forms that we can obtain is Boyce–
Codd normal form (BCNF). It eliminates all redundancy that can be discovered based
on functional dependencies.
8. 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
Explanation: Meta data is generally data about a data.
9. 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
Explanation: This can be taken as a primary key.