Sunteți pe pagina 1din 20

Sno Question Choice A Choice B

Which of the given options are TRUE about Holds a variable length Its maximum size is
'varchar' datatype? string (can contain specified in parenthesis.
letters, numbers, and
special characters).

1
Which of the given options are TRUE about TCL? TCL contains the TCL consists of 2
commands which are commands: COMMIT
required for Transaction and ROLLBACK
Management.

2
Which of the given options are TRUE regarding Constraints are used to The NOT NULL
'Constraints'? limit the type of data constraint enforces a
that can go into a table column to NOT accept
NULL values.
3
Statement 1: 'AND' Returns TRUE if both Only statement 1 Only statement 2
component conditions are TRUE. Returns FALSE if
either is FALSE; otherwise returns UNKNOWN.
Statement 2: 'EXISTS' returns FALSE if a sub-query
returns at least one row.

Which of the above statements are TRUE?


4
Statement 1: 'UNION' returns all distinct rows Only statement 1 Only statement 2
selected by either query.

Statement 2: 'INTERSECT 'returns all distinct rows


selected by both queries.
Which of the above statements is TRUE?
5
Which operator returns all distinct rows selected by UNION MINUS
6 the first query but not the second?
Which of the given options is TRUE? COUNT function is used SUM function allows
to count the number of selecting the total for a
columns in a database numeric column.
table.
7
Which of the given options return rows when there JOIN WHERE
is at least one match in both tables?
8
Which type of join does not require each record in Inner join Outer Join
the two joined tables to have a matching record?
9
Statement 1: Clustered index physically rearranges Only statement 1 Only statement 2
the data that users inserts in your tables.
Statement 2: There can be 2000 non-clustered
index per table.
Which of the above statement are TRUE?

10
What is the standard way to separate each SQL Semicolon Colon
statement in database systems that allow more
than one SQL statement to be executed in the
same call to the server.
11
DDL part of SQL does which of the following? allows database tables Defines indexes (keys)
to be created or deleted

12
ANSI is the official U.S. representative to the 1 0
International Organization for Standardization
(ISO). State whether the above statement is true or
false
13
Which statement is used to query the database and INSERT RETRIEVE
retrieve selected data that match the criteria that
14 you specify?
Statement1: Data types specify what the type of Only statement 1 Only statement 2
data can be for that particular column

Statement 2: Varchar is a datatype in SQL

Which of the above statements is TRUE?


15
Statement 1: The DELETE statement is used to Only statement 1 Only statement 2
delete columns in a table.
Statement 2: The UPDATE statement is used to
update existing records in a table.

Which of the above statements are TRUE?

16
Statement 1: DCL contains the commands which Only statement 1 Only statement 2
protect data from unauthorized access.

Statement 2: DCL consists of 2 commands:


COMMIT and ROLLBACK

Which of the above statements are TRUE?


17
Statement 1: GRANT, DENY and REVOKE are DCL Only statement 1 Only statement 2
commands
Statement 2: CREATE, ALTER, DROP, TRUNCATE are
DDL commands
18
Which of the given options are TRUE regarding The UNIQUE constraint A PRIMARY KEY
'Constraints'? uniquely identifies each constraint does not
record in a database automatically have a
table. UNIQUE constraint
defined on it.
19
You can have many UNIQUE constraints per table, 1 0
but only one PRIMARY KEY constraint per table.
State whether the above statement is TRUE or
FALSE.

20
Statement 1:Each table can have only ONE primary Only statement 1 Only statement 2
key per table
Statement 2: A primary key column can contain
NULL values

Which of the above statements are TRUE?


21
Statement 1: A FOREIGN KEY in one table points to Only statement 1 Only statement 2
a PRIMARY KEY in another table.
Statement 2: If you define a CHECK constraint on a
single column it allows only certain values for this
column.

Which of the given options are TRUE?


22
Statement 1: Operators are used to specify Only statement 1 Only statement 2
conditions in an SQL statement and to serve as
conjunctions for multiple conditions in a statement.
Statement 2: Arithmetic operators manipulate
numeric operands.
Which of the above statements are TRUE?

