0% found this document useful (0 votes)
16 views33 pages

Dbms 4

The document consists of a series of SQL-related questions and answers covering various topics such as SQL functions, commands, joins, views, and aggregate functions. It includes multiple-choice questions that test knowledge on SQL syntax and concepts. The content serves as a quiz or study guide for individuals learning SQL.

Uploaded by

zmd141479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views33 pages

Dbms 4

The document consists of a series of SQL-related questions and answers covering various topics such as SQL functions, commands, joins, views, and aggregate functions. It includes multiple-choice questions that test knowledge on SQL syntax and concepts. The content serves as a quiz or study guide for individuals learning SQL.

Uploaded by

zmd141479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

1

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(*)

2. Which SQL keyword is used to retrieve a maximum value?(c)


a) MOST
b) TOP
c) MAX
d) UPPER

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

5. Which of the following is not a DDL command?(a)


a) UPDATE
b) TRUNCATE
c) ALTER
d) None of the Mentioned

6. Which of the following are TCL commands?(d)


a) UPDATE and TRUNCATE
b) SELECT and INSERT
c) GRANT and REVOKE
d) ROLLBACK and SAVEPOINT

7. ________________ is not a category of SQL command.(b)


a) TCL
b) SCL
c) DCL
d) DDL
2

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

9. Which of the following statement is true?(a)


a) DELETE does not free the space containing the table and TRUNCATE free the space
containing the table
b) Both DELETE and TRUNCATE free the space containing the table
c) Both DELETE and TRUNCATE does not free the space containing the table
d) DELETE free the space containing the table and TRUNCATE does not free the space
containing the table

10. What is the purpose of the SQL AS clause?(a)


a) The AS SQL clause is used to change the name of a column in the result set or to assign
a name to a derived column
b) The AS clause is used with the JOIN clause only
c) The AS clause defines a search condition
d) All of the mentioned

1. What does DML stand for?(d)


a) Different Mode Level
b) Data Model Language
c) Data Mode Lane
d) Data Manipulation language

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

d) SELECT COUNT(*) FROM Persons

5. What does the ALTER TABLE clause do?(a)


a) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting
table columns and/or constraints
b) The SQL ALTER TABLE clause is used to insert data into database table
c) THE SQL ALTER TABLE deletes data from database table
d) The SQL ALTER TABLE clause is used to delete a database table

6. The UPDATE SQL clause can _____________(b)


a) update only one row at a time
b) update more than one row at a time
c) delete more than one row at a time
d) delete only one row at a time

7. The UNION SQL clause can be used with _____________(a)


a) SELECT clause only
b) DELETE and UPDATE clauses
c) UPDATE clause only
d) All of the mentioned

8. Which SQL statement is used to return only different values?(c)


a) SELECT DIFFERENT
b) SELECT UNIQUE
c) SELECT DISTINCT
d) SELECT ALL

9. Which SQL keyword is used to sort the result-set?(a)


a) ORDER BY
b) SORT
c) ORDER
d) SORT BY

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

3. SQL query to find all the cities whose humidity is 95.(b)


a) SELECT city WHERE humidity = 95
b) SELECT city FROM weather WHERE humidity = 95
c) SELECT humidity = 89 FROM weather
d) SELECT city FROM weather

4. SQL query to find the temperature in increasing order of all cities.(d)


a) SELECT city FROM weather ORDER BY temperature
b) SELECT city, temperature FROM weather
c) SELECT city, temperature FROM weather ORDER BY temperature
d) SELECT city, temperature FROM weather ORDER BY city

5. What is the meaning of LIKE ‘%0%0%’?(d)


a) Feature begins with two 0’s
b) Feature ends with two 0’s
c) Feature has more than two 0’s
d) Feature has two 0’s in it, at any position

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

8. Find all the tuples having a temperature greater than ‘Paris’.(a)


a) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather
WHERE city = ‘Paris’
b) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE
city = ‘Paris’)
c) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE
city = ‘Paris’)
d) SELECT * FROM weather WHERE temperature > ‘Paris’ temperature

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

4. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,


ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T
WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID?(a)
a) Equi-join
b) Natural join
c) Outer join
6

d) Cartesian join

5. A UNION query is which of the following?(c)


a) Combines the output from no more than two queries and must include the same number
of columns
b) Combines the output from no more than two queries and does not include the same
number of columns
c) Combines the output from multiple queries and must include the same number of
columns
d) Combines the output from multiple queries and does not include the same number of
columns

6. Which of the following statements is true concerning subqueries?(a)


a) Involves the use of an inner and outer query
b) Cannot return the same result as a query that is not a subquery
c) Does not start with the word SELECT
d) All of the mentioned

7. Which of the following is a correlated subquery?(a)


a) Uses the result of an inner query to determine the processing of an outer query
b) Uses the result of an outer query to determine the processing of an inner query
c) Uses the result of an inner query to determine the processing of an inner query
d) Uses the result of an outer query to determine the processing of an outer query

8. How many tables may be included with a join?(d)


a) One
b) Two
c) Three
d) All of the Mentioned

9. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,


ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T?(d)
a) Equi-join
b) Natural join
c) Outer join
d) Cartesian join

10. Which is not a type of join in T-SQL?(b)


a) Equi-join
b) Natural join
c) Outer join
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

d) None of the Mentioned

2. Which of the following is not a limitation of view?(b)


a) ORDER BY Does Not Work
b) Index Created on View Used Often
c) Cross Database Queries Not Allowed in Indexed View
d) Adding Column is Expensive by Joining Table Outside View

3. Which of the following statement is true?(d)


a) Views could be looked as an additional layer on the table which enables us to protect
intricate or sensitive data based upon our needs
b) Views are virtual tables that are compiled at run time
c) Creating views can improve query response time
d) All of the Mentioned

4. SQL Server has mainly how many types of views?(b)


a) one
b) two
c) three
d) four

5. Dynamic Management View is a type of ___________(a)


a) System Defined Views
b) User Defined View
c) Simple View
d) Complex View

6. Syntax for creating views is __________(a)


a) CREATE VIEW AS SELECT
b) CREATE VIEW AS UPDATE
c) DROP VIEW AS SELECT
d) CREATE VIEW AS UPDATE

7. You can delete a view with ___________ command.(a)


a) DROP VIEW
b) DELETE VIEW
c) REMOVE VIEW
d) TRUNCATE VIEW

8. What is SCHEMABINDING a VIEW?(b)


a) Schema binding binds your views to the dependent physical columns of the accessed
tables specified in the contents of the view
b) These are stored only in the Master database
c) These types of view are defined by users on a specified schema
d) These are used to show database self describing information

9. Which of the following is not a SQL Server INFORMATION_SCHEMA view?(d)


a) INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
8

b) INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS
c) INFORMATION_SCHEMA.KEY_COLUMN_USAGE
d) sys.dm_exec_connections

10. ___________ is stored only in the Master database.(d)


a) Database-scoped Dynamic Management View
b) Complex View
c) Catalog View
d) None of the mentioned

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

3. The ________ keyword is used to access attributes of preceding tables or


subqueries in the from clause.(b)
a) In
b) Lateral
c) Having
d) With

4. Which of the following is not an aggregate function?(c)


a) Avg
b) Sum
c) With
d) Min

5. If we do want to eliminate duplicates, we use the keyword __________in the


aggregate expression.(a)
a) Distinct
b) Count
c) Avg
d) Primary key

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)

SELECT DISTINCT course id


FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009 AND
course id NOT IN (SELECT course id FROM SECTION WHERE semester = ’Spring’ AND
YEAR= 2010);

b)

SELECT DISTINCT course_id


FROM instructor
WHERE name NOT IN (’Fall’, ’Spring’);

c)

SELECT course id
FROM SECTION
WHERE semester = 'Spring' AND YEAR= 2010);

d)

SELECT COUNT (DISTINCT ID)


