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

SQL MCQ Set-2

Uploaded by

shajith rr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

SQL MCQ Set-2

Uploaded by

shajith rr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

SQL MCQ SET-2

Total points 82/100

FINAL MOCK

Name *

Mohammed Taj

Contact Number *

9360793877

Batch Code *

A9
SQL query to find the temperature in *0/1
increasing order of all cities.

SELECT city, temperature FROM weather


ORDER BY temperature

SELECT city, temperature FROM weather


ORDER BY city

SELECT city FROM weather ORDER BY


temperature

SELECT city, temperature FROM weather

Correct answer

SELECT city, temperature FROM weather


ORDER BY city

Which of the following is not a valid *1/1


datatype in SQL?

CHAR

NUMBER

VARCHAR

DATA
Which of the following terms *1/1
represents a COLUMN of a Database
table?

Field, Record

Attribute, Field

Tuple, Record

Tuple, Attribute

Which of the following type of join *1/1


returns a list of rows for which there
is a match in both of the specified
tables?

Self join

Full join

Inner join

Outer join
Which of the following constraint are *1/1
not present in SQL?

CANDIDATE KEY

UNIQUE

PRIMARY KEY

NOT NULL

SQL keywords are case sensitive. * 1/1

False

True

It is necessary to specify a *1/1


constraint for each column.

False

True
If min( ) function is used on a field *1/1
with non-numerical values, the
function returns that record which is
_________

Closest to alphabet Z

Closest to alphabet A

Closer to the previous Yeld value

Closer to the next Yeld value

Which character is used to separate *1/1


SQL statements in database
systems?

&
Which of the following terms *1/1
represents a ROW of a Database
table?

Attribute, Field

Field, Record

Tuple, Attribute

Tuple, Record

Which of the following cannot be *1/1


done using SQL?

Update multiple tables of a Database

Retrieve data from a Database

Delete records from a Database

Insert records into a Database


Which of the following is basis for *0/1
SQL?

Oracle

DBMS

RDBMS

SQL Server

Correct answer

RDBMS

Which of the following is not true *1/1


about tables?

It consists of Records known as Rows

It consists of Fields known as Columns

It is a Database Object

It is a collection of irrelevant data


entries
Where the specific information about *0/1
every record of a table is stored?

Record

Database Object

Field

Row

Correct answer

Field

In SQL, the DISTINCT clause ignores *1/1


NULL values.

False

True

Which of the following SQL *1/1


command(s) retrieves information
from a Database?

Select

Read

Recover

Update
ALL operator returns true if ______ * 1/1

Any one of the sub queries values doesn’t


satisYes the condition

All of the sub queries values doesn’t


satisYes the condition

All of the sub queries values satisfy the


condition

Any one of the sub queries values satisYes


the condition

Which type of join returns all the *1/1


records when there is a match in
either left or right table?

Full join

Self join

Cartesian join

Join
What is a Record? * 0/1

A record is a column

A record is each individual entry that exists


in a table

A record is a Vertical entity

A record is an entity that contains all


information associated with the Yelds of
a table

Correct answer

A record is each individual entry that exists


in a table

Using which command one can *1/1


delete existing data from database
without deleting the table?

Drop

Delete

Replace

Remove
Which SQL command is used to *1/1
modify data in a Database?

Update

Edit

Save

Modify

ANY and ALL operators must be *1/1


preceded by which of the following in
SQL?

Logical operators

Relational operators

Arithmetic operators

Bitwise operators
Self joins are used to ________ * 1/1

Compare values in a column with some


given value

Compare values in a column with other


values in the same column of the same
table

Compare values in a column with other


values in the other column of the other table

Compare values in a column with other


values in the same column of the other
table

Which of the following is necessary *1/1


for a SELF JOIN in SQL?

Emp

Alias

Order by

Group by
DISTINCT clause considers NULL as *1/1
________

A space character

Some default value

Zero value

A unique value

Which of the following can be used *1/1


with the ORDER BY clause in place of
column name?

Column position in the columns list

Row name

Table name

Attribute name

Aliases defined in the SELECT *1/1


Statement can be used in ORDER BY
Clause.

True

False
To insert new data into a database, *0/1
which of the following SQL command
is used?

Insert Into

Add New

Insert

New Data

Correct answer

Insert

In a query, JOIN condition can be *1/1


used for only one time.

True

False

Which command is used to eliminate *1/1


a table from a database?

Delete

Drop

Remove

Eliminate
Which of the following is used to *1/1
modify an existing table?

Alter

Modify

Update

Alter Table

To create a new table, which of the *1/1


following command is used?

Create

Create New Table

Create Table

Create New
To update all the records of a table, *1/1
which of the following clause is
omitted from an UPDATE statement?

Values

Where

Set

Modify All

SET keyword in an UPDATE *1/1


statement is used to ______

Modify records in a database

Modify a particular record in a database

Set new values to the particular column

Set new values to all the columns of a table


Which of the following is a valid SQL *1/1
command for an Index?

Add Index

Create Index copy

Remove Index

Change Index

Which of the following order is valid *1/1


in SQL?

Where, Having, Group By, Order By