23
Statement 1: If you want to select rows that satisfy Only statement 1 Only statement 2
at least one of the given conditions, you can use
the logical operator, AND.
Statement 2: <> Checks if the value of two
operands are equal or not, if values are not equal
then condition becomes true.
Which of the above statements are TRUE?

24
Statement 1: SQL aggregate functions return a Only statement 1 Only statement 2
single value, calculated from values in a column.

Statement 2: AVG() returns the average value

Which of the above statements is TRUE?

25
LIKE clause is used to compare a value to similar 1 0
values using logical operators. State whether the
26 above statement is TRUE or FALSE.
The GROUP BY clause follows the WHERE clause in 1 0
a SELECT statement and precedes the ORDER BY
clause.

State whether the above statement is TRUE or


FALSE.
27
The HAVING clause places conditions on the 1 0
selected columns, whereas the WHERE clause
places conditions on groups created by the GROUP
BY clause.

State whether the above statement is TRUE or


FALSE.
28
Which of the given options is TRUE about LIKE The percent sign The underscore
clause? represents zero, one, or represents a single
multiple characters, number or character.
when used with LIKE
clause.
29
GROUP BY clause is used in collaboration with the 1 0
SELECT statement to arrange identical data into
groups.

State whether the above statement is TRUE or


FALSE.
30
Statement 1: Numeric functions accept numeric Only statement 1 Only statement 2
input and return string values.

Statement 2: Single-row functions return a single


result row for every row of a queried table or view.
Which of the above statements are TRUE?

31
The percent sign and the underscore cannot be 1 0
used in combinations, when using LIKE clause.

State whether the above statement is TRUE or


FALSE.
32
The ROUND() function is used to round a numeric 1 0
field to the nearest hundred.
State whether the above statement is TRUE or
FALSE.
33
SQL joins are used to query data from two or more a relationship between a relationship between
tables, based on ___________________. certain columns in certain rows in tables.
tables

34
Which of the given options return all rows from the JOIN LEFT JOIN
left table, even if there are no matches in the right
table?
35
A Self Join is a type of sql join which is used to join 1 0
a table to itself, particularly when the table has a
FOREIGN KEY that references its own PRIMARY KEY.
State whether the above statement is TRUE or
FALSE.

36
Statement 1: CROSS JOIN returns the Cartesian Only statement 1 Only statement 2
product of the sets of rows from the joined tables.
Statement 2: You can have multiple conditions for
the ON clause just like you can in a WHERE clause.

Which of the above statements is TRUE?

37
Statement 1: In case of Natural Joins, common Only statement 1 Only statement 2
columns are columns that have the same number
of rows in both tables.

Statement 2: JOIN ON syntax is much more


readable and maintainable than the natural join
syntax.

Which of the above statements are TRUE?

38
Statement 1: The FULL OUTER JOIN will return all Only statement 1 Only statement 2
rows, as long as there's matching data in one of the
tables.

Statement 2: FULL OUTER JOIN includes all the


rows from both the participating tables and does
not select either the LEFT or RIGHT table from the
JOIN key word.

Which of the above statements are TRUE?

39
Which type of join combines the results of both left Inner join Cross Join
40 and right outer joins?
You cannot add a subquery to a SELECT clause as a 1 0
column expression in the SELECT list.
State whether the above statement is TRUE or
FALSE.

41
Statement 1: A view can be accessed with the use Only statement 1 Only statement 2
of SQL SELECT statement like a table.
Statement 2: A view can be made up by selecting
data from more than one tables.
Which of the above statements are TRUE?

42
43 View can be removed using which command? DELETE VIEW DROP VIEW
Statement 1: The SQL subquery is a SELECT query Only statement 1 Only statement 2
that is embedded in the main SELECT statement.
Statement 2: A subquery cannot return more than
one rows

Which of the above statements is TRUE?

44
Statement 1: A subquery is also called an inner MCQ Only statement 1
query or inner 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?

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

State whether the above statement is TRUE or


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

Statement 2: Subqueries cannot be used with the