FROM takes
WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id,
semester, YEAR
FROM teaches
WHERE teaches.ID= 10101);

Explanation: Aggregate function can be used inside nested subqueries.

9. The phrase “greater than at least one” is represented in SQL by ______(d)


a) < all
b) < some
c) > all
d) > some
10

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

1. The EXISTS keyword will be true if ____________(a)


a) Any row in the subquery meets the condition only
b) All rows in the subquery fail the condition only
c) Both of these two conditions are met
d) Neither of these two conditions is met

2. Which of the following is an aggregate function?(b)


a) Average
b) Sum
c) With
d) Minimum

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

5. 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.(b)
a) Where, having
b) Having, where
c) Group by, having
d) Group by, where

6. Which is the duplication of computer operations and routine backups to combat


any unforeseen problems?(d)
a) Concurrency
b) Deadlock
c) Backup
d) Recovery

7. The UNION SQL clause can be used with ____________(a)


a) SELECT clause only
b) DELETE and UPDATE clauses
c) UPDATE clause only
d) All of the mentioned
11

9. Which of the following statement is true?(a)


a) DELETE does not free the space containing the table and TRUNCATE free the space
containing the table
b) Both DELETE and TRUNCATE free the space containing the table
c) Both DELETE and TRUNCATE does not free the space containing the table
d) DELETE free the space containing the table and TRUNCATE does not free the space
containing the table

1. Which of the following is not a class of constraint in SQL Server?(c)


a) NOT NULL
b) CHECK
c) NULL
d) UNIQUE
.

2. Point out the correct statement.(d)


a) CHECK constraints enforce domain integrity
b) UNIQUE constraints enforce the uniqueness of the values in a set of columns
c) In a UNIQUE constraint, no two rows in the table can have the same value for the
columns
d) All of the mentioned

3. Which of the following constraint does not enforce uniqueness?(c)


a) UNIQUE
b) Primary key
c) Foreign key
d) None of the mentioned

4. Constraints can be applied on ___________(d)


a) Column
b) Table
c) Field
d) All of the mentioned

5. Point out the wrong statement.(d)


a) Table constraints must be used when more than one column must be included in a
constraint
b) A column constraint is specified as part of a column definition and applies only to that
column
c) A table constraint is declared independently from a column definition and can apply to
more than one column in a table
d) Primary keys allow for NULL as one of the unique values

6. Purpose of foreign key constraint in SQL Server is __________(a)


a) FOREIGN KEY constraints identify and enforce the relationships between tables
b) A foreign key in one table points to a candidate key in another table
c) You cannot insert a row with a foreign key value, except NULL, if there is no candidate
12

key with that value


d) None of the mentioned

7. Which of the following is not a foreign key constraint?(b)


a) NO ACTION
b) CASCADE
c) SET NULL
d) All of the mentioned

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

9. How many types of constraints are present in SQL Server?(c)


a) 4
b) 5
c) 6
d) 7

Explanation: Constraints are Primary key, Foreign Key, Unique Key, Not Null, Check,
Default.

10. Which of the constraint can be enforced one per table?(a)


a) Primary key constraint
b) Not Null constraint
c) Foreign Key constraint
d) Check constraint

1. A table is in BCNF if it is in 3NF and if every determinant is a ___________ key.(c)


a) Dependent
b) Normal
c) Candidate
d) Both Normal and Candidate

2. The ___________ normalization introduced by Chris Date, Hugh Darwen, and Nikos
Lorentzos.(d)
a) Third
b) Fourth
c) Fifth
d) Sixth

3. A table is in 3NF if it is in 2NF and if it has no ____________(b)


a) Functional Dependencies
b) Transitive Dependencies
c) Trivial Functional Dependency
13

d) Multivalued Dependencies

4. Every constraint on the table is a logical consequence of the table’s(c)


a) Fourth normal form
b) Fifth normal form
c) Domain/key normal form
d) None of the Mentioned

5. A ___________ is an indirect functional dependency, one in which X->Z only by


