Sail E0 Webinar

MCQs

Total Questions : 109 | Page 3 of 11 pages
Question 21. Which SQL keyword is used to retrieve a maximum value?
  1.    TOP
  2.    MOST
  3.    UPPER
  4.    MAX
 Discuss Question
Answer: Option D. -> MAX
Question 22. Which of the following is a SQL aggregate function?
  1.    LEFT
  2.    AVG
  3.    JOIN
  4.    LEN
 Discuss Question
Answer: Option B. -> AVG
Question 23. What is a view?
  1.    A view is a special stored procedure executed when certain event occurs.
  2.    A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are.
  3.    A view is a database diagram.
  4.    None of these
 Discuss Question
Answer: Option B. -> A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are.
Question 24. Which of the following SQL commands is used to retrieve data?
  1.    DELETE
  2.    INSERT
  3.    SELECT
  4.    JOIN
 Discuss Question
Answer: Option C. -> SELECT
Question 25. Which SQL statement is used to update data in a database?
  1.    SAVE
  2.    UPDATE
  3.    SAVE AS
  4.    MODIFY
 Discuss Question
Answer: Option B. -> UPDATE
Question 26. Which SQL statement is used to delete data FROM a database?
  1.    COLLAPSE
  2.    REMOVE
  3.    ALTER
  4.    DELETE
 Discuss Question
Answer: Option D. -> DELETE
Question 27. Which SQL keyword is used to sort the result-set?
  1.    SORT BY
  2.    ORDER
  3.    ORDER BY
  4.    SORT
 Discuss Question
Answer: Option C. -> ORDER BY
Question 28. The SQL statement
SELECT SUBSTR('123456789', INSTR('abcabcabc', 'b'), 4) FROM DUAL;
  1.    6789
  2.    2345
  3.    1234
  4.    456789
 Discuss Question
Answer: Option B. -> 2345
Answer: B. 2345

Explanation: The INSTR() function is used to find the first occurrence of a substring in a string. The syntax for INSTR() is INSTR(string, substring). In this question, the INSTR() function is used to find the first occurrence of the substring 'b' in the string 'abcabcabc'. The INSTR() function returns the position of the first occurrence of the substring, which is 2.

The SUBSTR() function is used to extract a substring from a given string. The syntax for SUBSTR() is SUBSTR(string, start_position, [length]). In this question, the SUBSTR() function is used to extract a substring from the string '123456789' starting at the position 2 and with a length of 4. Therefore, the output of the query is '2345'.
Question 29. Which of the following group functions ignore NULL values?
  1.    MAX
  2.    COUNT
  3.    SUM
  4.    All of the above
 Discuss Question
Answer: Option D. -> All of the above
Question 30. Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);
prints
  1.    10
  2.    9
  3.    5
  4.    0
 Discuss Question
Answer: Option B. -> 9

Latest Videos

Latest Test Papers