Documente Academic
Documente Profesional
Documente Cultură
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.
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
16
Statement 1: DCL contains the commands which Only statement 1 Only statement 2
protect data from unauthorized access.
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
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.
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.
31
The percent sign and the underscore cannot be 1 0
used in combinations, when using LIKE clause.
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.
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.
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.
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
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.
47
An index helps speed up SELECT queries and 1 0
WHERE clauses, but it slows down data input, with
UPDATE and INSERT statements.
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
GROUP BY ORDER BY
SELECT UPDATE
MAX COMPUTE
HAVING FROM
REMOVE DISTINCT
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
10 15
FULL CROSS