virtue of X->Y and Y->Z.(d)
a) Multivalued Dependencies
b) Join Dependency
c) Trivial Functional Dependency
d) Transitive Dependencies

6. In a given relationship R, if an attribute A uniquely defines all other attributes, then


the attribute A is a key attribute which is also known as the _________ key.(a)
a) Candidate
b) Join
c) Functional
d) None of the Mentioned

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

10. Which of the following is not a restriction for a table to be a relation?(c)


a) The cells of the table must contain a single value
b) All of the entries in any column must be of the same kind
c) The columns must be ordered
14

d) No two rows in a table may be identical

1. How can a SQL developer add a key on a table?(d)


a) While creating a table
b) With Alter table command
c) With SQL server Properties window
d) All of the Mentioned

2. A _______________ key is a minimal super key(c)


a) Primary
b) Foreign
c) Candidate
d) Non-Prime

3. Which of the following is not a Key in SQL Server?(d)


a) Primary
b) Foreign
c) Alternate
d) Secondary

4. What is true about Unique and primary key?(b)


a) Unique can have multiple NULL values but Primary can’t have.
b) Unique can have single NULL value but Primary can’t have even single.
c) Both can have duplicate values
d) None of the Mentioned

5. By default, which key creates Clustered index?(c)


a) Foreign Key
b) Unique Key
c) Primary Key
d) None of the Mentioned

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

7. Which key accepts multiple NULL values?(a)


a) Foreign Key
b) Unique Key
c) Primary Key
d) None of the Mentioned

8. A Foreign key is combined with a foreign key creates(a)


a) Parent child relationship between the tables that connect them
15

b) Many-Many relationship between the tables that connect them


c) Network model between the tables that connect them
d) None of the Mentioned

9. Which of the following statements is not correct?(b)


a) The primary key must be unique for a given table
b) Specifying a zero (0) for the lower bound for the association multiplicity on a class
diagram indicates that the item is required
c) Specifying a one (1) for the lower bound for the association multiplicity on a class
diagram indicates that the item is required
d) Most databases allow multiple records that are identical

10. In a database, a foreign key is ?(c)


a) A data element/attribute within a data field of a data record that is not unique, and cannot
be used to distinguish one data record in a database from another data record within a
database table
b) A data element/attribute within a data field of a data record within a database table that is
a secondary key in another database table
c) A data element/attribute within a data field of a data record within a database table that is
a primary key in another database table
d) A data element/attribute within a data field of a data record that enables a database to
uniquely distinguish one data record in a database from another data record within a
database table

1. In an E-R diagram an entity set is represent by a (a)


a) Rectangle
b) Ellipse
c) Diamond box
d) Circle

2. A relational database developer refers to a record as (c)


a) A criteria
b) A relation
c) A tuple
d) An attribute

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

5. Which of the following is record based logical model?(a)


a) Network Model
b) Object oriented model
c) E-R Model
d) None of the Mentioned
16

6. A ___________ normal form normalization will be needed where all attributes in a


relation tuple are not functionally dependent only on the key attribute.(c)
a) First
b) Second
c) Third
d) Fourth

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

9. An aggregation association is drawn using which symbol(c)


a) a line which loops back onto the same table
b) small closed diamond at the end of a line connecting two tables
c) small open diamond at the end of a line connecting two tables
d) small triangle at the end of a line connecting the aggregated item and multiple
component items

10. An n-array relationship is drawn using which symbol(a)


a) A diamond
b) A line with arrows showing direction
c) A line without arrows showing direction
d) A rectangle

1. What is the full form of SQL?(a)


a) Structured Query Language
b) Structured Query List
c) Simple Query Language
d) None of the Mentioned

2. Which is the subset of SQL commands used to manipulate Oracle Database


structures, including tables?(a)
a) Data Definition Language(DDL)
b) Data Manipulation Language(DML)
c) DDL and DML
d) None of the Mentioned

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

5. Which of the SQL statements is correct?(b)


