0% found this document useful (0 votes)
23 views

Query Processing Techniques

Uploaded by

Mr. Phekdey
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Query Processing Techniques

Uploaded by

Mr. Phekdey
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 18

9.

Query Processing Techniques


=== Query Processing
1. A collection of data designed to be used by different people is called a/an
a) Organization
b) Database
c) Relationship
d) Schema
View Answer

Answer: b
Explanation: Database is a collection of related tables.
2. Which of the following is the oldest database model?
a) Relational
b) Deductive
c) Physical
d) Network
View Answer

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.
Note: Join free Sanfoundry classes at Telegram or Youtube
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.
7. The relationship between DEPARTMENT and EMPLOYEE is a
a) One-to-one relationship
b) One-to-many relationship
c) Many-to-many relationship
d) Many-to-one relationship
View Answer

Answer: b
Explanation: One entity department is related to several employees.
8. A table can be logically connected to another table by defining a
a) Super key
b) Candidate key
c) Primary key
d) Unique key
View Answer

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.
10. Ensuring isolation property is the responsibility of the
a) Recovery-management component of the DBMS
b) Concurrency-control component of the DBMS
c) Transaction-management component of the DBMS
d) Buffer management component in DBMS
View Answer

Answer: b
Explanation: Concurrency control ensures that correct results for concurrent
operations are generated while getting those results as quickly as possible.

=== Selection Operation


1. In query processing, the ___________ is the lowest-level operator to access
data.
a) Index Search
b) Linear search
c) File scan
d) Access paths
View Answer

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.
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.
5. Which algorithm uses equality comparison on a key attribute with a primary index
to retrieve a single record that satisfies the corresponding equality condition.
a) A2
b) A4
c) A5
d) A6
View Answer

Answer: a
Explanation: A2 – primary index, equality on key.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
6. The strategy can retrieve a single record if the equality condition is on a key;
multiple records may be retrieved if the indexing field is not a key is
a) A2
b) A4
c) A5
d) A6
View Answer

Answer: b
Explanation: A4 – Secondary index, equality.
7. The algorithm that uses a secondary ordered index to guide retrieval for
comparison conditions involving <,≤,≥, or > is
a) A2
b) A4
c) A5
d) A6
View Answer

Answer: d
Explanation: A6 – Secondary index, comparison.
8. The ___ algorithm scans each index for pointers to tuples that satisfy an
individual condition.
a) A2
b) A4
c) A9
d) A6
View Answer

Answer: c
Explanation: A9 – Conjunctive selection by an intersection of identifiers.
9. If access paths are available on all the conditions of a disjunctive selection,
each index is scanned for pointers to tuples that satisfy the individual condition.
This is satisfied by
a) A10
b) A7
c) A9
d) A6
View Answer

Answer: a
Explanation: A10 – Disjunctive selection by union of identifiers.
10. Conjunctive selection using one index. This is
a) A10
b) A7
c) A9
d) A6
View Answer

Answer: b
Explanation: To reduce the cost of A7 we choose a i and one of algorithms A1
through A6 for which the combination results in the least cost for i (r ). The cost
of algorithm A7 is given by the cost of the chosen algorithm.

=== Sorting
1. Two main measures for the efficiency of an algorithm are
a) Processor and memory
b) Complexity and capacity
c) Time and space
d) Data and space
View Answer

Answer: c
Explanation: Depending on the time and space complexity only the algorithm for
sorting will be chosen.
2. The time factor when determining the efficiency of an algorithm is measured by
a) Counting microseconds
b) Counting the number of key operations
c) Counting the number of statements
d) Counting the kilobytes of algorithm
View Answer

Answer: b
Explanation: The operations taking place with the time and space is counted.
3. The space factor when determining the efficiency of an algorithm is measured by
a) Counting the maximum memory needed by the algorithm
b) Counting the minimum memory needed by the algorithm
c) Counting the average memory needed by the algorithm
d) Counting the maximum disk space needed by the algorithm
View Answer

