Advanced Sql(Database ) Questions and Answers

Question 1. A CASE SQL statement is which of the following?
  1.    A way to establish an IF-THEN-ELSE in SQL.
  2.    A way to establish a loop in SQL.
  3.    A way to establish a data definition in SQL.
  4.    All of the above.
Explanation:-
Answer: Option A. -> A way to establish an IF-THEN-ELSE in SQL.

Question 2. What type of join is needed when you wish to include rows that do not have matching values?
  1.    Equi-join
  2.    Natural join
  3.    Outer join
  4.    All of the above
Explanation:-
Answer: Option C. -> Outer join

Question 3. Which of the following is true concerning a procedure?
  1.    You do not create them with SQL.
  2.    They do not need to have a unique name.
  3.    They include procedural and SQL statements.
  4.    They are the same thing as a function.
Explanation:-
Answer: Option C. -> They include procedural and SQL statements.

Question 4. Which of the following statements is true concerning routines and triggers?
  1.    Both consist of procedural code.
  2.    Both have to be called to operate.
  3.    Both run automatically.
  4.    Both are stored in the database.
Explanation:-
Answer: Option A. -> Both consist of procedural code.

Question 5. What type of join is needed when you wish to return rows that do have matching values?
  1.    Equi-join
  2.    Natural join
  3.    Outer join
  4.    All of the above
Explanation:-
Answer: Option D. -> All of the above

Question 6. A transaction is the complete set of closely related update commands that must all be done, or none of them done, for the database to remain valid.
  1.    True
  2.    False
Explanation:-
Answer: Option A. -> True

Question 7. ROLLBACK WORK asks SQL to empty the log file.
  1.    True
  2.    False
Explanation:-
Answer: Option A. -> True

Question 8. The UNION clause is used to combine the output from multiple queries together into a single result table.
  1.    True
  2.    False
Explanation:-
Answer: Option A. -> True

Question 9. The most frequently used relational operation, which brings together data from two or more related tables into one resultant table, is called an equi-join.
  1.    True
  2.    False
Explanation:-
Answer: Option B. -> False

Question 10. When AUTOCOMMIT is set on, changes will be made automatically at the end of each SQL statement.
  1.    True
  2.    False
Explanation:-
Answer: Option A. -> True