a) SELECT Username AND Password FROM Users
b) SELECT Username, Password FROM Users
c) SELECT Username, Password WHERE Username = ‘user1’
d) None of the Mentioned

6. The SQL statement(b)


SELECT SUBSTR(‘123456789’, INSTR(‘abcabcabc’, ‘b’), 4) FROM DUAL;
a) 6789
b) 2345
c) 1234
d) 456789

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

8. Find the temperature in increasing order of all cities(c)


a) SELECT city FROM weather ORDER BY temperature;
b) SELECT city, temperature FROM weather;
c) SELECT city, temperature FROM weather ORDER BY temperature;
d) SELECT city, temperature FROM weather ORDER BY city;
18

9. Which of the following is illegal?(d)


a) SELECT SYSDATE – SYSDATE FROM DUAL;
b) SELECT SYSDATE – (SYSDATE – 2) FROM DUAL;
c) SELECT SYSDATE – (SYSDATE + 2) FROM DUAL;
d) None of the Mentioned

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

1. Which is the subset of SQL commands used to manipulate Oracle Database


structures, including tables?(a)
a) Data Definition Language(DDL)
b) Data Manipulation Language(DML)
c) DML and DDL
d) None of the Mentioned

2. Which of the following is/are the DDL statements?(d)


a) Create
b) Drop
c) Alter
d) All of the Mentioned

3. In SQL, which command(s) is(are) used to change a table’s storage


characteristics?(a)
a) ALTER TABLE
b) MODIFY TABLE
c) CHANGE TABLE
d) All of the Mentioned

4. In SQL, which of the following is not a data definition language commands?(a)


a) RENAME
b) REVOKE
c) GRANT
d) UPDATE

5. ________clause is an additional filter that is applied to the result.(c)


a) Select
b) Group-by
c) Having
d) Order by

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

7. SQL has how many main commands for DDL(c)


a) 1
b) 2
c) 3
d) 4

Explanation: Create, Delete, Alter these are 3 main command.

8. Which command defines its columns, integrity constraint in create table(a)


a) Create command
b) Drop table command
c) Alter table command
d) All of the Mentioned

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

2. In SQL, which of the following is not a data Manipulation Language Commands?(b)


a) Delete
b) Truncate
c) Update
d) Create

3. Which of the following is not a type of SQL statement?(d)


a) Data Manipulation Language (DML)
b) Data Definition Language (DDL)
c) Data Control Language (DCL)
20

d) Data Communication Language (DCL)

4. Which of the following is not included in DML (Data Manipulation Language)(d)


a) INSERT
b) UPDATE
c) DELETE
d) CREATE

5. TRUNCATE statement in SQL is a –(b)


a) DML statement
b) DDL statement
c) DCL statement
d) TCL statement

6. In SQL, which command is used to add new rows to a table?(c)


a) Alter Table
b) Add row
c) Insert
d) Append

7. Stack is also called __________(b)


a) First In First Out (LIFO)
b) Last In First Out (FIFO)
c) First In Last Out (FILO)
d) First Come First Served (FCFS)

8. A table that displays data redundancies yields ____________ anomalies.(d)


a) Update
b) Insertion
c) Deletion
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

d) DCL and DML

1. DCL stands for (a)


a) Data Control Language
b) Data Console Language
c) Data Console Level
d) Data Control Level

2. TCL stands for(a)


a) Transaction control languages
b) Transaction command languages
c) Transaction connect languages
d) None of the Mentioned

3. _________commands in SQL allow controlling access to data within database.(c)


a) Database
b) Data
c) Data control
d) All of the Mentioned

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

5. A transaction completes its execution is said to be(a)


a) Committed
b) Aborted
c) Rolled back
d) Failed

6. Which of the following keyword is used with Data Control Language (DCL)
statements?(d)
a) SELECT
b) INSERT
c) DELETE
d) GRANT

7. DCL Provides Commands To Perform Actions Like _____________(c)


a) Change The Structure Of Tables
b) Insert, Update Or Delete Records And Data Values
c) Authorizing Access And Other Control Over Database
d) None of the Mentioned