Answer: a
Explanation: Time complexity maintains the maximum time needed.
4. Which of the following case does not exist in complexity theory
a) Best case
b) Worst case
c) Average case
d) Null case
View Answer

Answer: d
Explanation: Null case cannot be counted as the factor for complexity.
5. The Worst case occur in linear search algorithm when
a) Item is somewhere in the middle of the array
b) Item is not in the array at all
c) Item is the last element in the array
d) Item is the last element in the array or is not there at all
View Answer

Answer: d
Explanation: Algorithmic complexity is concerned about how fast or slow particular
algorithm performs.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
6. The Average case occur in linear search algorithm
a) When Item is somewhere in the middle of the array
b) When Item is not in the array at all
c) When Item is the last element in the array
d) When Item is the last element in the array or is not there at all
View Answer

Answer: a
Explanation: Algorithmic complexity is concerned about how fast or slow particular
algorithm performs.
7. The complexity of the average case of an algorithm is
a) Much more complicated to analyze than that of worst case
b) Much more simpler to analyze than that of worst case
c) Sometimes more complicated and some other times simpler than that of worst case
d) None of the mentioned
View Answer

Answer: a
Explanation: Algorithmic complexity is concerned about how fast or slow particular
algorithm performs.
8. The complexity of a linear search algorithm is
a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)
View Answer

Answer: a
Explanation: It refers to n values complexity in the algorithm which can be reduced
by choosing the other algorithms.
9. The complexity of Binary search algorithm is
a) O(n)
b) O(log )
c) O(n2)
d) O(n log n)
View Answer

Answer: b
Explanation: This shows that it has a standard complexity in addressing.
10. The complexity of Bubble sort algorithm is
a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)
View Answer

Answer: c
Explanation: Bubble sort, is a simple sorting algorithm that works by repeatedly
stepping through the list to be sorted, comparing each pair of adjacent items and
swapping them if they are in the wrong order.

=== 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.
2. A condition is referred to as __________
a) Join in SQL
b) Join condition
c) Join in SQL & Condition
d) None of the mentioned
View Answer

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”.
4. How many join types in join condition:
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: d
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN.
5. 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: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN are the types
of joins.
Subscribe Now: DBMS Newsletter | Important Subjects Newsletters
6. Which product is returned in a join query have no join condition:
a) Equijoins
b) Cartesian
c) Both Equijoins and Cartesian
d) None of the mentioned
View Answer

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.
7. Which is a join condition contains an equality operator:
a) Equijoins
b) Cartesian
c) Both Equijoins and Cartesian
d) None of the mentioned
View Answer

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.
9. Which operation are allowed in a join view:
a) UPDATE
b) INSERT
c) DELETE
d) All of the mentioned
View Answer

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.

=== Evaluation of Expressions


1. Pictorial representation of an expression is called
a) Expression tree
b) Operator tree
c) Expression flow
d) Expression chart
View Answer

Answer: b
Explanation: The operator tree has a tree like format where the evaluation starts
from root of the tree.
2. The results of each intermediate operation are created and then are used for
evaluation of the next-level operations. This is called
a) Materialized evaluation
b) Expression evaluation
c) Tree evaluation
d) Tree materialization
View Answer

Answer: a
Explanation: The cost of a materialized evaluation is not simply the sum of the
costs of the operations involved.
3. ______________ allows the algorithm to execute more quickly by performing CPU
activity in parallel with I/O activity.
a) Buffering
b) Double buffering
c) Multiple buffering
d) Double reading
View Answer

Answer: a
Explanation: Double buffering using two buffers, with one continuing execution of
the algorithm while the other is being written out.
4. Pipelines can be executed in
a) 4
b) 3
c) 2
d) 5
View Answer

Answer: c
Explanation: Demand driven and producer driven pipelines are the two ways.
5. In a _________ the system makes repeated requests for tuples from the operation
at the top of the pipeline.
a) Demand-driven pipeline
b) Producer-driven pipeline
c) Demand pipeline
d) All of the mentioned
View Answer

