0% found this document useful (0 votes)
22 views25 pages

Ansi SQL MCQ QB 2

Uploaded by

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

Ansi SQL MCQ QB 2

Uploaded by

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

Action Question Bank Sub Bank Difficulty

Level
ADD Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Medium

ADD Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Medium

ADD Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Difficult

ADD Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Difficult

ADD Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Medium

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy


ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_Joins Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Difficult
ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Medium

ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Medium

ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy
ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy
ADD
Assesment_2_ANSI_SQL ANSISQL_Conts_Ops Easy
ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Easy
ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Easy
ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_Joins Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Medium

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Easy

ADD
Assesment_2_ANSI_SQL ANSISQL_DDL_DML Medium
ADD
Assesment_2_ANSI_SQL ANSISQL_Subqs_View_Index Medium
ADD
Question Instructions

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.
Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.
Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.
Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.
Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.

Please read the question carefully and choose the most appropriate option.
Question Text Question Choice1 Choice2
Type
Statement 1: A subquery is also called an inner query or inner MCQ Only statement 1 Only statement 2
select, while the statement containing a subquery is also called an
outer query or outer select.

Statement 2: A subquery can be nested inside the WHERE or


HAVING clause of an outer SELECT, INSERT, UPDATE, or DELETE
statement, or inside another subquery.

Which of the above statements are TRUE?

A query is called correlated subquery when both the inner query MCQ 1 0
and the outer query are interdependent.

State whether the above statement is TRUE or FALSE.

Statement 1: If a subquery is not dependent on the outer query it is MCQ Only statement 1 Only statement 2
called a non-correlated subquery.

Statement 2: Subqueries cannot be used with the comparison


operators.

Which of the above statements are TRUE?

An index helps speed up SELECT queries and WHERE clauses, but it MCQ 1 0
slows down data input, with UPDATE and INSERT statements.

State whether the above statement is TRUE or FALSE.

MCQ An inline view A subquery exists


exists only inside only inside of the
Which of the given options are TRUE? of the FROM FROM clause as a
clause as a run- run-time
time result set.

To remove duplicate rows from the result set of a SELECT use the MCQ NO DUPLICATE UNIQUE
following keyword:

Which of the following can add a row to a table? MCQ Add Insert

Which SQL statement is used to insert a new data in a database? MCQ INSERT INTO UPDATE

In a LIKE clause, you can could ask for any value ending in "qpt" by MCQ LIKE %qpt LIKE *ton
writing
In a LIKE clause, you can ask for any 6 letter value by writing? MCQ LIKE ?????? LIKE .{6} Answer 5:
LIKE ^.{6}$

The result of a SELECT statement can contain duplicate rows. MCQ 1 0

A table may be joined to itself. MCQ 1 0

Which of the following is not a valid aggregate function? MCQ COUNT MIN

What SQL clause is used to restrict the rows returned by a query? MCQ AND WHERE

Primary Key does allow the Null Values. where as in MCQ 1 0


Unique key doesn't accept the Null values.
State whether the statement is true or false
Which of the following commands should be used to create a MCQ CREATE ?I CREATE
database named “student”? student DATABASE
student
Which one will delete the table data as well as table structure? MCQ TRUNCATE DROP

A SELECT command without a WHERE clause returns? MCQ All the records All the records
from a table that from a table, or
match the information about
previous WHERE all the records
clause

MCQ

The SQL ALTER


TABLE clause is The SQL ALTER
used to insert TABLE deletes
data into data from
What does the ALTER TABLE clause do? database table. database table.
MCQ
Can you use combination of GROUP BY clause,HAVING clause
and WHERE clause SQL clauses in one SQL statement? 1 0
MCQ

The primary key


is a column or
combination of
The primary columns whose
key is a column values uniquely
that can have identify each
What is a primary key? NULL values. row in the table.
MCQ

The AS SQL
clause is used to
change the
name of a
column in the
The AS clause result set or to
defines a assign a name to
search a derived
What is the purpose of the SQL AS clause? condition column.
MCA

You can use


aggregate
functions only in
You can use the column list
aggregate of the SELECT
functions in any clause and in the
clause of a WHERE clause of
SELECT a SELECT
Which two are true about aggregate functions?(Choose two) statement. statement.
MCQ
Which clause should you use to exclude group results? WHERE HAVING
MCQ

SELECT
CustomerName
,
COUNT(Custom SELECT
erName) FROM CustomerName,
Orders ORDER COUNT(Custome
BY rName) FROM
Which of the following SQL statements is correct? CustomerName Orders
MCQ
create a new delete a table
table in the from the
The SQL DROP TABLE clause is used to... database database
MCQ
we are using left
we are joining and right join
We refer to a join as a self-join when? table to itself together
MCQ

returns all rows


that have
matching value
in the field on
which the 2
returns all rows tables are
The INNER JOIN clause… from 2 tables joined.
MCQ
If table A have 10 rows and table B have 5 rows, how many
rows will be returned if you perform a cartesian join on those
two tables? 5 50
MCQ
Which syntax would be used to retrieve all rows in both the
EMPLOYEES and DEPARTMENTS tables, even when there is
no match? Outer join Inner join
MCQ
Constraints add Constraints
a level of ensure data
The main reason that constraints are added to a table is: complexity integrity
MCQ
To automatically delete rows in a child table when a parent ON DELETE SET ON DELETE
record is deleted use: NULL ORPHAN
A table can have more than one UNIQUE key constraint. True MCQ
or False? 1 0
A column defined as NOT NULL can have a DEFAULT value of MCQ
NULL. True or False? 1 0
A table must have at least one not null constraint and one MCQ
unique constraint. True or False? 1 0
The ___________ join is the ANSI-standard syntax used to MCQ
generate a Cartesian product. NATURAL ALL
In the relational model, relationships between relations or MCQ composite
tables are created by using: keys. determinants.
MCA
The ORDER BY
The sort is in clause comes
ascending last in the
Which two statements are true regarding the ORDER BY order by SELECT
clause? (Choose two) default. statement.
MCQ

