Saturday 13 December 2014

SQL Quiz - 3

1.    Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?

SELECT ADD(Price) FROM Sales

SELECT TOTAL(Price) FROM Sales

SELECT SUM(Price) WHERE Sales

SELECT SUM(Price) FROM Sales
2.    Which of the following SQL statements is correct?

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

SELECT CustomerName, COUNT(CustomerName) FROM Orders

SELECT CustomerName, COUNT(CustomerName) FROM Orders ORDER BY CustomerName
3.    The TRUNCATE TABLE…

checks if the table has primary key specified

deletes the table

deletes all rows from a table
4.    Can you use the UPDATE and SELECT clauses in one SQL statement?

You can’t.

You can use UPDATE and SELECT clauses together, even if you don’t have nested SQL statements.

You can if you use nested SQL statements.
5.    Which of the following is a SQL aggregate function

AVG

LEN

LEFT

JOIN

6.    Which 2 SQL keywords specify the sorting direction of the result set retrieved with ORDER BY clause.

UP and DOWN

HIGH and LOW

ASC and DESC

7.    Can you use the SQL JOIN and SQL HAVING clauses in one SQL statement?

Yes.

No.

It depends.

8.    The NULL SQL keyword is used to ...

represent negative infinity.

represent 0 value.

represent positive infinity.

represent a missing or unknown value. NULL in SQL represents nothing.

9.    Which of the following SQL clauses is used to sort a result set?

ORDER BY

ORDER BY

ARRANGE

SORT

10.  Which SQL statement selects all rows from a table called Products and orders the result set by ProductID column?

SELECT * FROM Products ORDER BY ProductID

SELECT * FROM Products ORDERED BY ProductID

SELECT * FROM Products WHERE ProductID > 200

SELECT ProductID FROM Products

11.  What does the term 'locking' refer to?

Locking is a process preventing users from reading data being changed by other users, and prevents concurrent users from changing the same data at the same time.

Locking is the process of database authentication.

Locking is a process, which logs database usage.
12.  RDBMS stands for…

Read Database Master System

Real Database Management System

Relational Database Management System
13.  A trigger belongs to…

more than one table in the database

a single table in the database

to all tables in the database

14.   What will be the result of the following SQL statement: SELECT * FROM Table1 HAVING Column1 > 10 

The SQL statement will generate an error.

The result will be all rows from Table1 which have Column1 values greater than 10.

The result will be empty data set.

15.  The CREATE TABLE statement is used to…

change existing database table

create a new database.

create a new database table.



No comments:

Post a Comment