Answer: a
Explanation: Each time that an operation receives a request for tuples, it computes
the next tuple (or tuples) to be returned, and then returns that tuple.
Subscribe Now: DBMS Newsletter | Important Subjects Newsletters
6. In a _____________ operations do not wait for requests to produce tuples, but
instead generate the tuples eagerly.
a) Demand-driven pipeline
b) Producer-driven pipeline
c) Demand pipeline
d) All of the mentioned
View Answer

Answer: b
Explanation: Each operation in a producer-driven pipeline is modeled as a separate
process or thread within the system that takes a stream of tuples from its
pipelined inputs and generates a stream of tuples for its output.
7. Each operation in a demand-driven pipeline can be implemented as an ____ that
provides the following functions: open(), next(), and close().
a) Demand
b) Pipeline
c) Iterator
d) All of the mentioned
View Answer

Answer: c
Explanation: After a call to open(), each call to next() returns the next output
tuple of the operation.
8. The iterator maintains the __________ of its execution in between calls so that
successive next() requests receive successive result tuples.
a) State
b) Transition
c) Rate
d) Block
View Answer

Answer: a
Explanation: The function close() tells an iterator that no more tuples are
required.
9. Tuples are generated ___________ in producer-driven pipelining, they are
generated ________ on demand, in demand-driven pipelining.
a) Lazily, Eagerly
b) Eagerly, Lazily
c) Slowly, Eagerly
d) Eagerly, Slowly
View Answer

Answer: b
Explanation: Producer-driven pipelining is very useful in parallel processing
systems.
10. When two inputs that we desire to pipeline into the join are not already sorted
it is the _____________ technique.
a) Hash join
b) Buffer join
c) double-pipelined hash join
d) double-pipelined join
View Answer

Answer: d
Explanation: When hash indices are used on tuples, the resultant algorithm is
called the double-pipelined hash-join technique.

=== Transformation of Relational Expressions


1. Consider the following relational schemes for a library database:

Book (Title, Author, Catalog_no, Publisher, YEAR, Price)


Collection (Title, Author, Catalog_no)
WITH the following functional dependencies:
I. Title Author -> Catalog_no
II. Catalog_no -> Title Author Publisher YEAR
III. Publisher Title YEAR -> Price
Assume {Author, Title} is the key for both schemes. Which of the following
statements is true?
a) Both Book and Collection are in BCNF
b) Both Book and Collection are in 3NF only
c) Book is in 2NF and Collection is in 3NF
d) Both Book and Collection are in 2NF only
View Answer

Answer: c
Explanation: The relation Collection is in BCNF: Its given that {Author, Title} is
the key and there is only one functional dependency (FD) applicable to the relation
Collection {i.e. Title Author –> Catalog_no}.
2. 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
The relation schema R is
a) in BCNF
b) in 3NF, but not in BCNF
c) in 2NF, but not in 3NF
d) not in 2NF
View Answer

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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
3. Which of the following is/are false for RAW mode of FOR XML?
a) XMLSCHEMA option does not returns an in-line XSD schema
b) BINARY BASE32 returns the binary data in base32-encoded format
c) Each row in the query result is transformed into an XML element
d) None of the mentioned
View Answer

Answer: b
Explanation: XML was designed to transport and store data.
4. ___________ refers to the ability of the system to recover committed transaction
updates if either the system or the storage media fails.
a) Isolation
b) Atomicity
c) Consistency
d) Durability
View Answer

Answer: d
Explanation: In database systems, durability is the ACID property which guarantees
that transactions that have committed will survive permanently.
5. Which utilities can we use to export data from sql server to a text file?
a) DTS export wizard
b) BCP
c) ISQL
d) DTS export wizard and BCP
View Answer

Answer: d
Explanation: The bcp utility bulk copies data between an instance of Microsoft SQL
Server and a data file in a user-specified format.
6. You have a column that will only contain values from 0 to 256. What is the most
economical data type to use for the column?
a) TINYINT
b) SMALLINT
c) INT
d) DECIMAL(1)
View Answer

