Dbms 4
Dbms 4
1. Which SQL function is used to count the number of rows in a SQL query?(d)
a) COUNT()
b) NUMBER()
c) SUM()
d) COUNT(*)
3. Which of the following SQL clauses is used to DELETE tuples from a database
table?(a)
a) DELETE
b) REMOVE
c) DROP
d) CLEAR
4. ___________removes all rows from a table without logging the individual row
deletions.(d)
a) DELETE
b) REMOVE
c) DROP
d) TRUNCATE
8. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is
used by default ______________(a)
a) ASC
b) DESC
c) There is no default value
d) None of the mentioned
2. With SQL, how do you select all the records from a table named “Persons” where
the value of the column “FirstName” ends with an “a”?(c)
a) SELECT * FROM Persons WHERE FirstName=’a’
b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
d) SELECT * FROM Persons WHERE FirstName=’%a%’
3. With SQL, how can you return all the records from a table named “Persons” sorted
descending by “FirstName”?(d)
a) SELECT * FROM Persons SORT BY ‘FirstName’ DESC
b) SELECT * FROM Persons ORDER FirstName DESC
c) SELECT * FROM Persons SORT ‘FirstName’ DESC
d) SELECT * FROM Persons ORDER BY FirstName DESC
4. With SQL, how can you return the number of not null records in the “Persons”
table?(a)
a) SELECT COUNT() FROM Persons
b) SELECT COLUMNS() FROM Persons
c) SELECT COLUMNS(*) FROM Persons
3
10. How can you change “Hansen” into “Nilsen” in the “LastName” column in the
Persons table?(d)
a) UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
b) MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
c) MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
d) UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
1. Which of the following command makes the updates performed by the transaction
permanent in the database?(b)
a) ROLLBACK
b) COMMIT
c) TRUNCATE
d) DELETE
4
2. Which TCL command undo all the updates performed by the SQL in the
transaction?(b)
a) ROLLBACK
b) COMMIT
c) TRUNCATE
d) DELETE
6. Find the names of these cities with temperature and condition whose condition is
neither sunny nor cloudy.(a)
a) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’,
‘cloudy’)
b) SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN
(‘sunny’, ‘cloudy’)
c) SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’,
‘cloudy’)
d) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN
(‘sunny’, ‘cloudy’);
7. Find the name of those cities with temperature and condition whose condition is
either sunny or cloudy but temperature must be greater than 70.(c)
a) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND
condition = ‘cloudy’ OR temperature > 70
b) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR
condition = ‘cloudy’ OR temperature > 70
c) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR
condition = ‘cloudy’ AND temperature > 70
d) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND
condition = ‘cloudy’ AND temperature > 70
.
5
9. Find all the cities with temperature, condition and humidity whose humidity is in
the range of 63 to 79.(c)
a) SELECT * FROM weather WHERE humidity IN (63 to 79)
b) SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
c) SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
d) SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79
10. The command to remove rows from a table ‘CUSTOMER’ is _______ (d)
a) DROP FROM CUSTOMER
b) UPDATE FROM CUSTOMER
c) REMOVE FROM CUSTOMER
d) DELETE FROM CUSTOMER WHERE
1. What type of join is needed when you wish to include rows that do not have
matching values?(c)
a) Equi-join
b) Natural join
c) Outer join
d) All of the Mentioned
2. What type of join is needed when you wish to return rows that do have matching
values?(d)
a) Equi-join
b) Natural join
c) Outer join
d) All of the Mentioned
3. Which of the following is one of the basic approaches for joining tables?(d)
a) Subqueries
b) Union Join
c) Natural join
d) All of the Mentioned
d) Cartesian join
1. What is a view?(b)
a) A view is a special stored procedure executed when certain event occurs
b) A view is a virtual table which results of executing a pre-compiled query
c) A view is a database diagram
7
b) INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS
c) INFORMATION_SCHEMA.KEY_COLUMN_USAGE
d) sys.dm_exec_connections
1. Aggregate functions are functions that take a ___________ as input and return a
single value.(a)
a) Collection of values
b) Single value
c) Double value
d) All of the mentioned
2. SQL applies predicates in the _______ clause after groups have been formed, so
aggregate functions may be used.(b)
a) Group by
b) With
c) Where
d) Having
6. All aggregate functions except __________ ignore null values in their input
collection.(a)
a) Count(attribute)
b) Count(*)
9
c) Avg
d) Sum
7. A Boolean data type that can take values true, false, and ____________(d)
a) 1
b) 0
c) Null
d) Unknown
8. 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)
a)
b)
c)
SELECT course id
FROM SECTION
WHERE semester = 'Spring' AND YEAR= 2010);
d)
10. We can test for the nonexistence of tuples in a subquery by using the __________
construct.(b)
a) Not exist
b) Not exists
c) Exists
d) Exist
3. The command ________________ such tables are available only within the
transaction executing the query, and are dropped when the transaction finishes.(b)
a) Create table
b) Create temporary table
c) Create view
d) Create label view
8. Which of the following foreign key constraint specifies that the deletion fails with
an error?(a)
a) NO ACTION
b) CASCADE
c) SET NULL
d) All of the mentioned
Explanation: Constraints are Primary key, Foreign Key, Unique Key, Not Null, Check,
Default.
2. The ___________ normalization introduced by Chris Date, Hugh Darwen, and Nikos
Lorentzos.(d)
a) Third
b) Fourth
c) Fifth
d) Sixth
d) Multivalued Dependencies
7. Anomalies are avoided by splitting the offending relation into multiple relations, is
also known as(b)
a) Accupressure
b) Decomposition
c) Precomposition
d) Both Decomposition and Precomposition
8. Every time attribute A appears, it is matched with the same value of attribute B, but
not the same value of attribute C. Therefore, it is true that(a)
a) A -> B
b) A -> C
c) A -> (B,C)
d) (B,C) -> A
9. When the values in one or more attributes being used as a foreign key must exist
in another set of one or more attributes in another table, we have created a(n)(c)
a) Transitive Dependency
b) Insertion Anomaly
c) Referential Integrity Constraint
d) Normal Form
6. A Key which is a set of one or more columns that can identify a record uniquely is
called?(b)
a) Natural key
b) Candidate key
c) Not Null key
d) Alternate key
4. E-R model uses this symbol to represent weak entity set ?(c)
a) Dotted rectangle
b) Diamond
c) Doubly outlined rectangle
d) None of the Mentioned
7. Identify the criteria for designing database from the point of view of user(d)
a) No redundancy
b) No inapplicable attributes
c) Uniformity in naming & definitions of the data items
d) All of the Mentioned
8. The relational model is based on the concept that data is organized and stored in
two-dimensional tables called _____________(b)
a) Fields
b) Records
c) Relations
d) Keys
3. In SQL, which command is used to SELECT only one copy of each set of
duplicable rows(a)
17
a) SELECT DISTINCT
b) SELECT UNIQUE
c) SELECT DIFFERENT
d) All of the Mentioned
4. A command that lets you change one or more fields in a record is(b)
a) Insert
b) Modify
c) Look-up
d) All of the Mentioned
7. Table Employee has 10 records. It has a non-NULL SALARY column which is also
UNIQUE.
The SQL statement
SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY
FROM EMPLOYEE);
prints
a) 10
b) 9
c) 5
d) 0
Answer: b
10. Let the statement : SELECT column1 FROM myTable; return 10 rows.(c)
The statement : SELECT ALL column1 FROM myTable; will return
a) less than 10 rows
b) more than 10 rows
c) exactly 10 rows
d) none of the Mentioned
6. ___________ defines rules regarding the values allowed in columns and is the
standard mechanism for enforcing database integrity.(b)
a) Column
19
b) Constraint
c) Index
d) Trigger
9. Which command is used for removing a table and all its data from the database(b)
a) Create command
b) Drop table command
c) Alter table command
d) All of the Mentioned
10. Which command allows the removal of all rows from a table but flushes a table
more efficiently since no rollback information is retained(a)
a) TRUNCATE command
b) Create command
c) Drop table command
d) Alter table command
1. The language used application programs to request data from the DBMS is
referred to as __________(a)
a) DML
b) DDL
c) Query language
d) All of the Mentioned
9. A type of query that is placed within a WHERE or HAVING clause of another query
is called(b)
a) Master query
b) Sub query
c) Super query
d) Multi-query
10. The three language components of a database management system (DBMS) like
DDL, DCL, DML.
Two different types of people (users and practitioners) are concerned with them.
Which of them do users of a DBMS usually deal with?(b)
a) DDL
b) DML
c) DDL and DCL
21
4. In an SQL statement, which of the following parts states the conditions for row
selection?(a)
a) Where
b) From
c) Order By
d) Group By
6. Which of the following keyword is used with Data Control Language (DCL)
statements?(d)
a) SELECT
b) INSERT
c) DELETE
d) GRANT
a) DCL
b) DML
c) DDL
d) All of the Mentioned
10. To obtain the structure of an Oracle table, the command to use is(b)
a) STRUCTURE [TableName].
b) DESCRIBE [TableName].
c) DESCRIBE STRUCTURE [TableName].
d) DESC TABLE [TableName].
a) Data
b) Database
c) Database design
d) Data modeling
4. The database design prevents some data from being represented due to
_______(b)
a) Deletion anomalies
b) Insertion anomalies
c) Update anomaly
d) None of the mentioned
d) Decomposition
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(c)
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
10. Which server can join the indexes when only multiple indexes combined can
cover the query(a)
a) SQL
b) DBMS
c) RDBMS
d) All of the mentioned
2. The time factor when determining the efficiency of an algorithm is measured by(b)
a) Counting microseconds
b) Counting the number of key operations
c) Counting the number of statements
d) Counting the kilobytes of algorithm
b) Worst case
c) Average case
d) Null case
b) Deductive
c) Physical
d) Network
3. Which of the following schemas does define a view or views of the database for
particular users?(d)
a) Internal schema
b) Conceptual schema
c) Physical schema
d) External schema
4. Which of the following is an attribute that can uniquely identify a row in a table?(b)
a) Secondary key
b) Candidate key
c) Foreign key
d) Alternate key
5. Which of the following are the process of selecting the data storage and data
access characteristics of the database?(b)
a) Logical database design
b) Physical database design
c) Testing and performance tuning
d) Evaluation and selecting
6. Which of the following terms does refer to the correctness and completeness of
the data in a database?(d)
a) Data security
b) Data constraint
c) Data independence
d) Data integrity
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(d)
a) Consistent state
29
b) Parallel state
c) Durable state
d) Inconsistent state
3. With multiple disks, we can improve the transfer rate as well by ___________ data
across multiple disks.(a)
a) Striping
b) Dividing
c) Mirroring
d) Dividing
5. The RAID level which mirroring is done along with stripping is(d)
a) RAID 1+0
b) RAID 0
c) RAID 2
d) Both RAID 1+0 and RAID 0
6. Where performance and reliability are both important, RAID level ____ is used.(d)
a) 0
b) 1
c) 2
d) 0+1
30
7. ______________ partitions data and parity among all N+1 disks, instead of storing
data in N-disks and parity in one disk.(b)
a) Block interleaved parity
b) Block interleaved distributed parity
c) Bit parity
d) Bit interleaved parity
8. Hardware RAID implementations permit _________ that is, faulty disks can be
removed and replaced by new ones without turning power off.(c)
a) Scrapping
b) Swapping
c) Hot swapping
d) None of the mentioned
10. ______________ which increases the number of I/O operations needed to write a
single logical block, pays a significant time penalty in terms of write performance.(a)
a) RAID level 1
b) RAID level 2
c) RAID level 5
d) RAID level 3
1. A_____ is a query that retrieves rows from more than one table or view(c)
a) Start
b) End
c) Join
d) All of the mentioned
3. Which oracle is the join condition is specified using the WHERE clause(c)
a) Oracle 9i
b) Oracle 8i
c) Pre-oracle 9i
d) Pre-oracle 8i
b) 3
c) 4
d) 5
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN.
Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN are the types
of joins.
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(b)
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
10. Which view that contains more than one table in the top-level FROM clause of the
SELECT statement(c)
a) Join view
b) Datable join view
c) Updatable join view
d) All of the mentioned
1. A relational database system needs to maintain data about the relations, such as
the schema of the relations. This is called(a)
32
a) Metadata
b) Catalog
c) Log
d) Dictionary
2. Relational schemas and other metadata about relations are stored in a structure
called the ____________(d)
a) Metadata
b) Catalog
c) Log
d) Data Dictionary
8. An Oracle __________ is a set of tables and views that are used as a read-only
reference about the database.(c)
a) Database dictionary
33
b) Dictionary table
c) Data dictionary
d) Dictionary
10. An Oracle object type has two parts the _________ and__________(c)
a) Instance and body
b) Segment and blocks
c) Specification and body
d) Body and segment