8. The Database Language That Allows You To Access Or Maintain Data In A


Database(a)
22

a) DCL
b) DML
c) DDL
d) All of the Mentioned

9. A Database Language Concerned With The Definition Of The Whole Database


Structure And Schema Is ________(c)
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].

1. _______________ joins are SQL server default(b)


a) Outer
b) Inner
c) Equi
d) None of the Mentioned

2. The ________________ is essentially used to search for patterns in target string.(a)


a) Like Predicate
b) Null Predicate
c) In Predicate
d) Out Predicate

3. Which of the following is/are the Database server functions?(a)


i) Data management
ii) Transaction management
iii) Compile queries
iv) Query optimization
a) i, ii, and iv only
b) i, ii and iii only
c) ii, iii and iv only
d) All i, ii, iii, and iv

4. To delete a database ___________ command is used.(c)


a) Delete database database_name
b) Delete database_name
c) drop database database_name
d) drop database_name
23

5. ____________ is a combination of two of more attributes used as a primary key(a)


a) Composite Key
b) Alternate Key
c) Candidate Key
d) Foreign Key

6. Which of the following is not the function of client?(b)


a) Compile queries
b) Query optimization
c) Receive queries
d) Result formatting and presentation
.

7. ____________ is a special type of stored procedure that is automatically invoked


whenever the data in the table is modified.(b)
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned

8. ______________ requires that data should be made available to only authorized


users.(c)
a) Data integrity
b) Privacy
c) Security
d) None of the Mentioned

9. Some of the utilities of DBMS are _____________(b)


i) Loading ii) Backup iii) File organization iv) Process Organization
a) i, ii, and iv only
b) i, ii and iii only
c) ii, iii and iv only
d) All i, ii, iii, and iv

10. ____________ allows individual row operation to be performed on a given result


set or on the generated by a selected by a selected statement.(c)
a) Procedure
b) Trigger
c) Curser
d) None of the Mentioned

1. Which s essential a business problem not a data problem(c)


a) Data
b) Database
c) Database design
d) All of the mentioned

2. Which is primarily the result of a thorough understanding of information about an


enterprise(d)
24

a) Data
b) Database
c) Database design
d) Data modeling

3. McFadden has defined normalization in his which book___________(c)


a) Database modern management
b) Management database of modern
c) Modern database management
d) Database management

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

5. How many types of insertion anomalies(b)


a) 1
b) 2
c) 3
d) 4

6. Who developed the normalization process(a)


a) E.F. codd
b) F.F. codd
c) E.E. codd
d) None of the mentioned

7. E.F.Codd developed the normalization process in the which early(b)


a) 1969
b) 1970
c) 1971
d) 1972

8. Which is a bottom-up approach to database design that design by examining the


relationship between attributes(c)
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition

9. Which is the process of breaking a relation into multiple relations(d)


a) Functional dependency
b) Database modeling
c) Normalization
25

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

1. Which is refers to a stalemate situation due to which no further progress is


possible as computer await response of each other(b)
a) Concurrency
b) Deadlock
c) Backup
d) Recovery

2. Which is a duplicate copy of a file program that is stored on a different storage


media than the original location(c)
a) Concurrency
b) Deadlock
c) Backup
d) Recovery

3. Which is the duplication of computer operations and routine backups to combat


any unforeseen problems(d)
a) Concurrency
b) Deadlock
c) Backup
d) Recovery

4. Optimization that is basically related to the rewriter module is termed as_______(a)


a) Semantic query optimization
b) Global query optimization
c) All of the Mentioned
d) None of the Mentioned

5. Optimization basically related to the Rewrite module is termed as_______(a)


a) Semantic query optimization
b) Global query optimization
c) All of the Mentioned
d) None of the Mentioned

6. Database security helps organizations to protect data from _____(b)


a) Internal users
b) External users
c) Non-external users
26

d) Non internal users

7. Copying files to secondary or specific devices is known as ______(b)


