Tag: databases

Questions Related to databases

  1. Replaces word by word

  2. Replaces a column with another column

  3. Replaces character by character

  4. Replaces a row with another row


Correct Option: A
  1. IN executes the inner query for each row affected by the outer query and EXISTS executes the inner query only once irrespective of the outer query

  2. IN executes the inner query only once irrespective of the outer query and EXISTS executes the inner query only once irrespective of the outer query

  3. IN executes the inner query only once irrespective of the outer query and EXISTS executes the outer query for each row affected by the outer query

  4. IN executes the inner query for each row affected by the outer query and EXISTS executes the outer query for each row affected by the outer query


Correct Option: C
  1. AMP bucket number

  2. Primary Index

  3. Primary Key

  4. None of the above


Correct Option: B
  1. Defined immediately after the table CREATE statement, used to find the Primary Key

  2. Defined during the table CREATE statement, used to assign rows to an AMP

  3. Defined immediately after the table CREATE statement, used to assign rows to an AMP

  4. Defined during the table CREATE statement, used to find the Primary Key


Correct Option: B

_____ and _____ are true about the Primary Index

  1. Defined immediately after the table CREATE statement, used to assign rows to an AMP

  2. Defined immediately after the table CREATE statement, used to find the Primary Key

  3. Defined during the table CREATE statement, used to assign rows to an AMP

  4. Defined during the table CREATE statement, used to find the Primary Key


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of Primary Index in database management systems. Let's go through each option to understand why it is correct or incorrect:

Option A) Defined immediately after the table CREATE statement, used to assign rows to an AMP - This option is incorrect because the Primary Index is not used to assign rows to an AMP. The Primary Index is used to distribute the data across AMPs (Access Module Processors) in a Teradata database.

Option B) Defined immediately after the table CREATE statement, used to find the Primary Key - This option is incorrect because the Primary Index is not used to find the Primary Key. The Primary Key is a constraint that ensures uniqueness of a column or set of columns in a table.

Option C) Defined during the table CREATE statement, used to assign rows to an AMP - This option is correct. The Primary Index is defined during the table CREATE statement and is used to assign rows to an AMP. It determines how the data is distributed across the AMPs for efficient parallel processing.

Option D) Defined during the table CREATE statement, used to find the Primary Key - This option is incorrect because the Primary Index is not used to find the Primary Key.

The correct answer is C) Defined during the table CREATE statement, used to assign rows to an AMP. This option is correct because the Primary Index is defined during the table CREATE statement and is used to assign rows to an AMP.

Which of the query will print the output as 'TCS' (single quotes should come in the output of the query)

  1. select '''||'TCS'||''' from dual

  2. select 'TCS' from dual

  3. select '''TCS''' from dual

  4. select "TCS" from dual


Correct Option: A

What's the output select to_Date('2009-may-25','yyyymmdd') from dual

  1. 2009-may-25

  2. Error

  3. may-2009-25

  4. 200925may


Correct Option: B

Which of the query will print the output as 'TCS' (single quotes should come in the output)

  1. select '''||'TCS ||''' from dual

  2. select '''TCS''' from dual

  3. select "TCS" from dual

  4. select 'TCS' from dual


Correct Option: B