You can join a


maximum of You can join a
What is true about joining tables through an equijoin? two tables maximum of two
through an columns through
equijoin. an equijoin.
MCQ

The CUSTOMERS table has these columns:


CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
STREET_ADDRESS VARCHAR2(150)
CITY_ADDRESS VARCHAR2(50)
STATE_ADDRESS VARCHAR2(50)
PROVINCE_ADDRESS VARCHAR2(50)
COUNTRY_ADDRESS VARCHAR2(50)
POSTAL_CODE VARCHAR2(12)
CUSTOMER_PHONE VARCHAR2(20) WHERE WHERE
A sale is being advertised to the customers in France. Which lower(country_ lower(country_a
WHERE clause address) = ddress) =
identifies customers that are located in France? 'france' "france"
MCQ

SQL can be used to: Modify the create database


database structures only.
MCQ

UPDATE UPDATE
employees employees
SET first_name SET first_name =
Examine the structure of the EMPLOYEES table: = 'John', 'John',
EMPLOYEE_ID NUMBER Primary Key SET last_name last_name
FIRST_NAME VARCHAR2(25) ='Smith' ='Smith'
LAST_NAME VARCHAR2(25) WHERE WHERE
HIRE_DATE DATE employee_id = employee_id =
Which UPDATE statement is valid? 180; 180;
MCQ
limits the
column data limits the row
that are data are
The SQL WHERE clause: returned. returned.
MCQ
ON UPDATE CASCADE ensures which of the following? Normalization data Integrity
Which of the following is valid SQL for an Index? MCQ CREATE INDEX CHANGE INDEX
ID; ID;
Choice3 Choice4 Choice5 Grade1 Grade2 Grade3 Grade4 Grade5

Both statement 1 and statement 2 0 0 1 0

None of the
listed
options
1 0

Both statement 1 and statement 2 1 0 0 0

None of the
listed
options
1 0

An inline view exists only inside of All listed 1 0 0 0


the WHERE clause as a run-time options
result set.

DISTINCT None of the 0 0 1 0


listed options

Update Alter 0 1 0 0

ADD INSERT NEW 1 0 0 0

LIKE ton$ LIKE ^.*ton$ 1 0 0 0


LIKE ...... (that's six dots) LIKE ______ 0 0 0 1
(that's six
underscore
characters)

1 0

1 0

MAX COMPUTE 0 0 0 1

HAVING FROM 0 1 0 0

0 1

DATABASE /student DATABSE 0 1 0 0


student

REMOVE DISTINCT 0 1 0 0

SELECT is invalid without a WHERE Nothing 0 1 0 0


clause

The SQL
ALTER TABLE
The SQL ALTER TABLE clause clause is
modifies a table definition by used to
altering, adding, or deleting delete a
table columns and/or database
constraints. table 0 0 1 0

1 0

The primary key column is a


column or combination of
columns whose values can be
non-unique. 0 1 0
The AS clause is used with the
JOIN clause only. 0 1 0

You can pass


column
names,
expressions,
constants, or
You can mix single row columns functions as
with aggregate functions in the parameters
column list of a SELECT to an
statement by grouping on the aggregate
single row columns. function. 0 0 1 1

RESTRICT GROUP BY 0 1 0 0

SELECT CustomerName,
COUNT(CustomerName) FROM
Orders GROUP BY
CustomerName 0 0 1

modify an existing table in a


database 0 1 0

we are joining more than 2


tables 1 0 0
returns only the rows from the
first table, which have non-
matching values with the
second table in the field on
which the 2 tables are joined. 0 1 0

10 15 0 1 0 0

Self join Natural join 1 0 0 0

None of the
Constraints gives programmers listed
job security options 0 1 0 0

None of the
listed
ON DELETE CASCADE options 0 0 1 0

1 0

0 1

0 1

FULL CROSS 0 0 0 1
foreign keys.
candidate keys 0 0 0 1

The ORDER
BY clause is
executed on
The sort is in descending order the client
by default side 1 1 0 0
All listed
options

You can join n tables (all having


single column primary keys) in a
SQL statement by specifying a
minimum of n-1 join conditions.

0 0 1 0
WHERE lower(country_address)
IS 'france' None 1 0 0 0

All the listed


operation
can be done
query database data only. by SQL. 0 0 0 1

UPDATE
employees
SET
first_name =
'John'
SET
last_name
UPDATE employees ='Smith'
SET first_name = 'John' WHERE
AND last_name ='Smith' employee_id
WHERE employee_id = 180; = 180; 0 1 0 0

limits the rows & coloumns


returned NONE 0 1 0 0

Materialized View None 0 1 0 0


REMOVE
ADD INDEX ID; INDEX ID; 1 0 0 0
Answer Description Question Answer Author Reviewer Custom Category - Other
Media Media Properties
TEXT TEXT Razia
(261746)

TEXT TEXT Razia


(261746)

TEXT TEXT Razia


(261746)

TEXT TEXT Razia


(261746)

TEXT TEXT Razia


(261746)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)

TEXT TEXT shashidhar(1


24294)
TEXT TEXT shashidhar(1
24294)

You might also like