comparison operators.

Which of the above statements are TRUE?

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

State whether the above statement is TRUE or


FALSE.

48
An inline view exists A subquery exists only
only inside of the FROM inside of the FROM
Which of the given options are TRUE? clause as a run-time clause as a run-time
result set.
49
To remove duplicate rows from the result set of a NO DUPLICATE UNIQUE
50 SELECT use the following keyword:
Which of the following can add a row to a table? Add Insert
51
Which SQL statement is used to insert a new data INSERT INTO UPDATE
52 in a database?
In a LIKE clause, you can could ask for any value LIKE %qpt LIKE *ton
53 ending in "qpt" by writing
In a LIKE clause, you can ask for any 6 letter value LIKE ?????? LIKE .{6} Answer 5: LIKE
by writing? ^.{6}$
54
The result of a SELECT statement can contain 1 0
55 duplicate rows.
56 A table may be joined to itself. 1 0
Which of the following is not a valid aggregate COUNT MIN
57 function?
What SQL clause is used to restrict the rows AND WHERE
58 returned by a query?
Primary Key does allow the Null Values. where as in 1 0
Unique key doesn't accept the Null values.
State whether the statement is true or false
59
Which of the following commands should be used CREATE ?I student CREATE DATABASE
60 to create a database named “student”? student
Which one will delete the table data as well as TRUNCATE DROP
61 table structure?
A SELECT command without a WHERE clause All the records from a All the records from a
returns? table that match the table, or information
previous WHERE clause about all the records
62
What does the ALTER TABLE clause do? The SQL ALTER TABLE The SQL ALTER TABLE
clause is used to deletes data from
insert data into database table.
database table.

63
Can you use combination of GROUP BY 1 0
clause,HAVING clause and WHERE clause SQL
clauses in one SQL statement?
64
What is a primary key? The primary key is a The primary key is a
column that can have column or
NULL values. combination of
columns whose
values uniquely
identify each row in
the table.

65
What is the purpose of the SQL AS clause? The AS clause defines The AS SQL clause is
a search condition used to change the
name of a column in
the result set or to
assign a name to a
derived column.
66
Which two are true about aggregate You can use aggregate You can use aggregate
functions?(Choose two) functions in any functions only in the
clause of a SELECT column list of the
statement. SELECT clause and in
the
WHERE clause of a
SELECT statement.

67
Which clause should you use to exclude group WHERE HAVING
68 results?
Which of the following SQL statements is SELECT SELECT
correct? CustomerName, CustomerName,
COUNT(CustomerNam COUNT(CustomerNam
e) FROM Orders e) FROM Orders
ORDER BY
CustomerName
69
The SQL DROP TABLE clause is used to... create a new table in delete a table from
70 the database the database
We refer to a join as a self-join when? we are joining table we are using left and
to itself right join together
71
The INNER JOIN clause… returns all rows from returns all rows that
2 tables have matching value
in the field on which
the 2 tables are
joined.

72
If table A have 10 rows and table B have 5 5 50
rows, how many rows will be returned if you
perform a cartesian join on those two tables?

73
Which syntax would be used to retrieve all Outer join Inner join
rows in both the EMPLOYEES and
DEPARTMENTS tables, even when there is no
match?
74
The main reason that constraints are added to Constraints add a Constraints ensure
a table is: level of complexity data integrity
75
To automatically delete rows in a child table ON DELETE SET NULL ON DELETE ORPHAN
when a parent record is deleted use:
76
A table can have more than one UNIQUE key 1 0
77 constraint. True or False?
A column defined as NOT NULL can have a 1 0
78 DEFAULT value of NULL. True or False?
A table must have at least one not null 1 0
constraint and one unique constraint. True or
False?
79
The ___________ join is the ANSI-standard NATURAL ALL
syntax used to generate a Cartesian product.
80
In the relational model, relationships between composite keys. determinants.
relations or tables are created by using:
81
Which two statements are true regarding the The sort is in The ORDER BY clause
ORDER BY clause? (Choose two) ascending order by comes last in the
default. SELECT statement.

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

