You are on page 1of 1

SQL Quiz (15 minutes)

Enter your unique test ID *


If you do not have test ID leave field blank or write to cv@leobit.co to get one

L-1611-Net-128

Your Name *

Oleg Prusak

With SQL, how do you select all the records from a table named "Persons" where
the value of the column "FirstName" starts with an "a"? *

SELECT * FROM Persons WHERE FirstName LIKE '%a'

SELECT * FROM Persons WHERE FirstName LIKE 'a%'

SELECT * FROM Persons WHERE FirstName='a'

SELECT * FROM Persons WHERE FirstName='%a%'

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table? *

INSERT INTO Persons (LastName) VALUES ('Olsen')

INSERT INTO Persons ('Olsen') INTO LastName

INSERT ('Olsen') INTO Persons (LastName)

None of above

With SQL, how can you delete the records where the "FirstName" is "Peter" in the
Persons Table? *

DELETE FirstName='Peter' FROM Persons

DELETE ROW FirstName='Peter' FROM Persons

DELETE FROM Persons WHERE FirstName = 'Peter'

None of above

Which SQL keyword is used to sort the result-set? *

ORDER

SORT

SORT BY

ORDER BY

What SQL statement do you use to combine the results of multiple SQL
statements into one? *

INNER JOIN statement

UNION clause

AGGREGATE clause

ALL statement

INTEGRATE clause

Select all types of OUTER JOINs *

INNER

LEFT

RIGHT

CROSS

FULL

Select all aggregation functions that you know *

top

first

last

max

average

sum

count

maximum

avg

floor

ceil

min

Select all correct statements about GROUP BY, WHERE and HAVING *

Aggregate functions are usually used with GROUP BY clause

WHERE can’t be used with GROUP BY, while HAVING can

HAVING applies filter for one group, while WHERE filters whole result set

HAVING & WHERE can’t be combined in one statement

Which one of the following fields is the ideal candidate for the primary key in a
student record base? *

Phone number

Parent’s name

Student’s name

System generated ID

Address

You wrote a query that uses a CROSS JOINs. Mary complained that the query
delivered a Cartesian product. Referring to the above scenario, what is in the
result set of the query Mary obtained? *

All possible combinations of rows from the left table that is involved in the join

All possible combinations of rows from every table that is involved in the join

All possible combinations of rows from the foreign table that is involved in the join

All possible combinations of rows from the main table that is involved in the join

All possible combinations of rows from the right table that are involved in the join

How many columns should be present in third table which is used for many-to-
many relationship between two tables? *

One column

Two columns

Third table should include columns which uniquely initialized both tables

Third table represents the number of columns which uniquely initialized first table

Third table represents the number of columns which uniquely initialized second table

None of above

Each student can enroll into more than one class. Each class can accommodate
more than one student. The above scenario can be described by which one of
the following relationships? *

N to N

N to 1

1 to N

N to N to 1

1 to 1

What's the difference between a primary key and a unique key? *

They are both the same

Primary key doesn't allow NULLs, but unique key allows one NULL only

Primary key allows one NULL only, but unique key does not allow NULLs

Thank You

Компания Google не имеет никакого отношения к этому контенту. - Условия использования - Политика
конфиденциальности

Формы

You might also like