SQL Tough
SQL Tough
SQL Tough
a) Image
b) Text
c) Table
d) Graph
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
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 //
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
User
8. The relation with the attribute which is the primary key is referenced in
another relation. The relation which has the attribute as a primary key is called
______________
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
View Answer
Answer: c
Explanation: None.
9. The ______ is the one in which the primary key of one relation is used as a
normal attribute in another relation.
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
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
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.
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
6.
WITH max_budget (VALUE) AS
(SELECT MAX(budget)
FROM department)
SELECT budget
FROM department, max_budget
WHERE department.budget = MAX budget.value;
In the query given above which one of the following is a temporary relation?
a) Budget
b) Department
c) Value
d) Max_budget
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
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
9. Which of the following is used to get back all the transactions back after
rollback?
a) Commit
b) Rollback
c) Flashback
d) Redo
10. Which of the following statements creates a new table temp instructor that has
the same schema as an instructor.
a) create table temp_instructor;
b) Create table temp_instructor like instructor;
c) Create Table as temp_instructor;
d) Create table like temp_instructor;
4. 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
https://www.sanfoundry.com/database-mcqs-authorizations/
4.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
5. Which of the following function is used to find the column count of the
particular resultset?
a) getMetaData().getColCount()
b) Metadata()
c) getColumn()
d) get Count()
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
9. The functions which construct histograms and use buckets for ranking is
a) Rank()
b) Newtil()
c) Ntil()
d) None of the mentioned
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
17.
If attributes A and B determine attribute C, then it is also true that:
A → C.
B → C.
(A,B) is a composite determinant.
C is a determinant.
4.
When assessing the table structure of an acquired set of tables with data,
accessing the validity of possible referential integrity constraints on foreign
keys is (part of) the:
first step.
second step.
third step.
fourth step.
14.
When assessing the table structure of an acquired set of tables with data, counting
the number of table rows is (part of) the:
first step.
second step.
third step.
fourth step.
6.
When assessing the table structure of an acquired set of tables with data,
determining foreign keys is (part of) the:
first step.
second step.
third step.
fourth step.
If a table has been normalized so that all determinants are candidate keys, then
that table is in:
1NF.
2NF.
3NF.
BCNF.
20.
The benefits of a standard relational language include which of the following?
Reduced training costs
Increased dependence on a single vendor
Applications are not needed.
All of the above.
23.
When three or more AND and OR conditions are combined, it is easier to use the SQL
keyword(s):
LIKE only.
IN only.
NOT IN only.
Both IN and NOT IN.
32.
A subquery in an SQL SELECT statement:
can only be used with two tables.
can always be duplicated by a join.
has a distinct form that cannot be duplicated by a join.
cannot have its results sorted using ORDER BY.
5. Which of these methods can be used to convert all characters in a String into a
character array?
a) charAt()
b) both getChars() & charAt()
c) both toCharArray() & getChars()
d) all of the mentioned
Answer: c
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.
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
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.
advertisement
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
Answer: c
Explanation: File scans are search algorithms that locate and retrieve records that
fulfill a selection condition.
2. In a ____________ the system scans each file block and tests all records to see
whether they satisfy the selection condition.
a) Index Search
b) Linear search
c) File scan
d) Access paths
View Answer
Answer: b
Explanation: An initial seek is required to access the first block of the file.
3. Index structures are referred to as __________ since they provide a path through
which data can be located and accessed.
a) Index Search
b) Linear search
c) File scan
d) Access paths
View Answer
Answer: d
Explanation: A primary index is an index that allows the records of a file to be
read in an order that corresponds to the physical order in the file.
advertisement
4. Search algorithms that use an index are referred to as
a) Index Search
b) Linear search
c) File scan
d) Access paths
View Answer
Answer: a
Explanation: Selection predicates are used to guide in the choice of the index to
use in processing the query.