Tag: databases

Questions Related to databases

  1. SELECT DISTINCT position, manager FROM employee;

  2. SELECT position, manager DISTINCT FROM employee;

  3. SELECT position, manager FROM employee;

  4. SELECT position, DISTINCT manager FROM employee;


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax of the SELECT statement and the purpose of the DISTINCT keyword. The user must retrieve unique combinations of the POSITION and MANAGER values from the EMPLOYEE table.

Option A is the correct answer:

A. SELECT DISTINCT position, manager FROM employee;

This option retrieves unique combinations of the POSITION and MANAGER values from the EMPLOYEE table. The DISTINCT keyword ensures that each combination is unique and not repeated in the result set.

Option B is incorrect:

B. SELECT position, manager DISTINCT FROM employee;

This option is not valid because the keyword DISTINCT is in the wrong position. The correct syntax is SELECT DISTINCT, not SELECT column1, column2 DISTINCT.

Option C is incorrect:

C. SELECT position, manager FROM employee;

This option retrieves all combinations of the POSITION and MANAGER values from the EMPLOYEE table, including duplicates.

Option D is incorrect:

D. SELECT position, DISTINCT manager FROM employee;

This option is not valid because the keyword DISTINCT is in the wrong position. The correct syntax is SELECT DISTINCT, not SELECT column1, DISTINCT column2.

The Answer is: A

  1. /SQL*Plus commands cannot be abbreviated.

  2. /SQL*Plus commands are accesses from a browser.

  3. /SQL*Plus commands are used to manipulate data in tables.

  4. /SQL*Plus commands manipulate table definitions in the database.

  5. /SQL*Plus is the Oracle proprietary interface for executing SQL statements.


Correct Option: C,D
  1. INSERT

  2. UPDATE

  3. SELECT

  4. DESCRIBE

  5. DELETE

  6. RENAME


Correct Option: D
  1. The sort is in ascending by order by default.

  2. The sort is in descending order by default.

  3. The ORDER BY clause must precede the WHERE clause.

  4. The ORDER BY clause is executed on the client side.

  5. The ORDER BY clause comes last in the SELECT statement

  6. The ORDER BY clause is executed first in the query execution.


Correct Option: A,E

The size of a table does NOT need to be specified.

  1. True

  2. False


Correct Option: A
  1. Fields

  2. Attributes

  3. Records

  4. Schema


Correct Option: B