Group By, Where, Having, Order By

Where, Group By, Having, Order By

Where, Group By, Order By, Having

A SELECT statement cannot contain *1/1


both WHERE and HAVING clauses in
a single query.

True

False
HAVING clause is used in *1/1
combination with which of the
following clause(s)?

Group by

Where

Select

Order by

ANY operator returns true if ______ * 1/1

all the subquery values meet the condition

any one of the subquery values meets


the condition

all the subquery values don’t meet the


condition

any one of the subquery values doesn’t


meet the condition
To construct a SELF JOIN, how many *0/1
times the same table is selected by a
SELECT statement?

Only once

Twice

More than two times

Thrice

Correct answer

Twice

Where the join condition should be *1/1


mentioned, if ON keyword is not used
in a query?

Where

Select

From

Join
Which keyword is used in conjunction *1/1
with DISTINCT keyword?

From

Select

Where

Group By

A column of a database table must *1/1


not contain duplicate values.

True

False

Which of the following cannot be *1/1


done using SQL?

Retrieve data from a Database

Insert records into a Database

Update multiple tables of a Database

Delete records from a Database


6. With SQL, how do you select all *1/1
fields from “Customers” table whose
country is NOT “Germany” and NOT
“USA”?

Select * from Customers where


not(country=’USA’ or
country=’Germany’);

Select * from Customers where not


country=’Germany’ and country=’USA’;

Select * from Customers where not


country=’USA’ and country=’Germany’;

Select * from Customers where


not(country=’USA’ and country=’Germany’);

Which of the following terms *1/1


represents a COLUMN of a Database
table?

Field, Record

Tuple, Record

Tuple, Attribute

Attribute, Field
Which of the following SQL *0/1
statement selects only unique values
from ‘section’ column of table
‘school’?

SELECT ALL DISTINCT section FROM


school;

SELECT DISTICT section FROM school;

SELECT *DISTINCT FROM school;

SELECT DISTINCT section FROM school;

Correct answer

SELECT DISTINCT section FROM school;

When more than one expression is *1/1


provided in the DISTINCT clause, the
query will retrieve _________

Unique values for any one of the expression

Unique combinations for the


expressions listed

All values for any one of the expression

All combinations for the expressions listed


When three or more AND and OR *0/1
conditions are combined, which
keyword is used to replace the query
simple?

In

AND OR

Between

Like

Correct answer

In

Which of the following terms *1/1


represents a ROW of a Database
table?

Attribute, Field

Tuple, Record

Tuple, Attribute

Field, Record
RDBMS stands for _______ * 1/1

Related Database Management System

Relational Database Management


System

Relative Database Management System

Relatively Database Management System

When a date field is used in min( ) *1/1


function, it returns _________

Latest date

Date with earliest day irrespective of month


and year

Date with latest day irrespective of month


and year

Earliest date
If one or more columns are there in a *1/1
SELECT statement in addition to the
SUM or AVG function, these columns
need to be a part of _______

Having clause

Group By clause

Order By clause

Where clause

Which of the following is basis for *1/1


SQL?

DBMS

RDBMS

SQL Server

Oracle
Which of the following statements is *1/1
true concerning subqueries?

Does not start with the word SELECT

Involves the use of an inner and outer


query

Cannot return the same result as a query


that is not a subquery

All of the mentioned

The data in RDBMS is stored in ______ * 1/1

Database Object

SQL Object

SQL Server

Database server

Which of the following is not true *1/1


about tables?

It is a collection of irrelevant data


entries

It is a Database Object

It is a Database Objectset

It consists of Records known as Rows


Which of the following cannot be *1/1
used as an argument for SUM
function? ( Column1 and column2 are
numeric fields of a table)

Column1*4

Column1 + Column2

Column1

The following SQL is which type of *1/1


join:
SELECT CUSTOMER_T.
CUSTOMER_ID, ORDER_T.
CUSTOMER_ID, NAME, ORDER_ID
FROM CUSTOMER_T,ORDER_T ;

Natural join

Outer join

Equi-join

Cartesian join
Where the specific information about *0/1
every record of a table is stored?

Field

Row

Record

Database Object

Correct answer

Field

What is a Record? * 0/1

A record is a Vertical entity

A record is a column

A record is each individual entry that exists


in a table

A record is an entity that contains all


information associated with the Yelds of
a table

Correct answer

A record is each individual entry that exists


in a table
NULL value is different from a zero *1/1
value.

True

False

SQL is a Programming Language. * 1/1

True

False

Which clause is used in an update *0/1


statement to modify only specific
records of a table?

Set

Where

Modify

SpeciYc

Correct answer

Where
Which of the following provides a *1/1
correct syntax for UPDATE
statement?

Update table_name Values column1=value1


… Where condition(s);

Update table_name Alter column1=value1…


Where condition(s);

Update table_name Modify column1=value1


… Where condition(s);

Update table_name Set


column1=value1, … Where condition(s);

To update all the records of a table, *1/1


which of the following clause is
omitted from an UPDATE statement?

Values

Set

Where

Update
SET keyword in an UPDATE *1/1
statement is used to ______

