DB Question
DB Question
1. Poor data administration can lead to which of the following? | Database
Administration Mcqs
A. A single definition of the same data entity
B. Familiarity with existing data
C. Missing data elements
D. All of the above.
Answer: C
8. A shared lock allows which of the following types of transactions to occur?
| Database Administration Mcqs
A. Delete B. Insert
C. Read D. Update
Answer: C
11. Which of the following is the preferred way to recover a database after a
transaction in progress terminates abnormally? | Database Administration Mcqs
A. Rollback
B. Rollforward
C. Switch to duplicate database
D. Reprocess transactions
Answer: A
18. Authorization tables contain highly sensitive data and should be protected by
stringent security rules. | Database Administration Mcqs
A. True
B. False
Answer: A
19. A transaction log shows before and after images of records that have been
modified by transactions. | Database Administration Mcqs
A. True
B. False
Answer: B
20. The greatest threat to business security is often internal rather than
external. | Database Administration Mcqs
A. True
B. False
Answer: A
23. Databases are not the property of a single function or individual within the
organization.
A. True
B. False
Answer: A
27. A disaster recovery plan does not need to include the shipment of
database backups to other sites.
A. True
B. False
Answer: B
A. True
B. False
Answer: B
29. Data modeling and database design are key responsibilities of data and
data base administration.
A. True
B. False
Answer: A
Database Questions and Answers – Relational Query Operations and Relational Operators
« Prev
Next »
This set of Database MCQs focuses on “Relational Query Operations and Relational Operators”.
Answer: a
Explanation: Query language is a method through which the database entries can be accessed.
Answer: d
Explanation: The attributes name, dept and tot_cred can have same values unlike ID.
Answer: c
Explanation: Domain and Tuple relational calculus are non-procedural language. Query language is a
method through which database entries can be accessed.
4. The_____ operation allows the combining of two relations by merging pairs of tuples, one from each
relation, into a single tuple.
a) Select
b) Join
c) Union
d) Intersection
View Answer
Answer: b
Explanation: Join finds the common tuple in the relations and combines it.
5. The result which operation contains all pairs of tuples from the two relations, regardless of whether
their attribute values match.
a) Join
b) Cartesian product
c) Intersection
d) Set difference
View Answer
Answer: b
Explanation: Cartesian product is the multiplication of all the values in the attributes.
Answer: a
Explanation: Union just combines all the values of relations of same attributes.
7. The most commonly used operation in relational algebra for projecting a set of tuple from a relation is
a) Join
b) Projection
c) Select
d) Union
View Answer
Answer: c
Explanation: Select is used to view the tuples of the relation with or without some constraints.
8. The _______ operator takes the results of two queries and returns only rows that appear in both
result sets.
a) Union
b) Intersect
c) Difference
d) Projection
View Answer
Answer: b
Explanation: The union operator gives the result which is the union of two queries and difference is the
one where query which is not a part of second query.
9. A ________ is a pictorial depiction of the schema of a database that shows the relations in the
database, their attributes, and primary keys and foreign keys.
a) Schema diagram
b) Relational algebra
c) Database diagram
d) Schema flow
View Answer
Answer: a
Explanation: None.
10. The _________ provides a set of operations that take one or more relations as input and return a
relation as an output.
a) Schematic representation
b) Relational algebra
c) Scheme diagram
d) Relation flow
View Answer
Answer: b
Explanation: None.
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Relational Database and
Database Schema”.
Answer: a
Explanation: Fields are the column of the relation or tables. Records are each row in a relation. Keys are
the constraints in a relation.
Answer: c
Explanation: Column has only one set of values. Keys are constraints and row is one whole set of
attributes. Entry is just a piece of data.
Answer: b
Explanation: Tuple is one entry of the relation with several attributes which are fields.
4. The term attribute refers to a ___________ of a table.
a) Record
b) Column
c) Tuple
d) Key
View Answer
Answer: b
Explanation: Attribute is a specific domain in the relation which has entries of all tuples.
5. For each attribute of a relation, there is a set of permitted values, called the ________ of that
attribute.
a) Domain
b) Relation
c) Set
d) Schema
View Answer
Answer: a
Explanation: The values of the attribute should be present in the domain. Domain is a set of values
permitted.
6. Database __________ which is the logical design of the database, and the database _______ which is
a snapshot of the data in the database at a given instant in time.
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
View Answer
Answer: d
Explanation: Instance is an instance of time and schema is a representation.
7. Course(course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
View Answer
Answer: b
Explanation: The relation course has a set of attributes course_id,sec_id,semester .
8. Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)
Here the dept_name attribute appears in both the relations. Here using common attributes in relation
schema is one way of relating ___________ relations.
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
View Answer
Answer: c
Explanation: Here the relations are connected by the common attributes.
Answer: b
Explanation: None.
Answer: a
Explanation: The values only count. The order of the tuples does not matter.
Database Questions and Answers – SQL Basics and SQL Data Definition
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL Basics and SQL Data
Definition”.
1. Which one of the following is used to define the structure of the relation, deleting relations and
relating schemas?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer
Answer: b
Explanation: Data Definition language is the language which performs all the operation in defining
structure of relation.
2. Which one of the following provides the ability to query information from the database and to insert
tuples into, delete tuples from, and modify tuples in the database?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer
Answer: a
Explanation: DML performs the change in the values of the relation.
3.
Answer: b
Explanation: Data Definition language is the language which performs all the operation in defining
structure of relation.
4.
Answer: a
Explanation: Select operation just shows the required fields of the relation. So it forms a DML.
5. The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.
a) Fixed, equal
b) Equal, variable
c) Fixed, variable
d) Variable, equal
View Answer
Answer: c
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be
filled by either letters or spaces.
6. An attribute A of datatype varchar(20) has the value “Avi”. The attribute B of datatype char(20) has
value ”Reed”. Here attribute A has ____ spaces and attribute B has ____ spaces.
a) 3, 20
b) 20, 4
c) 20, 20
d) 3, 4
View Answer
Answer: a
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be
filled by either letters or spaces.
Answer: d
Explanation: Drop table deletes the whole structure of the relation .purge removes the table which
cannot be obtained again.
8.
Answer: b
Explanation: Delete command removes the entries in the table.
9.
Answer: b
Explanation: The values are manipulated. So it is a DML.
Answer: a
Explanation: Integrity constraint has to be maintained in the entries of the relation.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL Queries”.
1.
Name
Annie
Bob
Callie
Derek
Which of these query will display the the table given above ?
a) Select employee from name
b) Select name
c) Select name from employee
d) Select employee
View Answer
Answer: c
Explanation: The field to be displayed is included in select and the table is included in the from clause.
2. Here which of the following displays the unique values of the column?
FROM instructor;
a) All
b) From
c) Distinct
d) Name
View Answer
Answer: c
Explanation: Distinct keyword selects only the entries that are unique.
3. The ______ clause allows us to select only those rows in the result relation of the ____ clause that
satisfy a specified predicate.
a) Where, from
b) From, select
c) Select, from
d) From, where
View Answer
Answer: a
Explanation: Where selects the rows on a particular condition. From gives the relation which involves
the operation.
4. The query given below will not give an error. Which one of the following has to be replaced to get the
desired output?
WHERE instructor;
a) Salary*1.1
b) ID
c) Where
d) Instructor
View Answer
Answer: c
Explanation: Where selects the rows on a particular condition. From gives the relation which involves
the operation. Since Instructor is a relation it has to have from clause.
5. The ________ clause is used to list the attributes desired in the result of a query.
a) Where
b) Select
c) From
d) Distinct
View Answer
Answer: b
Explanation: None
7.
Answer: d
Explanation: Here * is used to select all the fields of the relation.
8.
Answer: d
Explanation: Greater than symbol does not include the given value unlike >=.
Answer: d
Explanation: This query do not have from clause which specifies the relation from which the values has
to be selected.
a) Table
b) Values
c) Relation
d) Field
View Answer
Answer: b
Explanation: Value keyword has to be used to insert the values into the table.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Basic SQL Operations”.
1.
Answer: c
Explanation: As keyword is used to rename.
2.
Answer: c
Explanation: For any string operations single quoted(‘) must be used to enclose.
3.
SELECT emp_name
FROM department
Which one of the following has to be added into the blank to select the dept_name which has Computer
Science as its ending string?
a) %
b) _
c) ||
d) $
View Answer
Answer: a
Explanation: The % character matches any substring.
4. ’_ _ _ ’ matches any string of ______ three characters. ’_ _ _ %’ matches any string of at ______ three
characters.
a) Atleast, Exactly
b) Exactly, Atleast
c) Atleast, All
d) All, Exactly
View Answer
Answer: b
Explanation: None.
5.
SELECT name
FROM instructor
ORDER BY name;
Answer: d
Explanation: Specification of descending order is essential but it not for ascending.
6.
SELECT *
FROM instructor
To display the salary from greater to smaller and name in ascending order which of the following options
should be used?
a) Ascending, Descending
b) Asc, Desc
c) Desc, Asc
d) Descending, Ascending
View Answer
Answer: c
Explanation: None.
7.
SELECT name
FROM instructor
FROM instructor
b)
SELECT name
FROM employee
c)
SELECT name
FROM employee
d)
SELECT name
FROM instructor
View Answer
Answer: a
Explanation: SQL includes a between comparison operator to simplify where clauses that specify that a
value be less than or equal to some value and greater than or equal to some other value.
8.
SELECT instructor.*
Answer: b
Explanation: The asterisk symbol “ * ” can be usedin the select clause to denote “all attributes.”
9. In SQL the spaces at the end of the string are removed by _______ function.
a) Upper
b) String
c) Trim
d) Lower
View Answer
Answer: c
Explanation: The syntax of trim is Trim(s); where s-string.
Answer: c
Explanation: || is the concatenation operator.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Set Operations”.
Answer: b
Explanation: Intersection operator ignores unique tuples and takes only common ones.
Answer: d
Explanation: None.
Answer: a
Explanation: Union all will combine all the tuples including duplicates.
5.
(SELECT course id
FROM SECTION
EXCEPT
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);
Answer: d
Explanation: Except keyword is used to ignore the values.
a) i-only
b) ii-only
c) i & ii
d) None of the mentioned
View Answer
Answer: a
Explanation:% is used with like and _ is used to fill in the character.
Answer: b
Explanation: None.
Answer: b
Explanation: It is optional to give the inner keyword with the join as it is default.
10. The _____________ is essentially used to search for patterns in target string.
a) Like Predicate
b) Null Predicate
c) In Predicate
d) Out Predicate
View Answer
Answer: a
Explanation: Like predicate matches the string in the given pattern.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Null Values Operations”.
1. A _____ indicates an absent value that may exist but be unknown or that may not exist at all.
a) Empty tuple
b) New value
c) Null value
d) Old value
View Answer
Answer: c
Explanation: None.
2. If the attribute phone number is included in the relation all the values need not be entered into the
phone number column. This type of entry is given as
a) 0
b) –
c) Null
d) Empty space
View Answer
Answer: c
Explanation: Null is used to represent the absence of a value.
3. The predicate in a where clause can involve Boolean operations such as and. The result of true and
unknown is_______ false and unknown is _____ while unknown and unknown is _____
a) Unknown, unknown, false
b) True, false, unknown
c) True, unknown, unknown
d) Unknown, false, unknown
View Answer
Answer: d
Explanation: None.
4.
SELECT name
FROM instructor
Selects
Answer: b
Explanation: Not null constraint removes the tpules of null values.
5. In an employee table to include the attributes whose value always have some value which of the
following constraint must be used?
a) Null
b) Not null
c) Unique
d) Distinct
View Answer
Answer: b
Explanation: Not null constraint removes the tuples of null values.
6. Using the ______ clause retains only one copy of such identical tuples.
a) Null
b) Unique
c) Not null
d) Distinct
View Answer
Answer: d
Explanation: Unique is a constraint.
7.
Some of these insert statements will produce an error. Identify the statement.
a) Insert into employee values (1005,Rach,0);
b) Insert into employee values (1002,Joey,335);
c) Insert into employee values (1007,Ross, );
d) None of the mentioned
View Answer
Answer: c
Explanation: Not null constraint is specified which means sone value (can include 0 also) should be
given.
Answer: c
Explanation: Primary key must satisfy unique and not null condition for sure.
FROM inventory;
Why does this statement cause an error when QUANTITY values are null?
a) The expression attempts to divide by a null value
b) The data types in the conversion function are incompatible
c) The character string none should be enclosed in single quotes (‘ ‘)
d) A null value used in an expression cannot be converted to an actual value
View Answer
Answer: a
Explanation: The expression attempts to divide by a null value is erroneous in sql.
Answer: d
Explanation: Since unknown does not hold any value the value cannot have a reverse value.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Aggregate Functions and
Nested Subqueries – 1”.
1. Aggregate functions are functions that take a ___________ as input and return a single value.
a) Collection of values
b) Single value
c) Aggregate value
d) Both Collection of values & Single value
View Answer
Answer: a
Explanation: None.
2.
SELECT __________
FROM instructor
Which of the following should be used to find the mean of the salary ?
a) Mean(salary)
b) Avg(salary)
c) Sum(salary)
d) Count(salary)
View Answer
Answer: b
Explanation: Avg() is used to find the mean of the values.
3.
FROM teaches
If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.
a) Distinct
b) Count
c) Avg
d) Primary key
View Answer
Answer: a
Explanation: Distinct keyword is used to select only unique items from the relation.
4. All aggregate functions except _____ ignore null values in their input collection.
a) Count(attribute)
b) Count(*)
c) Avg
d) Sum
View Answer
Answer: b
Explanation: * is used to select all values including null.
5. A Boolean data type that can take values true, false, and________
a) 1
b) 0
c) Null
d) Unknown
View Answer
Answer: d
Explanation: Unknown values do not take null value but it is not known.
6. The ____ connective tests for set membership, where the set is a collection of values produced by a
select clause. The ____ connective tests for the absence of set membership.
a) Or, in
b) Not in, in
c) In, not in
d) In, or
View Answer
Answer: c
Explanation: In checks, if the query has the value but not in checks if it does not have the value.
7. Which of the following should be used to find all the courses taught in the Fall 2009 semester but not
in the Spring 2010 semester .
a)
FROM SECTION
FROM SECTION
b)
FROM instructor
c)
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)
d)
FROM takes
WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
FROM teaches
View Answer
Answer: a
Explanation: None.
Answer: d
Explanation: >some takes atlest one value above it .
9. Which of the following is used to find all courses taught in both the Fall 2009 semester and in the
Spring 2010 semester .
a)
SELECT course id
FROM SECTION AS S
EXISTS (SELECT *
FROM SECTION AS T
b)
SELECT name
FROM instructor
FROM instructor
c)
FROM takes
WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
FROM teaches
d)
(SELECT course id
FROM SECTION
View Answer
Answer: a
Explanation: None.
10. We can test for the nonexistence of tuples in a subquery by using the _____ construct.
a) Not exist
b) Not exists
c) Exists
d) Exist
View Answer
Answer: b
Explanation: Exists is used to check for the existence of tuples.
« Prev
Next »
This set of Database Interview Questions and Answers focuses on “Aggregate Functions and Nested
Subqueries – 2”.
1.
FROM instructor
GROUP BY dept_name;
Answer: b
Explanation: Any attribute that is not present in the group by clause must appear only inside an
aggregate function if it appears in the select clause, otherwise the query is treated as erroneous.
2. SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions
may be used.
a) Group by
b) With
c) Where
d) Having
View Answer
Answer: b
Explanation: The with clause provides away of defining a temporary relation whose definition is
available only to the query in which the with clause occurs.
3. Aggregate functions can be used in the select list or the_______clause of a select statement or
subquery. They cannot be used in a ______ clause.
a) Where, having
b) Having, where
c) Group by, having
d) Group by, where
View Answer
Answer: b
Explanation: To include aggregate functions having clause must be included after where.
4. The ________ keyword is used to access attributes of preceding tables or subqueries in the from
clause.
a) In
b) Lateral
c) Having
d) With
View Answer
Answer: b
Explanation:
FROM instructor I2
Without the lateral clause, the subquery cannot access the correlation variable
I1 from the outer query.
5. Which of the following creates a temporary relation for the query on which it is defined?
a) With
b) From
c) Where
d) Select
View Answer
Answer: a
Explanation: The with clause provides a way of defining a temporary relation whose definition is
available only to the query in which the with clause occurs.
6.
FROM department)
SELECT budget
In the query given above which one of the following is a temporary relation?
a) Budget
b) Department
c) Value
d) Max_budget
View Answer
Answer: d
Explanation: With clause creates a temporary relation.
7. Subqueries cannot:
a) Use group by or group functions
b) Retrieve data from a table different from the one in the outer query
c) Join tables
d) Appear in select, update, delete, insert statements.
View Answer
Answer: c
Explanation: None.
Answer: c
Explanation: With is used to create temporary relation and its not an aggregate function.
Answer: a
Explanation: EXISTS keyword checks for existance of a condition.
10. How can you find rows that do not match some specified condition?
a) EXISTS
b) Double use of NOT EXISTS
c) NOT EXISTS
d) None of the mentioned
View Answer
Answer: b
Explanation: None.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Modification of
Database”.
Answer: a
Explanation: Delete can delete from only one table at a time.
2.
3. Which one of the following deletes all the entries but keeps the structure of the relation.
a) Delete from r where P;
b) Delete from instructor where dept name= ’Finance’;
c) Delete from instructor where salary between 13000 and 15000;
d) Delete from instructor;
View Answer
Answer: d
Explanation: Absence of condition deletes all rows.
b)
FROM student
c)
INSERT INTO course VALUES (’CS-437’, ’DATABASE Systems’, ’Comp. Sci.’, 4);
d) Not possible
View Answer
Answer: b
Explanation: Using select statement in insert will include rows which are the result of the selection.
5. Which of the following deletes all tuples in the instructor relation for those instructors associated with
a department located in the Watson building which is in department relation.
a)
WHERE building='Watson';
c)
FROM department
Answer: c
Explanation: The query must include building=watson condition to filter the tuples.
6.
UPDATE instructor
Answer: b
Explanation: Set is used to update the particular value.
7. _________ are useful in SQL update statements, where they can be used in the set clause.
a) Multiple queries
b) Sub queries
c) Update
d) Scalar subqueries
View Answer
Answer: d
Explanation: None.
8. The problem of ordering the update in multiple updates is avoided using
a) Set
b) Where
c) Case
d) When
View Answer
Answer: c
Explanation: The case statements can add the order of updating tuples.
CASE
...
ELSE result0
END
b)
CASE
...
ELSE result0
END
c)
CASE
...
ELSE result0
Answer: b
Explanation: None.
10. Which of the following relation updates all instructors with salary over $100,000 receive a 3 percent
raise, whereas all others receive a 5 percent raise.
a)
UPDATE instructor
UPDATE instructor
b)
UPDATE instructor
FROM instructor);
c)
UPDATE instructor
Answer: a
Explanation: The order of the two update statements is important. If we changed the order of the two
statements, an instructor with a salary just under $100,000 would receive an over 8 percent raise. SQL
provides a case construct that we can use to perform both the updates with a single update statement,
avoiding the problem with the order of updates.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Join Expressions”.
Answer: a
Explanation: On gives the condition for the join expression.
Answer: c
Explanation: INNER JOIN: Returns all rows when there is at least one match in BOTH tables.
3.
SELECT *
SELECT *
b)
SELECT *
c)
SELECT *
Answer: a
Explanation: Join can be replaced by inner join.
4. What type of join is needed when you wish to include rows that do not have matching values?
a) Equi-join
b) Natural join
c) Outer join
d) All of the mentioned
View Answer
Answer: c
Explanation: An outer join does not require each record in the two joined tables to have a matching
record..
Answer: d
Explanation: Join can combine multiple tables.
6. Which are the join types in join condition:
a) Cross join
b) Natural join
c) Join with USING clause
d) All of the mentioned
View Answer
Answer: d
Explanation: There are totally four join types in SQL.
Answer: d
Explanation: Types are inner join, left outer join, right outer join, full join, cross join.
8. Which join refers to join records from the right table that have no matching key in the left table are
include in the result set:
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
View Answer
Answer: b
Explanation: RIGHT OUTER JOIN: Return all rows from the right table and the matched rows from the left
table.
Answer: a
Explanation: None.
Answer: b
Explanation: None.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Views”.
1. Which of the following creates a virtual relation for storing the query?
a) Function
b) View
c) Procedure
d) None of the mentioned
View Answer
Answer: b
Explanation: Any such relation that is not part of the logical model, but is made visible to a user as a
virtual relation, is called a view.
2. Which of the following is the syntax for views where v is view name?
a) Create view v as “query name”;
b) Create “query expression” as view;
c) Create view v as “query expression”;
d) Create view “query expression”;
View Answer
Answer: c
Explanation: <query expression> is any legal query expression. The view name is represented by v.
3.
SELECT course_id
FROM physics_fall_2009
Answer: c
Explanation: View names may appear in a query any place where a relation name may appear.
Answer: b
Explanation: None.
Answer: a
Explanation: None.
6. SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on the view) if
which of the following conditions are satisfied by the query defining the view?
a) The from clause has only one database relation
b) The query does not have a group by or having clause
c) The select clause contains only attribute names of the relation and does not have any expressions,
aggregates, or distinct specification
d) All of the mentioned
View Answer
Answer: d
Explanation: All of the conditions must be satisfied to update the view in sql.
7. Which of the following is used at the end of the view to reject the tuples which do not satisfy the
condition in where clause?
a) With
b) Check
c) With check
d) All of the mentioned
View Answer
Answer: c
Explanation: Views can be defined with a with check option clause at the end of the view definition;
then, if a tuple inserted into the view does not satisfy the view’s where clause condition, the insertion is
rejected by the database system.
Department:
Which of the following is used to create view for these relations together?
a)
c)
FROM instructor;
d)
FROM department;
View Answer
Answer: a
Explanation: None.
If we insert tuple into the view as insert into instructor info values (’69987’, ’White’, ’Taylor’);
What will be the values of the other attributes in instructor and department relations?
a) Default value
b) Null
c) Error statement
d) 0
View Answer
Answer: b
Explanation: The values take null if there is no constraint in the attribute else it is an Erroneous
statement.
10.
FROM instructor;
Answer: d
Explanation: Syntax is – create view v as <query expression>;.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Transactions”.
Answer: a
Explanation: Transaction is a set of operation until commit.
Answer: b
Explanation: Commit work commits the current transaction.
3. In order to undo the work of transaction after last commit which one should be used?
a) View
b) Commit
c) Rollback
d) Flashback
View Answer
Answer: c
Explanation: Rollback work causes the current transaction to be rolled back; that is, it undoes all the
updates performed by the SQL statements in the transaction.
TRANSACTION.....
Commit;
ROLLBACK;
Answer: d
Explanation: Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.
5. In case of any shut down during transaction before commit which of the following statement is done
automatically?
a) View
b) Commit
c) Rollback
d) Flashback
View Answer
Answer: c
Explanation: Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.
Answer: b
Explanation: By atomic, either all the effects of the transaction are reflected in the database, or none are
(after rollback).
Answer: a
Explanation: None.
Answer: a
Explanation: A complete transaction always commits.
9. Which of the following is used to get back all the transactions back after rollback?
a) Commit
b) Rollback
c) Flashback
d) Redo
View Answer
Answer: c
Explanation: None.
10. ______ will undo all statements up to commit?
a) Transaction
b) Flashback
c) Rollback
d) Abort
View Answer
Answer: c
Explanation: Flashback will undo all the statements and Abort will terminate the operation.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Integrity Constraints”.
Answer: c
Explanation: SYNTAX – alter table table-name add constraint, where constraint can be any constraint on
the relation.
3.
Answer: d
Explanation: The not null specification prohibits the insertion of a null value for the attribute.
The unique specification says that no two tuples in the relation can be equal on all the listed attributes.
4.
Inorder to ensure that the value of budget is non-negative which of the following should be used?
a) Check(budget>0)
b) Check(budget<0)
c) Alter(budget>0)
d) Alter(budget<0)
View Answer
Answer: a
Explanation: A common use of the check clause is to ensure that attribute values satisfy specified
conditions, in effect creating a powerful type system.
5. Foreign key is the one in which the ________ of one relation is referenced in another relation.
a) Foreign key
b) Primary key
c) References
d) Check constraint
View Answer
Answer: b
Explanation: The foreign-key declaration specifies that for each course tuple, the department name
specified in the tuple must exist in the department relation.
6.
(...
. . . );
Which of the following is used to delete the entries in the referenced table when the tuple is deleted in
course table?
a) Delete
b) Delete cascade
c) Set null
d) All of the mentioned
View Answer
Answer: b
Explanation: The delete “cascades” to the course relation, deletes the tuple that refers to the
department that was deleted.
7. Domain constraints, functional dependency and referential integrity are special forms of _________
a) Foreign key
b) Primary key
c) Assertion
d) Referential constraint
View Answer
Answer: c
Explanation: An assertion is a predicate expressing a condition we wish the database to always satisfy.
Answer: a
Explanation: None.
9. 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 (i.e., table column)
d) Prevent users from changing the values stored in the table
View Answer
Answer: c
Explanation: None.
10. 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) When entering an order quantity, the user must input a number and not some text (i.e., 12 rather
than ‘a dozen’)
View Answer
Answer: c
Explanation: The information can be referred to and obtained.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Authorizations”.
1. The database administrator who authorizes all the new users, modifies the database and takes grants
privilege is
a) Super user
b) Administrator
c) Operator of operating system
d) All of the mentioned
View Answer
Answer: d
Explanation: The authorizations provided by the administrator to the user is a privilege.
TO 'user/role list';
b)
ON 'user/role list'
c)
TO 'user/role list'
d)
ON 'user/role list';
View Answer
Answer: a
Explanation: The privilege list allows the granting of several privileges in one command .
Answer: b
Explanation: This grant statement gives user Raj update authorization on the budget attribute of the
department relation.
4. Which of the following statement is used to remove the privilege from the user Amir?
a) Remove update on department from Amir
b) Revoke update on employee from Amir
c) Delete select on department from Raj
d) Grant update on employee from Amir
View Answer
Answer: b
Explanation: revoke on from ;
b)
TO instructor;
c)
TO instructor;
Answer: c
Explanation: The role is first created and the authorization is given on relation takes to the role.
Answer: c
Explanation: A user who creates a view does not necessarily receive all privileges on that view.
7. If we wish to grant a privilege and to allow the recipient to pass the privilege on to other users, we
append the __________ clause to the appropriate grant command.
a) With grant
b) Grant user
c) Grant pass privelege
d) With grant option
View Answer
Answer: d
Explanation: None.
8. In authorization graph, if DBA provides authorization to u1 which inturn gives to u2 which of the
following is correct?
a) If DBA revokes authorization from u1 then u2 authorization is also revoked
b) If u1 revokes authorization from u2 then u2 authorization is revoked
c) If DBA & u1 revokes authorization from u1 then u2 authorization is also revoked
d) If u2 revokes authorization then u1 authorization is revoked
View Answer
Answer: c
Explanation: A user has an authorization if and only if there is a path from the root of the authorization
graph down to the node representing the user.
9. Which of the following is used to avoid cascading of authorizations from the user?
a) Granted by current role
b) Revoke select on department from Amit, Satoshi restrict;
c) Revoke grant option for select on department from Amit;
d) Revoke select on department from Amit, Satoshi cascade;
View Answer
Answer: b
Explanation: The revoke statement may specify restrict in order to prevent cascading revocation. The
keyword cascade can be used instead of restrict to indicate that revocation should cascade.
10. The granting and revoking of roles by the user may cause some confusions when that user role is
revoked. To overcome the above situation
a) The privilege must be granted only by roles
b) The privilege is granted by roles and users
c) The user role cannot be removed once given
d) By restricting the user access to the roles
View Answer
Answer: a
Explanation: The current role associated with a session can be set by executing set role name. The
specified role must have been granted to the user, else the set role statement fails.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers focuses on “Access SQL From a Programming
Language”.
1. Which of the following is used to access the database server at the time of executing the program and
get the data from the server accordingly?
a) Embedded SQL
b) Dynamic SQL
c) SQL declarations
d) SQL data analysis
View Answer
Answer: b
Explanation: Embedded SQL, the SQL statements are identified at compile time using a preprocessor.
The preprocessor submits the SQL statements to the database system for precompilation and
optimization; then it replaces the SQL statements in the application program with appropriate code and
function calls before invoking the programming-language compiler.
2. Which of the following header must be included in java program to establish database connectivity
using JDBC ?
a) Import java.sql.*;
b) Import java.sql.odbc.jdbc.*;
c) Import java.jdbc.*;
d) Import java.sql.jdbc.*;
View Answer
Answer: a
Explanation: The Java program must import java.sql.*, which contains the interface definitions for the
functionality provided by JDBC.
Answer: b
Explanation: The database must be opened first in order to perform any operations for which this get
connection method is used.
Answer: c
Explanation: JDBC provides a Callable Statement interface that allows invocation of SQL stored
procedures and functions.
5. Which of the following function is used to find the column count of the particular resultset?
a) getMetaData()
b) Metadata()
c) getColumn()
d) get Count()
View Answer
Answer: a
Explanation: The interface ResultSet
has a method, getMetaData(), that returns a ResultSetMetaData object that contains metadata about
the result set. ResultSetMetaData, in turn, has methods to find metadata information, such as the
number of columns in the result, the name of a specified column, or the type of a specified column.
Answer: a
Explanation:? is used as a placeholder whose value can be provided later.
7. Which of the following is used as the embedded SQL in COBOL?
a) EXEC SQL <embedded SQL statement >;
b) EXEC SQL <embedded SQL statement > END-EXEC
c) EXEC SQL <embedded SQL statement >
d) EXEC SQL <embedded SQL statement > END EXEC;
View Answer
Answer: b
Explanation: EXEC SQL <embedded SQL statement >; is normally in C.
8. Which of the following is used to distinguish the variables in SQL from the host language variables?
a) .
b) –
c) :
d) ,
View Answer
Answer: b
Explanation:
EXEC SQL
FROM student
EXEC SQL
UPDATE instructor
WHERE CURRENT OF c;
10. Which of the following is used to access large objects from a database ?
a) setBlob()
b) getBlob()
c) getClob()
d) all of the mentioned
View Answer
Answer: d
Explanation: None.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Functions and
Procedures”.
1.
begin
from instructor
return d count;
end
Answer: a
Explanation: Return integer should be given after create function for this particular function.
2. For the function created in Question 1, which of the following is a proper select statement ?
a)
FROM instructor
b)
FROM instructor
c)
d)
FROM instructor
View Answer
Answer: b
Explanation: The count of the dept_name must be checked for the displaying from instructor relation.
3. Which of the following is used to input the entry and give the result in a variable in a procedure?
a) Put and get
b) Get and put
c) Out and In
d) In and out
View Answer
Answer: d
Explanation: Create procedure dept count proc(in dept name varchar(20), out d count integer). Here in
and out refers to input and result of procedure.
4.
begin
from instructor
end
b)
c)
d)
Declare d_count;
View Answer
Answer: b
Explanation: Here the ‘Physics’ is in variable and d_count is out variable.
Answer: d
Explanation: A compound statement is of the form begin . . . end, and it may contain multiple SQL
statements between the begin and the end.A compound statement of the form begin atomic . . . end
ensures that all the statements contained within it are executed as a single transaction.
6.
Repeat
sequence of statements;
__________________
end repeat
Answer: c
Explanation: None.
If boolean expression
end if
b)
If boolean expression
end if
c)
If boolean expression
end if
d)
If boolean expression
else
end if
View Answer
Answer: a
Explanation: The conditional statements supported by SQL include if-then-else statements by using this
syntax. elif and elsif are not allowed.
Answer: b
Explanation: If it an atomic statement then the statements are in single transaction.
Answer: d
Explanation: None.
BEGIN
SEQUENCE OF statements
END
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Triggers”.
1. A __________ is a special kind of a store procedure that executes in response to certain action on the
table like insertion, deletion or updation of data.
a) Procedures
b) Triggers
c) Functions
d) None of the mentioned
View Answer
Answer: b
Explanation: Triggers are automatically generated when a particular operation takes place.
Answer: c
Explanation: The triggers run after an insert, update or delete on a table. They are not supported for
views.
3. The CREATE TRIGGER statement is used to create the trigger. THE _____ clause specifies the table
name on which the trigger is to be attached. The ______ specifies that this is an AFTER INSERT trigger.
a) for insert, on
b) On, for insert
c) For, insert
d) None of the mentioned
View Answer
Answer: b
Explanation: The triggers run after an insert, update or delete on a table. They are not supported for
views.
4. What are the after triggers?
a) Triggers generated after a particular operation
b) These triggers run after an insert, update or delete on a table
c) These triggers run after an insert, views, update or delete on a table
d) All of the mentioned
View Answer
Answer: b
Explanation: AFTER TRIGGERS can be classified further into three types as: AFTER INSERT Trigger, AFTER
UPDATE Trigger, AFTER DELETE Trigger.
Answer: b
Explanation: Example : declare @empid int; where empid is the variable.
Answer: d
Explanation: Example :None.
Answer: b
Explanation: Example: During trigger is not possible in any database.
Answer: c
Explanation: Triggers are not possible for create, drop.
Answer: a
Explanation: Triggers can be manipulated.
Answer: c
Explanation: None.
« Prev
Next »
This set of Database Quiz focuses on “Recursive Queries and Aggregation Features”.
1. Any recursive view must be defined as the union of two subqueries: a _______ query that is
nonrecursive and a __________ query.
a) Base, recursive
b) Recursive, Base
c) Base, Redundant
d) View, Base
View Answer
Answer: a
Explanation: First compute the base query and add all the resultant tuples to the recursively defined
view relation.
Answer: b
Explanation: Order by clause arranges the values in ascending or descending order where a default is
ascending order.
Answer: b
Explanation: Example. rank() over (order by (GPA) desc).
4. The __________ function that does not create gaps in the ordering.
a) Intense_rank()
b) Continue_rank()
c) Default_rank()
d) Dense_rank()
View Answer
Answer: d
Explanation: For dense_rank() the tuples with the second highest value all get rank 2, and tuples with
the third highest value get rank 3, and so on.
5.
ORDER BY GPA
____________;
Inorder to give only 10 rank on the whole we should use
a) Limit 10
b) Upto 10
c) Only 10
d) Max 10
View Answer
6. If there are n tuples in the partition and the rank of the tuple is r, then its ________ is defined as (r
−1)/(n−1).
a) Ntil()
b) Cum_rank
c) Percent_rank
d) rank()
View Answer
Answer: c
Explanation: Percent rank of a tuple gives the rank of the tuple as a fraction.
7. Inorder to simplify the null value confusion in the rank function we can specify
a) Not Null
b) Nulls last
c) Nulls first
d) Either Nulls last or first
View Answer
Answer: d
Explanation: select ID, rank () over (order by GPA desc nulls last) as s rank from student grades;.
8. Suppose we are given a view tot credits (year, num credits) giving the total number of credits taken by
students in each year. The query that computes averages over the 3 preceding tuples in the specified
sort order is
a)
b)
Answer: a
Explanation: Suppose that instead of going back a fixed number of tuples, we want the window to
consist of all prior years we use rows unbounded preceding.
9. The functions which construct histograms and use buckets for ranking is
a) Rank()
b) Newtil()
c) Ntil()
d) None of the mentioned
View Answer
Answer: c
Explanation: For each tuple, ntile(n) then gives the number of the bucket in which it is placed, with
bucket numbers starting with 1.
10. The command ________________ such tables are available only within the transaction executing the
query and are dropped when the transaction finishes.
a) Create table
b) Create temporary table
c) Create view
d) Create label view
View Answer
Answer: b
Explanation: None.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “OLAP”.
Answer: a
Explanation: OLAP is the manipulation of information to support decision making.
2. Data that can be modeled as dimension attributes and measure attributes are called _______ data.
a) Multidimensional
b) Singledimensional
c) Measured
d) Dimensional
View Answer
Answer: a
Explanation: Given a relation used for data analysis, we can identify some of its attributes as measure
attributes, since they measure some value, and can be aggregated upon.Dimension attribute define the
dimensions on which measure attributes, and summaries of measure attributes, are viewed.
3. The generalization of cross-tab which is represented visually is ____________ which is also called as
data cube.
a) Two dimensional cube
b) Multidimensional cube
c) N-dimensional cube
d) Cuboid
View Answer
Answer: a
Explanation: Each cell in the cube is identified for the values for the three dimensional attributes.
4. The process of viewing the cross-tab (Single dimensional) with a fixed value of one attribute is
a) Slicing
b) Dicing
c) Pivoting
d) Both Slicing and Dicing
View Answer
Answer: a
Explanation: The slice operation selects one particular dimension from a given cube and provides a new
sub-cube. Dice selects two or more dimensions from a given cube and provides a new sub-cube.
5. The operation of moving from finer-granularity data to a coarser granularity (by means of
aggregation) is called a ________
a) Rollup
b) Drill down
c) Dicing
d) Pivoting
View Answer
Answer: a
Explanation: The opposite operation—that of moving fromcoarser-granularity data to finer-granularity
data—is called a drill down.
Answer: a
Explanation: Pivot (sum(quantity) for color in (’dark’,’pastel’,’white’)).
7.
{ (item name, color, clothes size), (item name, color), (item name, clothes size), (color, clothes size),
(item name), (color), (clothes size), () }
Answer: d
Explanation: ‘Group by cube’ is used .
Answer: a
Explanation: None.
9.
FROM sales
Answer: b
Explanation: { (item name, color, clothes size), (item name, color), (item name), () }.
10. Which one of the following is the right syntax for DECODE?
a) DECODE (search, expression, result [, search, result]… [, default])
b) DECODE (expression, result [, search, result]… [, default], search)
c) DECODE (search, result [, search, result]… [, default], expression)
d) DECODE (expression, search, result [, search, result]… [, default])
View Answer
Answer: d
Explanation: None.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Relational Algebra”.
1. Relational Algebra is a __________ query language that takes two relations as input and produces
another relation as an output of the query.
a) Relational
b) Structural
c) Procedural
d) Fundamental
View Answer
Answer: c
Explanation: This language has fundamental and other operations which are used on relations.
Answer: d
Explanation: The fundamental operations are select, project, union, set difference, Cartesian product,
and rename.
3. Which of the following is used to denote the selection operation in relational algebra?
a) Pi (Greek)
b) Sigma (Greek)
c) Lambda (Greek)
d) Omega (Greek)
View Answer
Answer: b
Explanation: The select operation selects tuples that satisfy a given predicate.
4. For select operation the ________ appear in the subscript and the ___________ argument appears in
the paranthesis after the sigma.
a) Predicates, relation
b) Relation, Predicates
c) Operation, Predicates
d) Relation, Operation
View Answer
Answer: a
Explanation: None.
5. The ___________ operation, denoted by −, allows us to find tuples that are in one relation but are not
in another.
a) Union
b) Set-difference
c) Difference
d) Intersection
View Answer
Answer: b
Explanation: The expression r − s produces a relation containing those tuples in r but not in s.
Answer: d
Explanation: Generalization Selection takes only one argument for operation.
Answer: a
Explanation: None.
Answer: b
Explanation: The expression is evaluated from left to right according to the precedence.
Answer: d
Explanation: The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.
10. The assignment operator is denoted by
a) ->
b) <-
c) =
d) ==
View Answer
Answer: b
Explanation: The result of the expression to the right of the ← is assigned to the relation variable on the
left of the ←.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “The Entity-Relationship
Model”.
1. 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
View Answer
Answer: a
Explanation: An entity is a “thing” or “object” in the real world that is distinguishable from all other
objects.
2. Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation
View Answer
Answer: c
Explanation: For example, each person in a university is an entity.
Answer: b
Explanation: Possible attributes of the instructor entity set are ID, name, dept name, and salary.
4. The function that an entity plays in a relationship is called that entity’s _____________
a) Participation
b) Position
c) Role
d) Instance
View Answer
Answer: c
Explanation: A relationship is an association among several entities.
5. 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
View Answer
Answer: b
Explanation: Composite attributes can be divided into subparts (that is, other attributes).
Answer: d
Explanation: The value for this type of attribute can be derived from the values of other related
attributes or entities.
Answer: c
Explanation: NULL always represents that the value is not present.
Answer: a
Explanation: Name and Date_of_birth cannot hold more than 1 value.
Answer: a
Explanation: None.
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
View Answer
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.
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Constraints”.
1. _____________ 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
View Answer
Answer: a
Explanation: Mapping cardinality is also called as cardinality ratio.
2. 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
View Answer
Answer: b
Explanation: Here one entity in one set is related to one one entity in other set.
3. 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
View Answer
Answer: d
Explanation: Here more than one entity in one set is related to one one entity in other set.
5. 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
View Answer
Answer: b
Explanation: Only particular value satisfying the constraints are entered in the column.
Answer: c
Explanation: None.
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
View Answer
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
View Answer
Answer: b
Explanation: Primary key checks for not null and uniqueness constraint.
Answer: d
Explanation: Foreign key is used when primary key of one relation is used in another relation.
Answer: a
Explanation: Constraints are specified to restrict entries in the relation.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Entity-Relationship
Diagrams”.
Answer: a
Explanation: E-R diagrams are simple and clear—qualities that may well account in large part for the
widespread use of the E-R model.
2. The entity relationship set is represented in E-R diagram as
a) Double diamonds
b) Undivided rectangles
c) Dashed lines
d) Diamond
View Answer
Answer: d
Explanation: Dashed lines link attributes of a relationship set to the relationship set.
Answer: a
Explanation: The first part of the rectangle, contains the name of the entity set. The second part
contains the names of all the attributes of the entity set.
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
View Answer
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
View Answer
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
View Answer
Answer: c
Explanation: An entity set that has a primary key is termed a strong entity set.
7. 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
View Answer
Answer: a
Explanation: Every weak entity must be associated with an identifying entity; that is, the weak entity set
is said to be existence dependent on the identifying entity set. The identifying entity set is said to own
the weak entity set that it identifies. It is also called as owner entity 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
View Answer
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
View Answer
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.
« Prev
Next »
Answer: a
Explanation: Treating a phone as an attribute phone_number implies that instructors have precisely one
phone number each.
Answer: b
Explanation: It is used to represent the relation between several attributes.
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
View Answer
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
View Answer
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.
Answer: d
Explanation: Ellipse represents attributes, rectangle represents entity.
Answer: b
Explanation: Binary word usually represents two attributes.
7. Which of the following is a low level operator?
a) Insert
b) Update
c) Delete
d) Directory
View Answer
Answer: d
Explanation: Directory is a low level to word on in file system.
Answer: c
Explanation: Primary key of one relation used as an attribute in another relation is called foreign key.
Answer: b
Explanation: View is a logical portion of a database which is needed by some users.
Answer: a
Explanation: Using the two relationships mother and father provides us a record of a child’s mother,
even if we are not aware of the father’s identity; a null value would be required if the ternary
relationship parent is used. Using binary relationship sets is preferable in this case.
Database Questions and Answers – Extended E-R Features
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Extended E-R Features”.
1. The entity set person is classified as student and employee. This process is called _________
a) Generalization
b) Specialization
c) Inheritance
d) Constraint generalization
View Answer
Answer: b
Explanation: The process of designating subgroupings within an entity set is called specialization.
Answer: a
Explanation: In terms of an E-R diagram, specialization is depicted by a hollow arrow-head pointing from
the specialized entity to the other entity.
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
View Answer
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
View Answer
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
View Answer
Answer: d
Explanation: The attributes of the higher-level entity sets are said to be inherited by the lower-level
entity sets.
6. A _____________ constraint requires that an entity belong to no more than one lower-level entity
set.
a) Disjointness
b) Uniqueness
c) Special
d) Relational
View Answer
Answer: a
Explanation: For example, student entity can satisfy only one condition for the student type attribute; an
entity can be either a graduate student or an undergraduate student, but cannot be both.
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
View Answer
Answer: a
Explanation: In overlapping generalizations, the same entity may belong to more than one lower-level
entity set within a single generalization.
8. 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
View Answer
Answer: b
Explanation: Partial generalization or specialization – Some higher-level entities may not belong to any
lower-level entity set.
Answer: a
Explanation: The subclasses are combined to form the superclass.
Answer: a
Explanation: A parent may be called as a strong entity.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Querying database part-
1 DDL”.
budget NUMBER,
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
View Answer
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
View Answer
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
View Answer
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
View Answer
Answer: a
Explanation: References (table_name) give the prior table name for the entry.
Answer: a
Explanation: The building and the sec_id have varchar values and year is of numeric type. So no such
errors are found in the relation.
(100202,Drake,Biology,30000)
Answer: b
Explanation: The varchar(5) value cannot hold the entry 100202.
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
View Answer
Answer: c
Explanation: The value ID can only be primary key unlike dept_name which is used as a foreign key.
Answer: a
Explanation: Course_id is the only field which is present in the course relation.
9. 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;
d) Alter table teaches add Name varchar(20);
View Answer
Answer: d
Explanation: The form of the alter table command is
alter table r add AD;
where r is the name of an existing relation, A is the name of the attribute to be added, and D is the type
of the added attribute.
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 ;
View Answer
Answer: b
Explanation: Droping the table drops all the references to that table.
« Prev
Next »
This set of Database Questions & Answers focuses on “Querying database part-1 DML”
The instructor relation
The course relation
1. 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;
d) Select dept_name for instructor where Name=Jackson;
View Answer
Answer: c
Explanation: Only one field is necessary for the query and where clause is not needed for the selection.
2. How can we select the elements which have common Dept_name in both the relation ?
a) Select * from instructor i , course c where i.Dept_name=c.Dept_name;
b) Select Dept name from instructor ,Course ;
c) Select * from instructor i , course c ;
d) Select Dept_name from instructor where Dept_name = NULL;
View Answer
Answer: a
Explanation: Here only the common elements are displayed .
Answer: a
Explanation: Distinct keyword eliminates the the common Dept_name .
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)
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
View Answer
Answer: b
Explanation: Delete from table_name where condition .
6.
What will be displayed as the value of name for the above query?
a) Hayley
b) Jackson
c) Hayley and Crick
d) Crick
View Answer
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.');
Answer: d
Explanation: This displays the names of instructors with salary greater than that of some (at least one)
instructor in the Biology department .
SELECT Name
FROM instructor
b)
SELECT Name
FROM course
c)
SELECT Dept_name
FROM instructor
d)
SELECT Name
FROM instructor
View Answer
Answer: a
Explanation: % is used to indicate that some characters may appear .
Answer: a
Explanation: Count (distinct ID) is the correct usage.
10. Which function is used to identify the title with Least scope?
a) Min(Credits)
b) Max(Credits)
c) Min(title)
d) Min(Salary)
View Answer
Answer: a
Explanation: Max is used to find the highest element and Min is used to find the lowest element.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Atomic Domains”.
Answer: a
Explanation: A set of names is an example of a nonatomic value.
2. Identify the composite attributes
a) Salary
b) Credits
c) Section_id
d) None of the mentioned
View Answer
Answer: d
Explanation: Composite attributes, such as an attribute address with component attributes street, city,
state, and zip have nonatomic domains.
3. Consider the relation given below and ind the maximum normal form applicable to them
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.
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.
Answer: d
Explanation: Third normal form (3NF) relaxes this constraint slightly by allowing certain nontrivial
functionaldependencieswhose left side is not a superkey.
6. If every non-key attribute is functionally dependent primary key, then the relation will be in
a) First normal form
b) Second normal form
c) Third form
d) Fourth normal form
View Answer
Answer: b
Explanation: Third normal form (3NF) relaxes this constraint slightly by allowing certain nontrivial
functionaldependencieswhose left side is not a superkey.
Answer: b
Explanation: BCNF 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
View Answer
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
View Answer
Answer: a
Explanation: This can be taken as a primary key.
Answer: a
Explanation: Given a set F of functional dependencies on a schema, we can prove that certain other
functional dependencies also hold on the schema.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Normal Forms”.
Answer: a
Explanation: The first normal form is used to eliminate the duplicate information.
2. A table on the many side of a one to many or many to many relationship must:
a) Be in Second Normal Form (2NF)
b) Be in Third Normal Form (3NF)
c) Have a single attribute key
d) Have a composite key
View Answer
Answer: d
Explanation: The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
Answer: a
Explanation: The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
Answer: c
Explanation: We say that the decomposition is a lossless decomposition if there is no loss of information
by replacing r (R) with two relation schemas r1(R1) andr2(R2).
5. Functional Dependencies are the types of constraints that are based on______
a) Key
b) Key revisited
c) Superset key
d) None of the mentioned
View Answer
Answer: a
Explanation: Key is the basic element needed for the constraints.
6. Which is a bottom-up approach to database design that design by examining the relationship between
attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
View Answer
Answer: c
Explanation: Normalisation is the process of removing redundancy and unwanted data.
7. Which forms simplifies and ensures that there are minimal data aggregates and repetitive groups:
a) 1NF
b) 2NF
c) 3NF
d) All of the mentioned
View Answer
Answer: c
Explanation: The first normal form is used to eliminate the duplicate information.
8. Which forms has a relation that possesses data about an individual entity:
a) 2NF
b) 3NF
c) 4NF
d) 5NF
View Answer
Answer: c
Explanation: A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X
\twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.
Answer: c
Explanation: The table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e.
directly dependent) on every superkey of R.
10.
For any pincode, there is only one city and state. Also, for given street, city and state, there is just one
pincode. In normalization terms, empdt1 is a relation in
a) 1 NF only
b) 2 NF and hence also in 1 NF
c) 3NF and hence also in 2NF and 1NF
d) BCNF and hence also in 3NF, 2NF and 1NF
View Answer
Answer: b
Explanation: The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Functional-Dependency
Theory”.
1. We can use the following three rules to find logically implied functional dependencies. This collection
of rules is called
a) Axioms
b) Armstrong’s axioms
c) Armstrong
d) Closure
View Answer
Answer: b
Explanation: By applying these rules repeatedly, we can find all of F+, given F.
Answer: c
Explanation: It is possible to use Armstrong’s axioms to prove that Pseudotransitivity rule is sound.
Answer: d
Explanation: Lossy-join decomposition is the decomposition used here .
4. Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into
Answer: d
Explanation: Lossy-join decomposition is the decomposition used here .
5. There are two functional dependencies with the same set of attributes on the left side of the arrow:
A->BC
A->B
This can be combined as
a) A->BC
b) A->B
c) B->C
d) None of the mentioned
View Answer
Answer: a
Explanation: This can be computed as the canonical cover.
D -> AB
The number of superkeys of R is:
a) 2
b) 7
c) 10
d) 12
View Answer
Answer: c
Explanation: A superkey is a combination of columns that uniquely identifies any row within a relational
database management system (RDBMS) table.
7. Suppose we wish to find the ID’s of the employees that are managed by people who are managed by
the employee with ID 123. Here are two possible queries:
I.SELECT ee.empID
II.SELECT empID
FROM Emps
WHERE mgrID IN
Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID’s?
a) Both I and II
b) I only
c) II only
d) Neither I nor I
View Answer
Answer: a
Explanation: The query can be satisfied by any of the two options.
8. Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5),
(4,6), (7,8)}. Then the number of tuples in the result of the SQL query:
<i>SELECT *
a) 2
b) 4
c) 6
d) None of the mentioned
View Answer
Answer: a
Explanation: The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in such a way that, columns
with same name of associate tables will appear once only.
9. Suppose now that R(A,B) and S(A,B) are two relations with r and s tuples, respectively (again, not
necessarily distinct). If m is the number of (not necessarily distinct) tuples in the result of the SQL query:
R intersect S;
Then which of the following is the most restrictive, correct condition on the value of m?
a) m = min(r,s)
b) 0 <= m <= r + s
c) min(r,s) <= m <= max(r,s)
d) 0 <= m <= min(r,s)
View Answer
Answer: d
Explanation: The value of m must lie between the min value of r and s and 0.
A -> B
B -> C
BC -> A
A -> D
E -> A
D -> E
Answer: c
Explanation: Here the keys are not formed by B and C.
Database Questions and Answers – Algorithms for Decomposition
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Algorithms for
Decomposition”.
Answer: b
Explanation: A relation is in 3 NF if an attribute of a composite key is dependent on an attribute of other
composite key. (If an attribute of a composite key is dependent on an attribute of other composite key
then the relation is not in BCNF, hence it has to be decomposed.).
Answer: b
Explanation: Lossless join and dependency preserving are the two goals of the decomposition.
3. R (A,B,C,D) is a relation. Which of the following does not have a lossless join dependency preserving
BCNF decomposition?
a) A->B, B->CD
b) A->B, B->C, C->D
c) AB->C, C->AD
d) A->BCD
View Answer
Answer: d
Explanation: This relation gives a relation without any loss in the values.
4.
Class (course id, title, dept name, credits, sec id, semester, YEAR, building, room NUMBER, capacity,
TIME slot id)
course id, sec id, semester, year->building, room NUMBER, TIME slot id
A candidate KEY FOR this schema IS {course id, sec id, semester, YEAR}
Answer: a
Explanation: Here course id is not a superkey. Thus, class is not in BCNF.
5. The algorithm that takes a set of dependencies and adds one schema at a time, instead of
decomposing the initial schema repeatedly is
a) BCNF algorithm
b) 2NF algorithm
c) 3NF synthesis algorithm
d) 1NF algorithm
View Answer
Answer: c
Explanation: The result is not uniquely defined, since a set of functional dependencies can have more
than one canonical cover, and, further, in some cases, the result of the algorithm depends on the order
in which it considers the dependencies in Fc.
6. The functional dependency can be tested easily on the materialized view, using the constraints
____________.
a) Primary key
b) Null
c) Unique
d) Both Null and Unique
View Answer
Answer: d
Explanation: Primary key contains both unique and not null constraints.
7. Which normal form is considered adequate for normal relational database design?
a) 2NF
b) 5NF
c) 4NF
d) 3NF
View Answer
Answer: d
Explanation: A relational database table is often described as “normalized” if it is in the Third Normal
Form because most of the 3NF tables are free of insertion, update, and deletion anomalies.
8. Relation R with an associated set of functional dependencies, F, is decomposed into BCNF. The
redundancy (arising out of functional dependencies) in the resulting set of relations is
a) Zero
b) More than zero but less than that of an equivalent 3NF decomposition
c) Proportional to the size of F+
d) Indeterminate
View Answer
Answer: b
Explanation: Redundancy in BCNF is low when compared to 3NF. For more details on BCNF.
9. A table has fields F1, F2, F3, F4, and F5, with the following functional dependencies:
F1->F3
F2->F4
(F1,F2)->F5
Answer: a
Explanation: Since the primary key is not given we have to derive the primary key of the table. Using the
closure set of attributes we get the primary key as (F1, F2). From functional dependencies, “F1->F3, F2-
>F4”, we can see that there is partial functional dependency therefore it is not in 1NF. Hence the table is
in 1NF.
10. Let R(A,B,C,D,E,P,G) be a relational schema in which the following FDs are known to hold:
AB->CD
DE->P
C->E
P->C
B->G
Answer: d
Explanation: From the closure set of attributes we can see that the key for the relation is AB. The FD B-
>G is a partial dependency, hence it is not in 2NF.
« Prev
Next »
1. The normal form which satisfies multivalued dependencies and which is in BCNF is
a) 4 NF
b) 3 NF
c) 2 NF
d) All of the mentioned
View Answer
Answer: a
Explanation: Fourth normal form is more restrictive than BCNF.
Answer: c
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they
require that other tuples of a certain form be present in the relation.
3. The main task carried out in the __________ is to remove repeating attributes to separate tables.
a) First Normal Form
b) Second Normal Form
c) Third Normal Form
d) Fourth Normal Form
View Answer
Answer: a
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they
require that other tuples of a certain form be present in the relation.
Answer: d
Explanation: Multivalued dependencies, do not rule out the existence of certain tuples. Instead, they
require that other tuples of a certain form be present in the relation.
5. Which forms has a relation that possesses data about an individual entity?
a) 2NF
b) 3NF
c) 4NF
d) 5NF
View Answer
Answer: c
Explanation: A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X
\twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.
6. If a multivalued dependency holds and is not implied by the corresponding functional dependency, it
usually arises from one of the following sources.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) Both A many-to-many relationship set and A multivalued attribute of an entity set
View Answer
Answer: d
Explanation: For a many-to-many relationship set each related entity set has its own schema and there is
an additional schema for the relationship set. For a multivalued attribute, a separate schema is created
consisting of that attribute and the primary key of the entity set.
7. Which of the following has each related entity set has its own schema and there is an additional
schema for the relationship set?
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) None of the mentioned
View Answer
Answer: a
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
8. In which of the following, a separate schema is created consisting of that attribute and the primary
key of the entity set.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) None of the mentioned
View Answer
Answer: b
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
Answer: c
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
10. In 2NF
a) No functional dependencies (FDs) exist
b) No multivalued dependencies (MVDs) exist
c) No partial FDs exist
d) No partial MVDs exist
View Answer
Answer: c
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Database Design
Process”.
Answer: d
Explanation: For eg.,Suppose an instructor entity set had attributes dept name and dept address, and
there is a functional dependency dept name -> dept address.
2. If a multivalued dependency holds and is not implied by the corresponding functional dependency, it
usually arises from one of the following sources.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) Both A many-to-many relationship set and A multivalued attribute of an entity set
View Answer
Answer: d
Explanation: For a many-to-many relationship set each related entity set has its own schema and there is
an additional schema for the relationship set. For a multivalued attribute, a separate schema is created
consisting of that attribute and the primary key of the entity set.
3. Which of the following has each related entity set has its own schema and there is an additional
schema for the relationship set.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) All of the mentioned
View Answer
Answer: a
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
4. In which of the following, a separate schema is created consisting of that attribute and the primary
key of the entity set.
a) A many-to-many relationship set
b) A multivalued attribute of an entity set
c) A one-to-many relationship set
d) All of the mentioned
View Answer
Answer: b
Explanation: If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.
5. Suppose the user finds the usage of room number and phone number in a relational schema there is
confusion.This is reduced by
a) Unique-role assumption
b) Unique-key assignment
c) Role intergral assignment
d) None of the mentioned
View Answer
Answer: a
Explanation: A desirable feature of a database design is the unique-role assumption, which means that
each attribute name has a unique meaning in the database.
6. What is the best way to represent the attributes in a large database?
a) Relational-and
b) Concatenation
c) Dot representation
d) All of the mentioned
View Answer
Answer: b
Explanation: Example inst sec and student sec.
7. Designers use which of the following to tune the performance of systems to support time-critical
operations?
a) Denormalization
b) Redundant optimization
c) Optimization
d) Realization
View Answer
Answer: a
Explanation: The process of taking a normalized schema and making it nonnormalized is called
denormalization.
8. In the schema (dept name, size) we have relations total inst 2007, total inst 2008. Which dependency
have lead to this relation ?
a) Dept name, year->size
b) Year->size
c) Dept name->size
d) Size->year
View Answer
Answer: a
Explanation: The process of taking a normalized schema and making it nonnormalized is called
denormalization.
9. Relation dept year(dept name, total inst 2007, total inst 2008, total inst 2009). Here the only
functional dependencies are from dept name to the other attributes. This relation is in
a) Fourth NF
b) BCNF
c) Third NF
d) Second NF
View Answer
Answer: b
Explanation: BCNF has only one normal form.
10. Thus a _______ of course data gives the values of all attributes, such as title and department, of all
courses at a particular point in time.
a) Instance
b) Snapshot
c) Both Instance and Snapshot
d) All of the mentioned
View Answer
Answer: b
Explanation: We use the term snapshot of data to mean the value of the data at a particular point in
time.
11. Representations such as the in the dept year relation, with one column for each value of an
attribute, are called _______ they are widely used in spreadsheets and reports and in data analysis
tools.
a) Cross-tabs
b) Snapshot
c) Both Cross-tabs and Snapshot
d) All of the mentioned
View Answer
Answer: a
Explanation: SQL includes features to convert data from a normal relational representation to a
crosstab.
« Prev
Next »
This set of Database Assessment Questions and Answers focuses on “Application Programs and User
Interfaces”.
1. An approach to website design with the emphasis on converting visitors to outcomes required by the
owner is referred to as:
a) Web usability
b) Persuasion
c) Web accessibility
d) None of the mentioned
View Answer
Answer: b
Explanation: In computing, graphical user interface is a type of user interface that allows users to
interact with electronic devices.
2. A method of modelling and describing user tasks for an interactive application is referred to as:
a) Customer journey
b) Primary persona
c) Use case
d) Web design persona
View Answer
Answer: c
Explanation: The actions in GUI are usually performed through direct manipulation of the graphical
elements.
Answer: b
Explanation: The actions in GUI are usually performed through direct manipulation of the graphical
elements.
Answer: a
Explanation: An application programming interface specifies how some software components should
interact with each other.
5. A graphical or text depiction of the relationship between different groups of content on a website is
referred to as a:
a) Wireframe
b) Blueprint
c) Sitemap
d) Card sorting
View Answer
Answer: c
Explanation: An application programming interface specifies how some software components should
interact with each other.
Answer: c
Explanation: A blueprint is a reproduction of a technical drawing, documenting an architecture or an
engineering design, using a contact print process.
Answer: d
Explanation: An application programming interface specifies how some software components should
interact with each other.
8. Which of the following occupies boot record of hard and floppy disks and activated during computer
startup?
a) Worm
b) Boot sector virus
c) Macro virus
d) Virus
View Answer
Answer: b
Explanation: A blueprint is a reproduction of a technical drawing, documenting an architecture or an
engineering design, using a contact print process.
9. A graphical or text depiction of the relationship between different groups of content on a website is a:
a) Page template
b) Wireframe
c) Site map
d) Cascading style sheet (CSS)
View Answer
Answer: c
Explanation: In computing, graphical user interface is a type of user interface that allows users to
interact with electronic devices.
Answer: c
Explanation: In computing, graphical user interface is a type of user interface that allows users to
interact with electronic devices.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Web Fundamentals”.
Answer: a
Explanation: A uniform resource locator (URL) is a globally unique name for each document that can be
accessed on the Web.
2. http://www.google.com/search?q=silberschatz
In the above URL which one is the argument which is used for processing of the URL?
a) google
b) google.com
c) search
d) q=silberschatz
View Answer
Answer: d
Explanation: Argument is always placed after ? symbol.
3. HTTP defines two ways in which values entered by a user at the browser can be sent to the Web
server. The _____ method encodes the values as part of the URL.
a) Post
b) Get
c) Read
d) Argument
View Answer
Answer: b
Explanation: For example, if the Google search page used a form with an input parameter
named q with the get method, and the user typed in the string “silberschatz” and submitted the form,
the browser would request the following URL from the Web server: http://www.google.com/search?
q=silberschatz.
4. A __________ is a program running on the server machine, which accepts requests from a Web
browser and sends back results in the form of HTML documents.
a) HTML
b) HTTP
c) Web Server
d) Web browser
View Answer
Answer: c
Explanation: The browser and Web server communicate via HTTP. Web servers provide powerful
features, beyond the simple transfer of documents.
5. The application program typically communicates with a database server, through ___________ or
other protocols, in order to get or store data.
a) JDBC
b) ODBC
c) All of the mentioned
d) None of the mentioned
View Answer
Answer: c
Explanation: The common gateway interface (CGI) standard defines how the Web server communicates
with application programs.
6. This extra information is usually maintained in the form of a _________ at the client.
a) Cookie
b) History
c) Remainder
d) None of the mentioned
View Answer
Answer: a
Explanation: A cookie is simply a small piece of text containing identifying information and with an
associated name.
Answer: b
Explanation: Meta data is the data about data which is included in the meta data tag.
Answer: d
Explanation: <> are tags,size is a attribute.
Answer: d
Explanation: .doc is used only for the word document format.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Servlets and JSP”.
1. The Java __________ specification defines an application programming interface for communication
between the Web server and the application program.
a) Servlet
b) Server
c) Program
d) Randomize
View Answer
Answer: a
Explanation: Servlets are commonly used to generate dynamic responses to HTTP requests.
2. The doGet() method in the example extracts values of the parameter’s type and number by using
__________
a) request.getParameter()
b) request.setParameter()
c) responce.getParameter()
d) responce.getAttribute()
View Answer
Answer: a
Explanation: These methods uses these values to run a query against a database.
Answer: d
Explanation: JBDB.DriverManager.getConnection() is used to get the connection to the database.
4. Which JDBC driver Type(s) can be used in either applet or servlet code?
a) Both Type 1 and Type 2
b) Both Type 1 and Type 3
c) Both Type 3 and Type 4
d) Type 4 only
View Answer
Answer: c
Explanation: In a Type 3 driver, a three-tier approach is used to accessing databases. The JDBC clients
use standard network sockets to communicate with an middleware application server. In a Type 4
driver, a pure Java-based driver that communicates directly with vendor’s database through socket
connection.
Answer: c
Explanation: A surrogate key in a database is a unique identifier for either an entity in the modeled
world or an object in the database.
Answer: b
Explanation: Servlets are commonly used to generate dynamic responses to HTTP requests.
Answer: a
Explanation: In a Type 1 driver, a JDBC bridge is used to access ODBC drivers installed on each client
machine.
8. What programming language(s) or scripting language(s) does Java Server Pages (JSP) support?
a) VBScript only
b) Jscript only
c) Java only
d) All of the mentioned
View Answer
Answer: c
Explanation: JSP primarily uses Java for certain codes.
9. What is bytecode?
a) Machine-specific code
b) Java code
c) Machine-independent code
d) None of the mentioned
View Answer
Answer: c
Explanation: Java bytecode is the form of instructions that the Java virtual machine executes. Each
bytecode opcode is one byte in length, although some require parameters, resulting in some multi-byte
instructions.
Answer: c
Explanation: Metadata contains data about other data which is given in the <meta>…</meta> tags.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Application
Architectures”.
1. Which of the following is true for Seeheim model?
a) Presentation is abstracted from dialogue and Application
b) Presentation and Dialogue is abstracted from Application
c) Presentation and Application is abstracted from Dialogue
d) None of the mentioned
View Answer
Answer: a
Explanation: Presentation is abstracted from dialogue and application.
Answer: b
Explanation: Part whole decomposition is applied to MVC.
3. Memory address refers to the successive memory words and the machine is called as
_______________
a) word addressable
b) byte addressable
c) bit addressable
d) Terra byte addressable
View Answer
Answer: a
Explanation: Part whole decomposition is applied to MVC.
4. Which layer deals which deals with user interaction is called _____________ layer.
a) Business logic
b) Presentation
c) User interaction
d) Data access
View Answer
Answer: b
Explanation: The single application may have several different versions of this layer, corresponding to
distinct kinds of interfaces such as Web browsers, and user interfaces of mobile phones, which have
much smaller screens.
5. The _____________ layer, which provides a high-level view of data and actions on data.
a) Business logic
b) Presentation
c) User interaction
d) Data access
View Answer
Answer: a
Explanation: The single application may have several different versions of this layer, corresponding to
distinct kinds of interfaces such as Web browsers, and user interfaces of mobile phones, which have
much smaller screens.
6. The ______________ layer, which provides the interface between the business-logic layer and the
underlying database.
a) Business logic
b) Presentation
c) User interaction
d) Data access
View Answer
Answer: d
Explanation: Many applications use an object-oriented language to code the business-logic layer, and
use an object-oriented model of data, while the underlying database is a relational database.
7. The _____________ system is widely used for mapping from Java objects to relations.
a) Hibernate
b) Object oriented
c) Objective
d) None of the mentioned
View Answer
Answer: a
Explanation: In Hibernate, the mapping from each Java class to one or more relations is specified in a
mapping file.
8. Which among the following are the functions that any system with a user interface must provide?
a) Presentation
b) Dialogue
c) All of the mentioned
d) None of the mentioned
View Answer
Answer: a
Explanation: Presentation and Application are the functions that any system with a user interface must
provide.
Answer: d
Explanation: All of the mentioned are the main task accomplished by the user.
Answer: d
Explanation: The portability concerns founded in Seeheim model are- Replacing the presentation toolkit
and Replacing the application toolkit.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Rapid Application
Development”.
1. Which schema object instructs Oracle to connect to a remotely access an object of a database?
a) Sequence
b) Remote link
c) Database link
d) Data link
View Answer
Answer: d
Explanation: A database link (DBlink) is a definition of how to establish a connection from one Oracle
database to another.
Answer: d
Explanation: Create is a DDL operation.
Answer: d
Explanation: Sequence is a series of items which is like a unique index.
Answer: b
Explanation: ALTER SYSTEM ARCHIVE LOG CURRENT is the best practice for production backup scripts
with RMAN. .
a) 100 / 0.15
b) quantity – 100
c) 35*20
d) 0.15-35
View Answer
Answer: a
Explanation: According to the precedence of expression as in BODMAS the expression evaluated.
Answer: a
Explanation: SELECT column_name,column_name
FROM table_name
ORDER BY column_name,column_name ASC|DESC;.
Answer: a
Explanation: The CREATE INDEX statement is used to create indexes in tables.
Answer: a
Explanation: SMON (System MONitor) is an Oracle background process created when you start a
database instance.
10. Which of the following queries displays the sum of all employee salaries for those employees not
making commission, for each job, including only those sums greater than 2500?
a) select job, sum(sal) from emp where sum(sal) > 2500 and comm is null;
b) select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;
c) select job, sum(sal) from emp where sum(sal) > 2500 and comm is null group by job;
d) select job, sum(sal) from emp group by job having sum(sal) > 2500 and comm is not null;
View Answer
Answer: b
Explanation: For aggregate functions group by clause is necessary.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Application
Performance”.
1. The indirect change of the values of a variable in one module by another module is called
a) Internal change
b) Inter-module change
c) Side effect
d) Side-module update
View Answer
Answer: c
Explanation: The module of the search tree and the flow is directed by its values.
Answer: d
Explanation: Both array and linked lists are in data structure concepts.
3. Which of the following data structure is linear data structure?
a) Trees
b) Graphs
c) Arrays
d) None of the mentioned
View Answer
Answer: c
Explanation: Tree and graphs are not linear.
4. Which of the following criterion is NOT written using the proper syntax?
a) “Haris”
b) <500
c) NO VALUE
d) Between #1/1/2000# and #12/31/2000#
View Answer
Answer: c
Explanation: NO VALUE cannot be specified.
Answer: d
Explanation: There are several types of traversals.
Answer: b
Explanation: Search is performed by traversing through the tree.
Answer: a
Explanation: The operator tree has a tree like format where the evaluation starts from root of the tree.
Answer: b
Explanation: A linked list is a data structure consisting of a group of nodes which together represent a
sequence.
9. Each array declaration need not give, implicitly or explicitly, the information about
a) The name of array
b) The data type of array
c) The first data from the set to be stored
d) The index set of the array
View Answer
Answer: c
Explanation: The operator tree has a tree like format where the evaluation starts from root of the tree.
10. The elements of an array are stored successively in memory cells because
a) By this way computer can keep track only the address of the first element and the addresses of other
elements can be calculated
b) The architecture of computer memory does not allow arrays to store other than serially
c) All of the mentioned
d) None of the mentioned
View Answer
Answer: a
Explanation: Memory is always allotted in order.
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Application Security”.
1. In _________________ attacks, the attacker manages to get an application to execute an SQL query
created by the attacker.
a) SQL injection
b) SQL
c) Direct
d) Application
View Answer
Answer: a
Explanation: Application security has to deal with several security threats and issues beyond those
handled by SQL authorization.
2. A Web site that allows users to enter text, such as a comment or a name, and then stores it and later
display it to other users, is potentially vulnerable to a kind of attack called a ___________________
attack.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting
View Answer
Answer: c
Explanation: In such an attack, a malicious user enters code written in a client-side scripting language
such as JavaScript or Flash instead of entering a valid name or comment.
3. _________ is an attack which forces an end user to execute unwanted actions on a web application in
which he/she is currently authenticated.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting
View Answer
Answer: b
Explanation: Cross-site request forgery, also known as a one-click attack or session riding and
abbreviated as CSRF or XSRF.
4. Many applications use _________________ where two independent factors are used to identify a
user.
a) Two-factor authentication
b) Cross-site request forgery
c) Cross-site scripting
d) Cross-site scoring scripting
View Answer
Answer: a
Explanation: The two factors should not share a common vulnerability.
Answer: d
Explanation: In such attacks, a user attempting to connect to the application is diverted to a fake Web
site, which accepts the password from the user, and uses it immediately to authenticate to the original
application.
6. A single ______________ further allows the user to be authenticated once, and multiple applications
can then verify the user’s identity through an authentication service without requiring reauthentication.
a) OpenID
b) Sign-on system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)
View Answer
Answer: b
Explanation: Once the user logged in at one site, he does not have to enter his user name and password
at other sites that use the same single sign-on service.
Answer: c
Explanation: The user’s password and other authentication factors are never revealed to the application,
and the user need not register explicitly with the application.
8. The __________ standard is an alternative for single sign-on across organizations, and has seen
increasing acceptance in recent years.
a) OpenID
b) Single-site system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)
View Answer
Answer: a
Explanation: The user’s password and other authentication factors are never revealed to the application,
and the user need not register explicitly with the application.
9. _______________ allows a system administrator to associate a function with a relation; the function
returns a predicate that must be added to any query that uses the relation.
a) OpenID
b) Single-site system
c) Security Assertion Markup Language (SAML)
d) Virtual Private Database (VPD)
View Answer
Answer: d
Explanation: Some database systems provide mechanisms for fine-grained authorization.
10. VPD provides authorization at the level of specific tuples, or rows, of a relation, and is therefore said
to be a _____________ mechanism.
a) Row-level authorization
b) Column-level authentication
c) Row-type authentication
d) Authorization security
View Answer
Answer: a
Explanation: Oracle Virtual Private Database (VPD) allows a system administrator to associate a function
with a relation.
« Prev
Next »
This set of Database Questions and Answers for Aptitude test focuses on “Organization of Records in
Files”.
Answer: d
Explanation: The database is always consistent and so there is no duplication.
Answer: b
Explanation: This is more useful for all recovery actions.
Answer: c
Explanation: The operator tree has a tree like format where the evaluation starts from root of the tree .
4. Which of the following hardware component is the most important to the operation of a database
management system?
a) High resolution video display
b) Printer
c) High speed, large capacity disk
d) Mouse
View Answer
Answer: c
Explanation: All the data are stored in form of memory in the disk.
5. Which of the following is not true of the traditional approach to information processing
a) There is common sharing of data among the various applications
b) It is file oriented
c) Programs are dependent on the file
d) It is inflexible
View Answer
Answer: a
Explanation: All the data are stored in form of memory in the disk.
Answer: d
Explanation: The data are traversed using several algorithms.
Answer: b
Explanation: All the data are stored in form of memory in the disk.
Answer: a
Explanation: Metadata is information about a data.
Answer: d
Explanation: The data dictionary is structured in tables and views, just like other database data.
10. The DBMS acts as an interface between what two components of an enterprise-class database
system?
a) Database application and the database
b) Data and the database
c) The user and the database application
d) Database application and SQL
View Answer
Answer: a
Explanation: Database application is the interface with the user to access the database.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Data-Dictionary
Storage”.
1. A relational database system needs to maintain data about the relations, such as the schema of the
relations. This is called
a) Metadata
b) Catalog
c) Log
d) Dictionary
View Answer
Answer: a
Explanation: Each side of a platter of a disk has a read–write head that moves across the platter to
access different tracks.
2. Relational schemas and other metadata about relations are stored in a structure called the
____________
a) Metadata
b) Catalog
c) Log
d) Data Dictionary
View Answer
Answer: d
Explanation: Data dictionary is also called as system catalog.
3. ___________ is the collection of memory structures and Oracle background processes that operates
against an Oracle database.
a) Database
b) Instance
c) Tablespace
d) Segment
View Answer
Answer: b
Explanation: Instance is a snapshot of database at any point of time.
4. A ________ is a logical grouping of database objects, usually to facilitate security, performance, or the
availability of database objects such as tables and indexes.
a) Tablespace
b) Segments
c) Extents
d) Blocks
View Answer
Answer: a
Explanation: A tablespace is a storage location where the actual data underlying database objects can be
kept.
Answer: b
Explanation: Segment names are used in create table and create index commands to place tables or
indexes on specific database devices.
6. __________ is a contiguous group of blocks allocated for use as part of a table, index, and so forth.
a) Tablespace
b) Segment
c) Extent
d) Block
View Answer
Answer: c
Explanation: An extent is a set of contiguous blocks allocated in a database.
Answer: d
Explanation: Data block is a form of database space allocation.
8. An Oracle __________ is a set of tables and views that are used as a read-only reference about the
database.
a) Database dictionary
b) Dictionary table
c) Data dictionary
d) Dictionary
View Answer
Answer: c
Explanation: Data dictionary is also called as system catalog.
Answer: c
Explanation: Data dictionary is also called as system catalog.
10. An Oracle object type has two parts the _________ and__________
a) Instance and body
b) Segment and blocks
c) Specification and body
d) Body and segment
View Answer
Answer: c
Explanation: Segment names are used in create table and create index commands to place tables or
indexes on specific database devices. An extent is a set of contiguous blocks allocated in a database.
Database Questions and Answers – Database Buffer
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Database Buffer”.
1. The _______ is that part of main memory available for storage of copies of disk blocks.
a) Buffer
b) Catalog
c) Storage
d) Secondary storage
View Answer
Answer: a
Explanation: There is always a copy kept on disk of every block, but the copy on disk may be a version of
the block older than the version in the buffer.
2. A major goal of the database system is to minimize the number of block transfers between the disk
and memory. This is achieved by
a) Buffer
b) Catalog
c) Storage
d) Secondary storage
View Answer
Answer: a
Explanation: There is always a copy kept on disk of every block, but the copy on disk may be a version of
the block older than the version in the buffer.
3. The subsystem responsible for the allocation of buffer space is called the ___________
a) Buffer
b) Buffer manager
c) Storage
d) Secondary storage
View Answer
Answer: b
Explanation: Programs in a database system make requests (that is, calls) on the buffer manager when
they need a block from disk.
4. In the buffer where there is no space for another block, the block can be inserted using
a) Pinned block strategy
b) Forced output block
c) Buffer replacement strategy
d) All of the mentioned
View Answer
Answer: c
Explanation: Most operating systems use a least recently used (LRU) scheme, in which the block that
was referenced least recently is written back to disk and is removed from the buffer.
Answer: a
Explanation: Although many operating systems do not support pinned blocks, such a feature is essential
for a database system that is resilient to crashes.
6. There are situations in which it is necessary to write back the block to disk, even though the buffer
space that it occupies is not needed. This write is called the
a) Pinned block strategy
b) Forced output block
c) Buffer replacement strategy
d) All of the mentioned
View Answer
Answer: b
Explanation: The main-memory contents and thus buffer contents are lost in a crash, whereas data on
disk usually survive a crash.
Answer: b
Explanation: If a block must be replaced, the least recently referenced block is replaced.
8. In case the buffer manager do not write the blocks properly then the buffer manager uses
a) Replacement strategy
b) Forced strategy
c) Crash recovery system
d) Both Replacement and Forced strategy
View Answer
Answer: c
Explanation: The crash-recovery subsystem imposes stringent constraints on block replacement.
9. The technique where the blocks which have been used are replaced is called
a) Replacement strategy
b) Forced strategy
c) Crash recovery system
d) Most recently used
View Answer
Answer: d
Explanation: The optimal strategy for block replacement is the most recently used (MRU) strategy.
10. ___________________ frees the space occupied by a block as soon as the final tuple of that block
has been processed.
a) Replacement strategy
b) Forced strategy
c) Toss immediate strategy
d) Most recently used
View Answer
Answer: c
Explanation: The optimal strategy for block replacement is the most recently used (MRU) strategy.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Query Processing”.
Answer: b
Explanation: Database is a collection of related tables.
Answer: d
Explanation: The network model is a database model conceived as a flexible way of representing objects
and their relationships.
3. Which of the following schemas does define a view or views of the database for particular users?
a) Internal schema
b) Conceptual schema
c) Physical schema
d) External schema
View Answer
Answer: d
Explanation: An externally-defined schema can provide access to tables that are managed on any
PostgreSQL, Microsoft SQL Server, SAS, Oracle, or MySQL database.
4. Which of the following is an attribute that can uniquely identify a row in a table?
a) Secondary key
b) Candidate key
c) Foreign key
d) Alternate key
View Answer
Answer: b
Explanation: A Candidate Key can be any column or a combination of columns that can qualify as unique
key in database.
5. Which of the following are the process of selecting the data storage and data access characteristics of
the database?
a) Logical database design
b) Physical database design
c) Testing and performance tuning
d) Evaluation and selecting
View Answer
Answer: b
Explanation: The physical design of the database optimizes performance while ensuring data integrity by
avoiding unnecessary data redundancies.
6. Which of the following terms does refer to the correctness and completeness of the data in a
database?
a) Data security
b) Data constraint
c) Data independence
d) Data integrity
View Answer
Answer: d
Explanation: ACID property is satisfied by transaction in database.
Answer: b
Explanation: One entity department is related to several employees.
Answer: c
Explanation: A superkey is a combination of attributes that can be uniquely used to identify a database
record.
9. If the state of the database no longer reflects a real state of the world that the database is supposed
to capture, then such a state is called
a) Consistent state
b) Parallel state
c) Durable state
d) Inconsistent state
View Answer
Answer: d
Explanation: SQL data consistency is that whenever a transaction is performed, it sees a consistent
database.
Answer: b
Explanation: Concurrency control ensures that correct results for concurrent operations are generated
while getting those results as quickly as possible.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Join Operations”.
1. A_____ is a query that retrieves rows from more than one table or view:
a) Start
b) End
c) Join
d) All of the mentioned
View Answer
Answer: c
Explanation: An SQL join clause combines records from two or more tables in a database. It creates a set
that can be saved as a table or used as it is. A JOIN is a means for combining fields from two tables by
using values common to each.
Answer: b
Explanation: An SQL join clause combines records from two or more tables in a database. It creates a set
that can be saved as a table or used as it is. A JOIN is a means for combining fields from two tables by
using values common to each.
3. Which oracle is the join condition is specified using the WHERE clause:
a) Oracle 9i
b) Oracle 8i
c) Pre-oracle 9i
d) Pre-oracle 8i
View Answer
Answer: c
Explanation: Oracle 9i is a version of the Oracle Database. The i stands for “Internet” to indicate that 9i is
“Internet ready”.
Answer: d
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN.
Answer: d
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN are the types of joins.
Answer: b
Explanation: A Cartesian coordinate system is a coordinate system that specifies each point uniquely in a
plane by a pair of numerical coordinates.
Answer: a
Explanation: An equi-join is a specific type of comparator-based join, that uses only equality
comparisons in the join-predicate.
8. Which join refers to join records from the write table that have no matching key in the left table are
include in the result set:
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
View Answer
Answer: b
Explanation: A right outer join will return all the rows that an inner join returns plus one row for each of
the other rows in the second table that did not have a match in the first table. It is the same as a left
outer join with the tables specified in the opposite order.
Answer: d
Explanation: The DELETE statement is used to delete rows in a table. The UPDATE statement is used to
update existing records in a table. The INSERT INTO statement is used to insert new records in a table.
10. Which view that contains more than one table in the top-level FROM clause of the SELECT
statement:
a) Join view
b) Datable join view
c) Updatable join view
d) All of the mentioned
View Answer
Answer: c
Explanation: The DELETE statement is used to delete rows in a table. The UPDATE statement is used to
update existing records in a table. The INSERT INTO statement is used to insert new records in a table.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Materialized Views”.
1. Which normal form is considered adequate for normal relational database design?
a) 2NF
b) 5NF
c) 4NF
d) 3NF
View Answer
Answer: d
Explanation: A relational database table is often described as “normalized” if it is in the Third Normal
Form because most of the 3NF tables are free of insertion, update, and deletion anomalies.
2. Consider a schema R(A, B, C, D) and functional dependencies A -> B and C -> D. Then the
decomposition of R into R1 (A, B) and R2(C, D) is
a) dependency preserving and lossless join
b) lossless join but not dependency preserving
c) dependency preserving but not lossless join
d) not dependency preserving and not lossless join
View Answer
Answer: d
Explanation: While decomposing a relational table we must verify the following properties:
i) Dependency Preserving Property
ii) Lossless-Join Property.
3. Relation R with an associated set of functional dependencies, F, is decomposed into BCNF. The
redundancy (arising out of functional dependencies) in the resulting set of relations is
a) Zero
b) More than zero but less than that of an equivalent 3NF decomposition
c) Proportional to the size of F+
d) Indeterminate
View Answer
Answer: b
Explanation: Redundancy in BCNF is low when compared to 3NF.
Answer: c
Explanation: Achieving Lossless and dependency-preserving decomposition property into BCNF is
difficult.
5. A table has fields F1, F2, F3, F4, and F5, with the following functional dependencies:
F1->F3
F2->F4
(F1,F2)->F5
Answer: a
Explanation: Since the primary key is not given we have to derive the primary key of the table. Using the
closure set of attributes we get the primary key as (F1,F2). From functional dependencies, “F1->F3, F2-
>F4”, we can see that there is partial functional dependency therefore it is not in 1NF. Hence the table is
in 1NF.
Answer: c
Explanation: A relational database table is often described as “normalized” if it is in the Third Normal
Form because most of the 3NF tables are free of insertion, update, and deletion anomalies.
Date_of_Birth->Age Age->Eligibility
Name->Roll_number Roll_number->Name
Course_number->Course_name Course_number->Instructor
(Roll_number, Course_number)->Grade
Answer: d
Explanation: For the given relation only some of the above FDs are applicable. The applicable FDs are
given below:
Date_of_Birth->Age
Name->Roll_number
Roll_number->Name
Finding the closure set of attributes we get the candidate keys:(Roll_number,Date_of_Birth), and
(Name,Date_of_Birth) .
On selecting any one of the candidate key we can see that the FD Date_of_Birth->Age is a partial
dependency. Hence the relation is in 1NF.
8. The relation schema Student_Performance (name, courseNo, rollNo, grade) has the following FDs:
name,courseNo->grade
rollNo,courseNo->grade
name->rollNo
rollNo->name
The highest normal form of this relation scheme is
a) 2NF
b) 3NF
c) BCNF
d) 4NF
View Answer
Answer: b
Explanation: A super key is a combination of prime attributes and one or more non-prime key
attribute(s). It also uniquely identifies a record in a table. Primary key can be defined as super key with
minimal attributes.
9. The relation EMPDT1 is defined with attributes empcode(unique), name, street, city, state, and
pincode. For any pincode, there is only one city and state. Also, for any given street, city and state, there
is just one pincode. In normalization terms EMPDT1 is a relation in
a) 1NF only
b) 2NF and hence also in 1NF
c) 3NF and hence also in 2NF and 1NF
d) BCNF and hence also in 3NF, 2NF and 1NF
View Answer
Answer: b
Explanation: Empcode is unique, therefore it is the primary key. Since the primary key consists of a
single attribute there will be no partial dependency, hence the relation is in 2NF.
From the question we get the FDs as below:
pincode -> city, state
street,city,state -> pincode
From the FDs we can see that there are transitive dependencies, hence the table is not in 3NF.
Answer: d
Explanation: A table is in 3NF if and only if, for each of its functional dependencies X -> A, at least one of
the following conditions holds:
* X contains A (that is, X -> A is trivial functional dependency), or
* X is a superkey, or
* A should be prime attribute.
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Transaction Concept”.
1. Consider money is transferred from (1)account-A to account-B and (2) account-B to account-A. Which
of the following form a transaction?
a) Only 1
b) Only 2
c) Both 1 and 2 individually
d) Either 1 or 2
View Answer
Answer: c
Explanation: The term transaction refers to a collection of operations that form a single logical unit of
work.
Answer: a
Explanation: The transaction consists of all operations executed between the begin transaction and end
transaction.
Answer: d
Explanation: Because of the above three properties, transactions are an ideal way of structuring
interaction with a database.
Answer: a
Explanation: Either all operations of the transaction are reflected properly in the database, or none are.
5. The database system must take special actions to ensure that transactions operate properly without
interference from concurrently executing database statements. This property is referred to as
a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
View Answer
Answer: c
Explanation: Even though multiple transactions may execute concurrently, the system guarantees that,
for every pair of transactions Ti and Tj, it appears to Ti that either Tj finished execution before Ti started
or Tj started execution after Ti finished.
Answer: b
Explanation: After a transaction completes successfully, the changes it has made to the database persist,
even if there are system failures.
7. __________ states that only valid data will be written to the database.
a) Consistency
b) Atomicity
c) Durability
d) Isolation
View Answer
Answer: a
Explanation: If for some reason, a transaction is executed that violates the database’s consistency rules,
the entire transaction will be rolled back and the database will be restored to a state consistent with
those rules.
Answer: c
Explanation: Collections of operations that form a single logical unit of work are called transactions.
9. The Oracle RDBMS uses the ____ statement to declare a new transaction start and its properties.
a) BEGIN
b) SET TRANSACTION
c) BEGIN TRANSACTION
d) COMMIT
View Answer
Answer: b
Explanation: Commit is used to store all the transactions.
10. ____ means that the data used during the execution of a transaction cannot be used by a second
transaction until the first one is completed.
a) Consistency
b) Atomicity
c) Durability
d) Isolation
View Answer
Answer: d
Explanation: Even though multiple transactions may execute concurrently, the system guarantees that,
for every pair of transactions Ti and Tj, it appears to Ti that either Tj finished execution before Ti started
or Tj started execution after Ti finished.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “A Simple Transaction
Model”.
1. In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW and GRANT statements
in a single transaction?
a) CREATE PACKAGE
b) CREATE SCHEMA
c) CREATE CLUSTER
d) All of the mentioned
View Answer
Answer: b
Explanation: A database schema of a database system is its structure described in a formal language
supported by the database management system and refers to the organization of data as a blueprint of
how a database is constructed.
Answer: a
Explanation: Triggers are used to initialize the actions for an activity.
3. Which character function can be used to return a specified portion of a character string?
a) INSTR
b) SUBSTRING
c) SUBSTR
d) POS
View Answer
Answer: c
Explanation: SUBSTR are used to match the particular characters in a string.
Answer: b
Explanation: A database schema of a database system is its structure described in a formal language
supported by the database management system and refers to the organization of data as a blueprint of
how a database is constructed.
5. What are the different events in Triggers?
a) Define, Create
b) Drop, Comment
c) Insert, Update, Delete
d) Select, Commit
View Answer
Answer: c
Explanation: A database trigger is a procedural code that is automatically executed in response to
certain events on a particular table or view in a database.
6. Which is the subset of SQL commands used to manipulate Oracle Database Structures, including
tables?
a) Data Definition Language
b) Data Manipulation Language
c) Data Described Language
d) Data Retrieval Language
View Answer
Answer: a
Explanation: DDL are used to define schema and table characters.
Answer: b
Explanation: SUBSTR are used to match the particular characters in a string.
8. Which of the following SQL command can be used to modify existing data in a database table?
a) MODIFY
b) UPDATE
c) CHANGE
d) NEW
View Answer
Answer: b
Explanation: Syntax : UPDATE table_name
SET column1=value1,column2=value2,…
WHERE some_column=some_value; .
9. When SQL statements are embedded inside 3GL, we call such a program as
a) Nested query
b) Nested programming
c) Distinct query
d) Embedded SQL
View Answer
Answer: d
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
10. _______________ provides option for entering SQL queries as execution time, rather than at the
development stage.
a) PL/SQL
b) SQL*Plus
c) SQL
d) Dynamic SQL
View Answer
Answer: d
Explanation: Dynamic SQL enables you to write programs that reference SQL statements whose full text
is not known until runtime.
« Prev
Next »
This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Storage Structure”.
1. The storage structure which do not survive system crashes are ______
a) Volatile storage
b) Non-volatile storage
c) Stable storage
d) Dynamic storage
View Answer
Answer: a
Explanation: Volatile storage, is a computer memory that requires power to maintain the stored
information, in other words it needs power to reach the computer memory.
Answer: b
Explanation: Information residing in nonvolatile storage survives system crashes.
Answer: c
Explanation: Similarly, for a transaction to be atomic, log records need to be written to stable storage
before any changes are made to the database on disk.
4. The unit of storage that can store one are more records in a hash file organization are
a) Buckets
b) Disk pages
c) Blocks
d) Nodes
View Answer
Answer: a
Explanation: Buckets are used to store one or more records in a hash file organization.
5. A ______ file system is software that enables multiple computers to share file storage while
maintaining consistent space allocation and file content.
a) Storage
b) Tertiary
c) Secondary
d) Cluster
View Answer
Answer: d
Explanation: With a cluster file system, the failure of a computer in the cluster does not make the file
system unavailable.
Answer: a
Explanation: ASCII text format uses the standard text file for the changing the value.
Answer: b
Explanation: It specifies internal schema and also mapping between two schemas.
8. Which of the following are the process of selecting the data storage and data access characteristics of
the database?
a) Logical database design
b) Physical database design
c) Testing and performance tuning
d) Evaluation and selecting
View Answer
Answer: b
Explanation: Physical database design is the process of selecting the data storage and data access
characteristics of the database.
Answer: d
Explanation: Network model has data stored in a hierarchical network flow.
10. The process of saving information onto secondary storage devices is referred to as
a) Backing up
b) Restoring
c) Writing
d) Reading
View Answer
Answer: c
Explanation: The information is written into the secondary storage device.
« Prev
Next »
This set of Database Interview Questions and Answers for freshers focuses on ” Querying database part
– 3″.
Answer: b
Explanation: Inner query joins only the rows that are matching.
Answer: a
Explanation: Like matches the pattern with the query.
Answer: a
Explanation: All these are functions of the database.
Answer: c
Explanation: This will delete the database with its structure.
Answer: a
Explanation: Primary keys together form the composite key.
Answer: b
Explanation: Query optimization is used to improve quality.
7. ____________ is a special type of stored procedure that is automatically invoked whenever the data
in the table is modified.
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned
View Answer
Answer: b
Explanation: Triggers are used to initiate an action to take place.
8. ______________ requires that data should be made available to only authorized users.
a) Data integrity
b) Privacy
c) Security
d) None of the Mentioned
View Answer
Answer: c
Explanation: Some algorithms may be used for the security.
Answer: b
Explanation: Processing is not the a utility in dbms.
10. ____________ allows individual row operation to be performed on a given result set or on the
generated by a selected by a selected statement.
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned
View Answer
Answer: c
Explanation: Triggers are used to initiate an action to take place.
« Prev
Next »
This set of Database Questions and Answers for Experienced people focuses on ” Querying database
part – 4″.
1. Which s essential a business problem not a data problem:
a) Data
b) Database
c) Database design
d) All of the mentioned
View Answer
Answer: c
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
Answer: d
Explanation: Data modelling designs the data in a secured manner.
Answer: c
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
4. The database design prevents some data from being represented due to _______
a) Deletion anomalies
b) Insertion anomalies
c) Update anomaly
d) None of the mentioned
View Answer
Answer: b
Explanation: Insertion anomaly is due to confusion in data deletion or insertion.
Answer: b
Explanation: Insertion anomaly is due to confusion in data deletion or insertion.
Answer: a
Explanation: Normalization helps in improving the quality of the data.
Answer: b
Explanation: Normalization helps in improving the quality of the data.
8. Which is a bottom-up approach to database design that design by examining the relationship between
attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
View Answer
Answer: c
Explanation: Normalization helps in improving the quality of the data.
10. Which formal method that locates and analyses relation schemas on the basis of their primary,
candidate keys, and the FD’s that are present among the attributes of these schemas:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
View Answer
Answer: c
Explanation: Normalization helps in improving the quality of the data.
« Prev
Next »
This set of Database Interview Questions and Answers for Experienced people focuses on ” Querying
database part – 5″.
1. Which is refers to a stalemate situation due to which no further progress is possible as computer
await response of each other:
a) Concurrency
b) Deadlock
c) Backup
d) Recovery
View Answer
Answer: b
Explanation: Deadlock will stop further processing.
2. Which is a duplicate copy of a file program that is stored on a different storage media than the
original location:
a) Concurrency
b) Deadlock
c) Backup
d) Recovery
View Answer
Answer: c
Explanation: Backup is required to take all the data.
3. Which is the duplication of computer operations and routine backups to combat any unforeseen
problems:
a) Concurrency
b) Deadlock
c) Backup
d) Recovery
View Answer
Answer: d
Explanation: Recovery means to take the backup data while there is a crash.
Answer: a
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
Answer: a
Explanation: SQL-99 is the most recent version of standard SQL prescribed by the ANSI.
Answer: b
Explanation: External users are the people who do not involve in the processing of the database.
7. Copying files to secondary or specific devices is known as ______
a) Retrieve
b) Backup
c) Recovery
d) Deadlock
View Answer
Answer: b
Explanation: Backup is required to take all the data.
Answer: a
Explanation: Recovery means to take the backup data while there is a crash.
Answer: c
Explanation: Recovery means to take the backup data while there is a crash.
10. Which server can join the indexes when only multiple indexes combined can cover the query:
a) SQL
b) DBMS
c) RDBMS
d) All of the mentioned
View Answer
Answer: a
Explanation: Indexing reduces the difficulty in searching the data.
1. Home
2. Computer Science MCQ
3. Database MCQ
1:
A.¬ P1 ∨ P2
B.P1 ∨ P2
C. P1 ∧ P2
D P1 ∧ ¬P2
.
Answer Report Discuss
Option: A
Explanation :
2:
A logical schema
Answer Report Discuss
Option: A
Explanation :
A.Data file
B.Data record.
C. Menu.
D Bank.
.
Answer Report Discuss
Option: B
Explanation :
Related data fields in a database are grouped to form a data record.
(A record is a collection of related fields)
4:
A.Users.
B.Separate files
C. Database.
D Database administrator
.
Answer Report Discuss
Option: B
Explanation :
5:
The way a particular application views the data from the database that the application uses is a
A.Module.
B.Relational model.
C. Schema.
D Sub schema.
.
Answer Report Discuss
Option: D
Explanation :
1. Home
3. Database MCQ
6:
A.Update files.
C. Data entry.
D Delete files.
.
Answer Report Discuss
Option: B
Explanation :
Click on Discuss to view users comments.
7:
Answer Report Discuss
Option: D
Explanation :
8:
A.A criteria.
B.A relation.
C. A tuple.
D An attribute.
.
Answer Report Discuss
Option: C
Explanation :
9:
B.Is much more data independence than some other database models
C. Are explicit relationships among records
Answer Report Discuss
Option: B
Explanation :
In relational model data is stored in tables and if we talk about data independence it is one of
the major feature of DBMS which holds in all DBMS models.
10:
Conceptual design
B.Needs data volume and processing frequencies to determine the size of the database.
Answer Report Discuss
Option: C
Explanation :
1. Home
3. Database MCQ
4. ER-model & Relational Model
11:
The method in which records are physically stored in a specified order according to a key field in each
record is
A.Hash
B.Direct.
C. Sequential
Answer Report Discuss
Option: A
Explanation :
A method in which records are physically stored in a specified order according to a key field in
each record is hash. (In hash method, a hash function is performed on the key value to determine
the unique physical address of the record to store or retrieve)
12:
A subschema expresses
Answer Report Discuss
Option: C
Explanation :
A subschema expresses the external view. (External schemas are called also called as
subschemas)
Click on Discuss to view users comments.
13:
B.Data elements in the database can be modified by changing the data dictionary.
C. The data dictionary contains the name and description of each data element.
Answer Report Discuss
Option: B
Explanation :
14:
Answer Report Discuss
Option: C
Explanation :
15:
Answer Report Discuss
Option: D
Explanation :
1. Home
3. Database MCQ
16:
Answer Report Discuss
Option: D
Explanation :
17:
E-R model uses this symbol to represent weak entity set ?
A.Dotted rectangle
B.Diamond
D None of these
.
Answer Report Discuss
Option: C
Explanation :
18:
A.Network Model
B.Hierarchical Model
C. Relational Model
D None of these
.
Answer Report Discuss
Option: A
Explanation :
19:
Relational Algebra is
B.Meta Language
Answer Report Discuss
Option: C
Explanation :
20:
A.Primary key
B.Secondary Key
C. Foreign Key
D None of these
.
Answer Report Discuss
Option: C
Explanation :
1. Home
3. Database MCQ
21:
B.Difference
C. Intersection
D Product
.
Answer Report Discuss
Option: A
Explanation :
22:
A.Data independence
C. Control redundancy
D All of above
.
Answer Report Discuss
Option: D
Explanation :
23:
A.Groups
B.Table
C. Attributes
D Switchboards
.
Answer Report Discuss
Option: C
Explanation :
24:
In a relation
D None of these
.
Answer Report Discuss
Option: C
Explanation :
25:
Answer Report Discuss
Option: B
Explanation :
3. Database MCQ
26:
A.Dependent on hardware
B.Dependent on software.
Answer Report Discuss
Option: D
Explanation :
27:
A.Unary
B.Binary
C. Ternary
D Quaternary
.
Answer Report Discuss
Option: B
Explanation :
28:
Which of the following operation is used if we are interested in only certain columns of a table?
A.PROJECTION
B.SELECTION
C. UNION
D JOIN
.
Answer Report Discuss
Option: A
Explanation :
29:
A.Tuple.
B.Relation.
C. Attribute.
D Degree.
.
Answer Report Discuss
Option: A
Explanation :
30:
A.Data security
B.Derived columns
Answer Report Discuss
Option: D
Explanation :
1. Home
3. Database MCQ
31:
B.Naïve users.
C. Stand-alone users.
Answer Report Discuss
Option: B
Explanation :
A.External
B.Internal
C. Physical
D Conceptual
.
Answer Report Discuss
Option: A
Explanation :
33:
Which are the two ways in which entities can participate in a relationship?
Answer Report Discuss
Option: B
Explanation :
34:
The result of the UNION operation between R1 and R2 is a relation that includes
Answer Report Discuss
Option: C
Explanation :
35:
A.Attribute
B.Degree.
C. Tuple.
D Domain.
.
Answer Report Discuss
Option: D
Explanation :
1. Home
3. Database MCQ
36:
Which of the operations constitute a basic set of operations for manipulating relational data?
A.Predicate calculus
B.Relational calculus
C. Relational algebra
Answer Report Discuss
Option: C
Explanation :
37:
A.Child
B.Owner
C. Dominant
Answer Report Discuss
Option: A
Explanation :
38:
A.Base table
B.Index
C. View
Answer Report Discuss
Option: C
Explanation :
39:
NULL is
D Not a value
.
Answer Report Discuss
Option: D
Explanation :
40:
A.Network Model
C. E-R Model
D None of these
.
Answer Report Discuss
Option: A
Explanation :
3. Database MCQ
41:
Answer Report Discuss
Option: D
Explanation :
42:
A file manipulation command that extracts some of the records from a file is called
A.SELECT
B.PROJECT
C. JOIN
D PRODUCT
.
Answer Report Discuss
Option: A
Explanation :
43:
Answer Report Discuss
Option: A
Explanation :
44:
A.Ellipse
B.Dashed ellipse
C. Rectangle
D Triangle
.
Answer Report Discuss
Option: B
Explanation :
45:
Cross Product is a:
A.Unary Operator
B.Ternary Operator
C. Binary Operator
D Not an operator
.
Answer Report Discuss
Option: C
Explanation :
1. Home
3. Database MCQ
46:
An instance of relational schema R (A, B, C) has distinct values of A including NULL values. Which one
of the following is true?
C. A is a primary Key
Answer Report Discuss
Option: B
Explanation :
Click on Discuss to view users comments.
47:
Consider the join of a relation R with relation S. If R has m tuples and S has n tuples, then the
maximum size of join is:
A.mn
B.m+n
C. (m+n)/2
D 2(m+n)
.
Answer Report Discuss
Option: A
Explanation :
48:
A.Cartesian Product
Answer Report Discuss
Option: C
Explanation :
49:
Answer Report Discuss
Option: C
Explanation :
50:
Answer Report Discuss
Option: A
Explanation :
1. Home
3. Database MCQ
A.Ellipse
B.Dashed ellipse
C. Rectangle
D Diamond
.
Answer Report Discuss
Option: D
Explanation :
52:
A.Tree structure
B.Plex Structure
C. Normalize Structure
D Table Structure
.
Answer Report Discuss
Option: A
Explanation :
53:
A.Ellipse
B.Dashed ellipse
C. Rectangle
D Triangle
.
Answer Report Discuss
Option: D
Explanation :
54:
A.Direct
B.Hash
C. Random
D Sequential
.
Answer Report Discuss
Option: B
Explanation :
55:
A.Join
B.Self Join
C. Outer Join
D Equi Join
.
Answer Report Discuss
Option: B
Explanation :
Click on Discuss to view users comments
1. Home
3. Database MCQ
51:
A.Ellipse
B.Dashed ellipse
C. Rectangle
D Diamond
.
Answer Report Discuss
Option: D
Explanation :
52:
A.Tree structure
B.Plex Structure
C. Normalize Structure
D Table Structure
.
Answer Report Discuss
Option: A
Explanation :
53:
A.Ellipse
B.Dashed ellipse
C. Rectangle
D Triangle
.
Answer Report Discuss
Option: D
Explanation :
54:
A.Direct
B.Hash
C. Random
D Sequential
.
Answer Report Discuss
Option: B
Explanation :
55:
A table joined with itself is called
A.Join
B.Self Join
C. Outer Join
D Equi Join
.
Answer Report Discuss
Option: B
Explanation :
1. Home
3. Database MCQ
56:
Consider a relational table with a single record for each registered student with the following
attributes.
1. Registration Num: Unique registration of each registered student.
2. UID Unique identity number, unique at the national level for each citizen.
3. Name: Name of the student.
4. BanIcAccount Num: Unique account number at the bank. A student can have multiple account or
joint accounts. This attribute stores the primary account number.
5. Hostel_Room: Room number ofhe hostel.
Which ofthe following option is INCORRECT?
Answer Report Discuss
Option: A
Explanation :
57:
The following functional dependencies hold for relation R(A, B, C) and S(B, D, E) B —> A, A —> C , the
relation R contains 200 tuples and relation S contains 100 tuples. What is maximum number of tuples
possibles in natural join R and S ?
A.100
B.200
C. 300
D 400
.
Answer Report Discuss
Option: A
Explanation :
58:
A.Tree
B.Graph
C. Linked List
Answer Report Discuss
Option: A
Explanation :
59:
In the relational model, the number of attributes and number of tuples iri a relation are termed as
__________and ______________respectively
A.Cardinality, domain
B.Degree, cardinality
C. Domain degree
D Cardinality, degree
.
Answer Report Discuss
Option: B
Explanation :
60:
A.Row
B.Column
C. Table
Answer Report Discuss
Option: B
Explanation :
3. Database MCQ
61:
A.Ease of searching
D None of these
.
Answer Report Discuss
Option: C
Explanation :
62:
In context with relational Algebra. Which of the following are unary operatiors.
1.Select
2. Project
3. Union
4. Product
C. 1 and 2 only
Answer Report Discuss
Option: C
Explanation :
63:
Let R is a relation schema, R(A, B, C, D) and F = {A —> B, B --> C, C —> A) is the set of functional
dependency. Determine the key of relation ?
A.A
B.B
C. C
DD
.
Answer Report Discuss
Option: D
Explanation :
2. Key must include all attributes but can not be on RHS of any functional
dependency i.e Only fields on RHS are determined.
4. REST must include all attributes but NOT on LHS They don't determine anything
so they can not be part of key.
64:
Which of the following statement is correct?
Answer Report Discuss
Option: A
Explanation :
65:
Given the basic ER and relational model which of the following is incorrect?
D In row of a relational table, an attribute can have exactly one vlaue or a NULL value.
.
Answer Report Discuss
Option: C
Explanation :
1. Home
3. Database MCQ
66:
It is desired to design an object-oriented employee record system for a company. Each employee has
a name, unique id and salary. Employees belong to diferent categories and their salary is determined
by their category. The functions geName, getld and compute Salary are required. Given the class
hierachy below, possible locations for these functions are:
(i) getld is implemented in the superclass
(ii) getld is implemented in the subclass
(iii) getName is an abstract funciton in the superclass
(iv) getName is implemented in the superclass.
(v) getName is implemented in the subclass
(vi) getSalary is an abstract function in the superclas
(vii) getSalary is implemented in the superclass
(viii) getSalary is implemented in the subclass.
Answer Report Discuss
Option: A
Explanation :
Click on Discuss to view users comments.
67:
Let r be a relation instance with schema R = (A, B, C, D). We define r1 =∏ A,B,C (r) and r2 = ∏A, D (r)
Let S = r1* r2 where * denotes natural join. Given that the decomposition of r into r1 and r2 is lossy,
which one of the following is TRUE?
A.S ⊂ r
B.r ∪ s = r
C. r ⊂ s
D r*s = s
.
Answer Report Discuss
Option: C
Explanation :
68:
Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are
two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. RI and R2 do
not have any attributes of their own. What is the minimum number of tables required to represent
this situation in the relational model?
A.2
B.3
C. 4
D5
.
Answer Report Discuss
Option: B
Explanation :