Tag: databases

Questions Related to databases

Consider the following SELECT statement: SELECT dept_no "Departments", MAX(salary) "Max Salaries" FROM employee WHERE dept_no IN(200, 300, 400) GROUP BY Departments HAVING MAX(salary) > 60000; Due to which clause does this statement fail?

  1. Group By

  2. Where

  3. Select

  4. Having


Correct Option: A

Which SQL statement is used to extract data from a database?

  1. OPEN

  2. GET

  3. SELECT

  4. EXTRACT


Correct Option: C

AI Explanation

To answer this question, you need to understand the basic SQL (Structured Query Language) syntax.

Option A) OPEN - This option is incorrect because the OPEN statement is not used to extract data from a database. It is used to open a cursor or a file.

Option B) GET - This option is incorrect because the GET statement is not used to extract data from a database. It is used to retrieve a single value from a table.

Option C) SELECT - This option is correct because the SELECT statement is used to extract data from a database. It is the most commonly used SQL statement and allows you to retrieve specific columns or rows from one or more tables.

Option D) EXTRACT - This option is incorrect because the EXTRACT statement is used to retrieve a specific part of a date or time value, such as the year, month, or day.

The correct answer is C) SELECT. This option is correct because the SELECT statement is used to extract data from a database.

  1. Group functions

  2. Group by clause

  3. Distinct keyword

  4. All of above


Correct Option: D
  1. Group functions

  2. Group by clause

  3. Distinct keyword

  4. All of the above


Correct Option: D
  1. respective table data is retained

  2. data is deleted from table

  3. depends on conditions

  4. all of above


Correct Option: A
  1. Group by clause

  2. Distinct keyword

  3. Pseudo column ROWNUM keyword

  4. All of above


Correct Option: D