Set new values to all the columns of a table

Set new values to the particular column

Modify a particular record in a database

Modify records in a database

The following SQL is which type of *1/1


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 ;

Equi-join

Outer join

Cartesian join

Natural join
What type of join is needed when you *1/1
wish to include rows that do not have
matching values?

Outer join

Equi-join

Natural join

All of the Mentioned

Using UPDATE statement, multiple *0/1


tables can be updated at a time.

False

True

Correct answer

False
How many columns can be modified *0/1
using a single UPDATE statement?

One to ten columns

One to Yve columns

Any number of columns

One column

Correct answer

One column

Which of the following clause is *0/1


used with SQL UPDATE statement
when updating a table with data from
another table?

Select

Copy

Where

From

Correct answer

Select
UPDATE is a _________ command. * 1/1

Transaction control language

Data control language

Data manipulation language

Data deYnition language

Which of the following SQL clauses is *1/1


used to DELETE tuples from a
database table?

CLEAR

DELETE

DROP

REMOVE

A_____ is a query that retrieves rows *1/1


from more than one table or view:

All of the mentioned

Join

Start

End
A condition is referred to as *1/1
__________

Join in SQL

Join in SQL & Condition

Join condition

None of the mentioned

What is the full form of SQL? * 1/1

Structured Query List

Structured Query Language

Sample Query Language

None of these.

___________removes all rows from a *1/1


table without logging the individual
row deletions.

DELETE

DROP

REMOVE

TRUNCATE
Which of the following is not a valid *0/1
SQL type?

FLOAT

NUMERIC

DECIMAL

CHARACTER

Correct answer

DECIMAL

Which of the following is not a DDL *1/1


command?

TRUNCATE

ALTER

CREATE

UPDATE
Which of the following are TCL *1/1
commands?

COMMIT & ROLLBACK

UPDATE TRUNCATE

SELECT & INSERT

GRANT & REVOKE

Which of the following statement is *1/1


true?

DELETE free the space containing the table


and TRUNCATE does not free the space
containing the table

Both DELETE and TRUNCATE does not free


the space containing the table

Both DELETE and TRUNCATE free the space


containing the table

DELETE does not free the space


containing the table and TRUNCATE free
the space containing the table
Which statement is used to delete all *1/1
rows in a table without having the
action logged?

TRUNCATE

DROP

DELETE

REMOVE

SQL Views are also known as * 1/1

Actual Tables / Copy table

Complex tables / Copy table

Virtual tables / Copy table

Simple tables / Copy table

How many Primary keys can have in *1/1


a table?

Depends on Database/table

Depends on no of Columns

Only 2

Only 1`
Which datatype can store *···/1
unstructured data in a column?

VARCHAR2

CHAR

None of these.

NUMERIC

No correct answers

Which of the following is not *1/1


Constraint in SQL?

NOT NULL

UNIQUE

PRIMARY KEY

NULL
What is the purpose of the SQL AS *1/1
clause?

The AS clause is used with the JOIN clause


only

All of the mentioned

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

The AS clause deYnes a search condition

SQL query to find all the cities whose *1/1


humidity is 95.

SELECT city WHERE humidity = 95 ;

SELECT city FROM weather WHERE


humidity = 95 ;

SELECT humidity = 89 FROM weather

SELECT city FROM weather ;


Which of the following is not a valid *1/1
aggregate function?

MAX

COUNT

COMMIT

SUM

Which data manipulation command *1/1


is used to combines the records from
one or more tables?

PRODUCT

JOIN

SELECT

PROJECT

Which operator is used to compare a *1/1


value to a specified list of values?

ANY

BETWEEN

ALL

IN
What operator tests column for *0/1
absence of data

NOT Operator

NOT IN Operator

IS NULL Operator

AND Operator

Correct answer

AND Operator

In which of the following cases a *1/1


DML statement is not executed?

When existing rows are modiYed.

When some rows are deleted.

When a table is deleted.

All of the above


Which of the following statement is *1/1
true?

Both TRUNCATE and DELETE statements


free the table's space.

DELETE free the table space while


TRUNCATE does not.

TRUNCATE free the table space while


DELETE does not.

Both TRUNCATE and DELETE statement


does not free the table's space.

If we have not specified ASC or DESC *1/1


after a SQL ORDER BY clause, the
following is used by default

DESC

None of the above

There is no default value

ASC
A command that lets you change one *1/1
or more field in a table is:

Insert

Modify

Insert into

modify

which of the following is also called *1/1


an INNER JOIN?

NON-EQUI JOIN

EQUI JOIN

SELF JOIN

None of the above


Which of the following is true about *1/1
the HAVING clause?

Similar to WHERE clause but is used for


groups rather than rows.

Similar to WHERE clause but is used for


rows rather than columns.

Similar to the WHERE clause but is used for


columns rather than groups.

Acts exactly like a WHERE clause.

The SQL statement: *0/1


SELECT ROUND (65.726) FROM DUA
L;

60

65

70

75

Correct answer

70

This content is neither created nor endorsed by Google. Report


Abuse - Terms of Service - Privacy Policy

Forms

You might also like