Thursday, January 26, 2012

SQL Training Questions

1.Which of the following is true?
a.TRUNCATE TABLE is identical to DELETE statement without WHERE clause and both remove all rows in a table.
b.TRUNCATE TABLE has to be used along with a WHERE clause
c.TRUNCATE TABLE deletes table from a database


2. We refer to a join as a self-join when…
a. we are joining more than 2 tables
b. we are joining table to itself.
c. we are using left and right join together


3. What does SQL stand for?
a. Standard Query Language.
b. Strong Query Language
c. Strict Query Language
d. Structured Query Language.


4. Which of the following SQL statements deletes all rows in table called SalesData?


a. DELETE FROM SalesData
b. DELETE SalesData
c. DELETE ALL SalesData
d. DELETE * FROM SalesData




5. If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:


a. There is no default value.
b. DESC
c. ASC


6. If you join a table to itself, what kind of join are you using?


a. You can't join a table to itself.
b. Selective Join.
c. Self Join


7. Can the SELECT clause list have a computed value like in the example below? SELECT CustomerName, UnitPrice * NumberofUnits FROM Sales 


a. Yes.
b. No


8. When inserting data in a table do you always have to specify a list of all column names you are inserting values for?


a. Yes
b. No


9. Which of the following SQL clauses is used to enter data into a SQL table?


a. WRITE
b. ENTER
c. SELECT
d. INSERT INTO


10. Which of the following SQL clauses is used to select data from 2 or more tables?


a. JOIN
b. HAVING
c. WHERE


11. The FROM SQL clause is used to…
a. specify search condition
b. specify what table we are selecting or deleting data from.
c. specify range for search condition


12. Can you use both HAVING and WHERE SQL clauses in one SQL statement?
a. No.
b. Yes.


13. Can you join a table to itself?
a. Yes.
b. No.


14. Which of the following 3 SQL statements is correct?


a. SELECT Username, Password FROM Users
b. SELECT Username, Password WHERE Username = 'user1'
c. SELECT Username AND Password FROM Users


15. What does the ALTER TABLE clause do?


a. used to delete a database table.
b. modifies a table definition by altering, adding, or deleting table columns.
c. used to insert data into database table.
d. deletes data from database table.


16. Which SQL keyword is used to retrieve a minimum value?


a. MIN
b. DOWN
c. LOW
d. LOWER

No comments:

Post a Comment