Answer: b
Explanation: The bcp utility bulk copies data between an instance of Microsoft SQL
Server and a data file in a user-specified format.
7. Problems occurs if we don’t implement a proper locking strategy
a) Dirty reads
b) Phantom reads
c) Lost updates
d) Unrepeatable reads
View Answer

Answer: b
Explanation: Phantom reads occur when an insert or delete action is performed
against a row that belongs to a range of rows being read by a transaction.
8. Which of the following fixed database roles can add or remove user IDs?
a) db_accessadmin
b) db_securityadmin
c) db_setupadmin
d) db_sysadmin
View Answer

Answer: a
Explanation: The db_accessadmin role manages security, but handles access to the
database, as the name implies.
9. By default sql server has ___________ isolation level
a) READ COMMITTED
b) READ UNCOMMITTED
c) SERIALIZABLE
d) REPEATABLE READ
View Answer
Answer: a
Explanation: READ UNCOMMITTED is the most optimistic concurrency isolation option
available in SQL Server.
10. Which of the following pair of regular expression are not equivalent?
a) 1(01)* and (10)*1
b) x(xx)* and (xx)*x
c) (ab)* and a*b*
d) x+ and x*x+
View Answer

Answer: c
Explanation: (ab)*=(a*b*)*.
Sanfoundry Global Education &

=== Estimating Statistics of Expression Results


1. Which feature converts row data to a column for better analytical view?
a) Views
b) Join
c) Pivot
d) Trigger
View Answer

Answer: c
Explanation: Pivot table is very powerful and very easy to use.
2. Which of the following statements is/are not true for SQL profiler?
a) Enables you to monitor events
b) Check if rows are being inserted properly
c) Check the performance of a stored procedure
d) None of the mentioned
View Answer

Answer: c
Explanation: Stored procedures are like functions which do not return values.
3. Which global variables can be used to determine if a transaction is still open?
a) @@NESTLEVEL
b) @@FETCH_STATUS
c) @@TRANCOUNT
d) @@CONNECTIONS
View Answer

Answer: c
Explanation: PRINT @@TRANCOUNT — The BEGIN TRAN statement will increment the —
transaction count by 1.
4. Which statement is used to define a cursor?
a) OPEN
b) FETCH
c) DECLARE CURSOR
d) @@FETCH_STATUS
View Answer

Answer: c
Explanation: A database cursor is a control structure that enables traversal over
the records in a database.
5. What is the default “SORT” order for a SQL?
a) Ascending
b) Descending
c) As specified by the user
d) None of the mentioned
View Answer

Answer: a
Explanation: Default is ascending order.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
6. Capabilities of RAISERROR
a) It can be logged in the error log
b) It can print a message to the application
c) It can assign an error number, state and severity
d) All of the mentioned
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.
7. How inserting data through stored procedure do reduces network traffic and
increase database performance?
a) Stored procedure can accept parameter
b) Permission check is not required
c) The execution plan is stored in the cache after it was executed the first time
d) None of the mentioned
View Answer

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.
8. Stored procedures are safe from SQL injection attacks
a) True
b) False
c) Depends on the result
d) Always safe
View Answer

Answer: a
Explanation: Injection attack is not possible in SP.
9. Which of the following connection type supports application role permissions and
password encryption?
a) OLE DB
b) DBLib
c) ODBC
d) OLE DB and ODBC
View Answer

Answer: d
Explanation: Open Database Connectivity (ODBC) is Microsoft’s strategic interface
for accessing data in a heterogeneous environment of relational.
10. Cursor that reflects the changes made to the database table even after the
result set is returned
a) Static
b) Dynamic
c) FORWARD_ONLY
d) Keyset
View Answer

Answer: b
Explanation: A database cursor is a control structure that enables traversal over
the records in a database

=== 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.
4. Which one of the following statements about normal forms is FALSE?
a) BCNF is stricter than 3NF
b) Lossless, dependency-preserving decomposition into 3NF is always possible
c) Lossless, dependency-preserving decomposition into BCNF is always possible
d) Any relation with two attributes is in BCNF
View Answer

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:

Note: Join free Sanfoundry classes at Telegram or Youtube


