Tag: databases

Questions Related to databases

Which are correct guidelines for naming database tables?

  1. Must begin with either a number or a letter.

  2. Must be 1-30 characters long.

  3. Should not be an Oracle Server reserved word.

  4. Must contain only A-Z, a-z, 0-+, _, *, and #.

  5. Must contain only A-Z, a-z, 0-9, _, $, and #.

  6. Must begin with a letter.


Correct Option: B,C,E,F
  1. SELECT last_name FROM EMP WHERE last_name LIKE ‘_A%’;

  2. SELECT last_name FROM EMP WHERE last name =’*A%’

  3. SELECT last_name FROM EMP WHERE last name =’_A%’;

  4. SELECT last_name FROM EMP WHERE last name LIKE ‘*A%’


Correct Option: A
  1. ALL

  2. BETWEEN...AND

  3. LIKE

  4. OR


Correct Option: D
Explanation:

To solve this question, the user needs to understand the different SQL operators and how they work. The user must also know how to use these operators in a SQL statement to perform a specific task.

Now, let's go through each option and explain whether it can be used to substitute the 'IN' operator:

A. ALL: The ALL operator is used to compare a value to all values in another set of values. It cannot be used to substitute the 'IN' operator. Therefore, option A is incorrect.

B. BETWEEN...AND: The BETWEEN...AND operator is used to select values within a given range. It cannot be used to substitute the 'IN' operator. Therefore, option B is incorrect.

C. LIKE: The LIKE operator is used to compare a value to similar values using wildcard characters. It cannot be used to substitute the 'IN' operator. Therefore, option C is incorrect.

D. OR: The OR operator is used to combine multiple conditions in a WHERE clause. It can be used to substitute the 'IN' operator by specifying each value as a separate condition joined by the OR operator. Therefore, option D is correct.

The Answer is: D

  1. Exiting from SQL*Plus

  2. System crashing

  3. Issue of GRANT or CREATE command

  4. None of the above


Correct Option: D
  1. A table name can duplicate the name of any other database object, if not owned by same user.

  2. Table names can contain $,_, and # signs.

  3. Table names are case-sensitive.

  4. Table names begin with a letter.

  5. Table names are not created in Uppercase by default.


Correct Option: A,B,D
  1. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH READ ONLY;

  2. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH CHECK OPTION;

  3. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH CHECK CONSTRAINT;

  4. None of the above


Correct Option: A