a) Retrieve
b) Backup
c) Recovery
d) Deadlock

8. How many types of recovery control techniques(a)


a) 2
b) 3
c) 4
d) 5

9. Which are types of recovery control techniques(c)


a) Deferred update
b) Immediate update
c) All of the Mentioned
d) None of the Mentioned

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

1. Two main measures for the efficiency of an algorithm are(c)


a) Processor and memory
b) Complexity and capacity
c) Time and space
d) Data and space

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

3. The space factor when determining the efficiency of an algorithm is measured


by(a)
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

4. Which of the following case does not exist in complexity theory(d)


a) Best case
27

b) Worst case
c) Average case
d) Null case

5. The Worst case occur in linear search algorithm when(d)


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

6. The Average case occur in linear search algorithm(a)


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

7. The complexity of the average case of an algorithm is(a)


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
.

8. The complexity of a linear search algorithm is(a)


a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)

9. The complexity of Binary search algorithm is(b)


a) O(n)
b) O(log )
c) O(n2)
d) O(n log n)

10. The complexity of Bubble sort algorithm is(c)


a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)

1. A collection of data designed to be used by different people is called a/an(b)


a) Organization
b) Database
c) Relationship
d) Schema

2. Which of the following is the oldest database model?(d)


a) Relational
28

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

7. The relationship between DEPARTMENT and EMPLOYEE is a(b)


a) One-to-one relationship
b) One-to-many relationship
c) Many-to-many relationship
d) Many-to-one relationship

8. A table can be logically connected to another table by defining a(c)


a) Super key
b) Candidate key
c) Primary key
d) Unique key

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

10. Ensuring isolation property is the responsibility of the(b)


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

1. Which level of RAID refers to disk mirroring with block striping?(a)


a) RAID level 1
b) RAID level 2
c) RAID level 0
d) RAID level 3

2. Optical disk technology uses(d)


a) Helical scanning
b) DAT
c) A laser beam
d) RAID

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

4. Which one of the following is a Stripping technique?(d)


a) Byte level stripping
b) Raid level stripping
c) Disk level stripping
d) Block level stripping

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

9. ___________ is popular for applications such as storage of log files in a database


system since it offers the best write performance.(a)
a) RAID level 1
b) RAID level 2
c) RAID level 0
d) RAID level 3

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

2. A condition is referred to as __________(b)


a) Join in SQL
b) Join condition
c) Join in SQL & Condition
d) None 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

4. How many join types in join condition(d)


a) 2
31

b) 3
c) 4
d) 5

Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN.

5. Which are the join types in join condition(d)


a) Cross join
b) Natural join
c) Join with USING clause
d) All of the mentioned

Explanation: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, EQUIJOIN are the types
of joins.

6. Which product is returned in a join query have no join condition(b)


a) Equijoins
b) Cartesian
c) Both Equijoins and Cartesian
d) None of the mentioned

7. Which is a join condition contains an equality operator(a)


a) Equijoins
b) Cartesian
c) Both Equijoins and Cartesian
d) None of the mentioned

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

9. Which operation are allowed in a join view(d)


a) UPDATE
b) INSERT
c) DELETE
d) All of the mentioned

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

3. ___________ is the collection of memory structures and Oracle background


processes that operates against an Oracle database.(b)
a) Database
b) Instance
c) Tablespace
d) Segment

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)
a) Tablespace
b) Segments
c) Extents
d) Blocks

5. A tablespace is further broken down into ________(b)


a) Tablespace
b) Segments
c) Extents
d) Blocks

6. __________ is a contiguous group of blocks allocated for use as part of a table,


index, and so forth.(c)
a) Tablespace
b) Segment
c) Extent
d) Block

7. ________ is the smallest unit of allocation in an Oracle database.(d)


a) Database
b) Instance
c) Tablespace
d) Database Block

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

Explanation: Data dictionary is also called as system catalog.

9. A data dictionary is created when a __________ created.(c)


a) Instance
b) Segment
c) Database
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

You might also like