83
The CUSTOMERS table has these columns: WHERE WHERE
CUSTOMER_ID NUMBER(4) NOT NULL lower(country_addres lower(country_addres
CUSTOMER_NAME VARCHAR2(100) NOT NULL s) = 'france' s) = "france"
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)
A sale is being advertised to the customers in
France. Which WHERE clause
identifies customers that are located in
France?

84
SQL can be used to: Modify the database create database
structures only.
85
Examine the structure of the EMPLOYEES UPDATE employees UPDATE employees
table: SET first_name = SET first_name =
EMPLOYEE_ID NUMBER Primary Key 'John', 'John', last_name
FIRST_NAME VARCHAR2(25) SET last_name ='Smith'
LAST_NAME VARCHAR2(25) ='Smith' WHERE employee_id
HIRE_DATE DATE WHERE employee_id = 180;
Which UPDATE statement is valid? = 180;

86
The SQL WHERE clause: limits the column data limits the row data
that are returned. are returned.
87
ON UPDATE CASCADE ensures which of the Normalization data Integrity
88 following?
Which of the following is valid SQL for an CREATE INDEX ID; CHANGE INDEX ID;
Index?
89
Choice C Choice D
All listed options None of the listed
options

All listed options None of the listed


options

All listed options None of the listed


options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

INTERSECT UNION ALL

All listed options None of the listed


options

GROUP BY ORDER BY

Self join Equi Join

Both statement 1 and None of the listed


statement 2 options
Comma All listed options

Specifies links between All listed options


tables, and imposes
constraints between
tables

SELECT UPDATE

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

All listed options None of the listed


options
Both statement 1 and None of the listed
statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options
Both statement 1 and None of the listed
statement 2 options

All of the above None of the listed


options

All listed options None of the listed


options

RIGHT JOIN CROSS JOIN


Both statement 1 and None of the listed
statement 2 options

Both statement 1 and None of the listed


statement 2 options

Both statement 1 and None of the listed


statement 2 options

Full Outer Join All of the above

Both statement 1 and None of the listed


statement 2 options

REMOVE VIEW All listed options


Both statement 1 and None of the listed
statement 2 options

Only statement 2 Both statement 1 and


statement 2

Both statement 1 and None of the listed


statement 2 options

An inline view exists All listed options


only inside of the
WHERE clause as a run-
time result set.

DISTINCT None of the listed


options
Update Alter

ADD INSERT NEW

LIKE ton$ LIKE ^.*ton$

LIKE ...... (that's six dots) LIKE ______ (that's six


underscore characters)

MAX COMPUTE

HAVING FROM

DATABASE /student DATABSE student

REMOVE DISTINCT

SELECT is invalid without Nothing


a WHERE clause

The SQL ALTER TABLE The SQL ALTER TABLE


clause modifies a clause is used to
table definition by delete a database
altering, adding, or table
deleting table
columns and/or
constraints.

The primary key


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

You can mix single You can pass column


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

RESTRICT GROUP BY

SELECT
CustomerName,
COUNT(CustomerNa
me) FROM Orders
GROUP BY
CustomerName

modify an existing
table in a database
we are joining more
than 2 tables

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.

10 15

Self join Natural join


Constraints gives None of the listed
programmers job options
security

ON DELETE CASCADE None of the listed


options

FULL CROSS

candidate keys foreign keys.

The sort is in The ORDER BY clause


descending order by is executed on the
default client side

You can join n tables All listed options


(all having single
column primary keys)
in a SQL statement by
specifying a minimum
of n-1 join conditions.
WHERE None
lower(country_addres
s) IS 'france'

query database data All the listed


only. operation can be
done by SQL.

UPDATE employees UPDATE employees


SET first_name = SET first_name =
'John' 'John'
AND last_name SET last_name
='Smith' ='Smith'
WHERE employee_id WHERE employee_id
= 180; = 180;

limits the rows & NONE


coloumns returned

Materialized View None

ADD INDEX ID; REMOVE INDEX ID;

S-ar putea să vă placă și