Tag: databases

Questions Related to databases

  1. Once created, a sequence belongs to a specific schema

  2. Once created, a sequence is linked to a specific table

  3. Once created, a sequence is automatically available to all users

  4. Only the DBA can control which squence is used by certain a table

  5. Once created, a sequence is automatically in all INSERT and UPDATE statements


Correct Option: C
  1. SELECT text FROM user_source WHERE name ='SALARY_CALC';

  2. SELECT * FROM user_source WHERE source_name ='salary_calc';

  3. SELECT * FROM user_objects WHERE object_name = 'SALARY_CALC';

  4. SELECT text FROM user_source WHERE name='SALARY_CALC' AND owner ='JOHN';


Correct Option: A
Explanation:

To solve this question, the user needs to know the structure of the system tables in Oracle database where all the objects are stored.

Option A is correct. This query will return the text of the procedure SALARY_CALC. The user_source view contains all the source code for the stored procedures, functions, and triggers in the current user's schema. By specifying the name of the procedure in the WHERE clause, the query filters the result set to only show the source code for the SALARY_CALC procedure.

Option B is incorrect. There is no column named "source_name" in the user_source view. Therefore, this query will return an error.

Option C is incorrect. The user_objects view contains information about all objects in the current user's schema, including tables, views, indexes, and procedures. However, the view does not contain the source code for the procedures. Therefore, this query will not return any rows.

Option D is incorrect. The condition "AND owner='JOHN'" is unnecessary because the user_source view only contains source code for the objects owned by the current user. Therefore, this query will return the same result as option A, but with an unnecessary condition.

The Answer is: A. SELECT text FROM user_source WHERE name ='SALARY_CALC';

Which SELECT statement will get the result 'elloworld' from the string 'HelloWorld'?

  1. SELECT SUBSTR ('HelloWorld',1) FROM dual;

  2. SELECT LOWER (TRIM ('H' FROM 'Hello World')) FROM dual

  3. SELECT LOWER (SUBSTR('HellowWorld', 2,1) FROM dual

  4. SELECT INITCAP(TRIM('HellowWorld', 1,1) FROM dual


Correct Option: B
  1. Create and drop a materialized view

  2. Grant and revoke the role to and from other users

  3. Enable the role and exercise any privileges in the role's privilege domain

  4. Select from a table


Correct Option: D

You need to create an index on the PASSPORT_RECORDS table. It contains 10 million rows of data. The key columns have low cardinality. The queries generated against this table use a combination of multiple WHERE conditions involving the OR operator. Which type of index would be best for this type of table?

  1. Bitmap

  2. Btree

  3. Unique

  4. partitioned


Correct Option: A
  1. The shared pool CANNOT be dynamically resized.

  2. The shared pool contains only fixed structures

  3. The shared pool consists of the library cache and buffer cache.

  4. The shared pool stores the most recently executed SQL statements and the most recently


Correct Option: D

Which action will cause a log switch?

  1. A transaction completes.

  2. The instance is started.

  3. The instance is shut down

  4. The current online redo log group is filled


Correct Option: D