F1->F3
F2->F4
(F1,F2)->F5
in terms of normalization, this table is in
a) 1NF
b) 2NF
c) 3NF
d) None of the mentioned
View Answer

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.
6. Which of the following is TRUE?
a) Every relation in 2NF is also in BCNF
b) A relation R is in 3NF if every non-prime attribute of R is fully functionally
dependent on every key of R
c) Every relation in BCNF is also in 3NF
d) No relation can be in both BCNF and 3NF
View Answer

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.
7. Consider the following functional dependencies in a database.

Date_of_Birth->Age Age->Eligibility
Name->Roll_number Roll_number->Name
Course_number->Course_name Course_number->Instructor
(Roll_number, Course_number)->Grade
The relation (Roll_number, Name, Date_of_birth, Age) is
a) In second normal form but not in third normal form
b) In third normal form but not in BCNF
c) In BCNF
d) None of the mentioned
View Answer

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.
10. Which one of the following statements is FALSE?
a) Any relation with two attributes is in BCNF
b) A relation in which every key has only one attribute is in 2NF
c) A prime attribute can be transitively dependent on a key in a 3 NF relation
d) A prime attribute can be transitively dependent on a key in a BCNF relation
View Answer

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.

=== Advanced Query Optimization


1. _______________ is a procedural extension of Oracle – SQL that offers language
constructs similar to those in imperative programming languages.
a) SQL
b) PL/SQL
c) Advanced SQL
d) PQL
View Answer

Answer: b
Explanation: PL/SQL is an imperative 3GL that was designed specifically for the
seamless processing of SQL commands.
2. ___________ combines the data manipulating power of SQL with the data processing
power of Procedural languages.
a) PL/SQL
b) SQL
c) Advanced SQL
d) PQL
View Answer

Answer: a
Explanation: PL/SQL is an imperative 3GL that was designed specifically for the
seamless processing of SQL commands.
3. _______________ has made PL/SQL code run faster without requiring any additional
work on the part of the programmer.
a) SQL Server
b) My SQL
c) Oracle
d) SQL Lite
View Answer

Answer: c
Explanation: An Oracle database is a collection of data treated as a unit. The
purpose of a database is to store and retrieve related information.
4. A line of PL/SQL text contains groups of characters known as
a) Lexical Units
b) Literals
c) Textual Units
d) Identifiers
View Answer

Answer: a
Explanation: Lexical items can be generally understood to convey a single meaning,
much as a lexeme, but are not limited to single words.
5. We use ______________ name PL/SQL program objects and units.
a) Lexical Units
b) Literals
c) Delimiters
d) Identifiers
View Answer

Answer: d
Explanation: The database object name is referred to as its identifier.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate
Now!
6. A ___________________ is an explicit numeric, character, string or Boolean value
not represented by an identifier.
a) Comments
b) Literals
c) Delimiters
d) Identifiers
View Answer

Answer: b
Explanation: The terms literal and constant value are synonymous and refer to a
fixed data value.
7. If no header is specified, the block is said to be an _______________ PL/SQL
block.
a) Strong
b) Weak
c) Empty
d) Anonymous
View Answer

Answer: d
Explanation: The terms literal and constant value are synonymous and refer to a
fixed data value.
8. _________________ is a sequence of zero or more characters enclosed by single
quotes.
a) Integers literal
b) String literal
c) String units
d) String label
View Answer

Answer: b
Explanation: The terms literal and constant value are synonymous and refer to a
fixed data value.
9. In _______________ the management of the password for the account can be handled
outside of oracle such as operating system.
a) Database Authentication
b) Operating System Authentication
c) Internal Authentication
d) External Authentication
View Answer

Answer: b
Explanation: Database management involves the monitoring, administration, and
maintenance of the databases and database groups in your enterprise.
10. In ________________ of Oracle, the database administrator creates a user
account in the database for each user who needs access.
a) Database Authentication
b) Operating System Authentication
c) Internal Authentication
d) External Authentication
View Answer

Answer: a
Explanation: Database management involves the monitoring, administration, and
maintenance of the databases and database groups in your enterprise.

You might also like