0

databases Online Quiz - 240

Description: databases Online Quiz - 240
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

What is the correct order to get a correct SQL statement?

  1. SELECT FROM GROUP BY WHERE

  2. SELECT FROM GROUP BY ROLLUP

  3. SELECT GROUP BY FROM

  4. SELECT WHERE FROM GROUP BY


Correct Option: B

NULL values violate CHECK constraint

  1. True

  2. False


Correct Option: B

Which of these operators is used to calculate super aggregate results?

  1. ROLLUP

  2. COUNT

  3. AVG

  4. SUM


Correct Option: A

Which is the syntax for enforcing the rule of deleting the dependent Foreign Key values on the deletion of a Primary Key?

  1. ON DELETE SET NULL

  2. ON DELETE CASCADE

  3. ON DELETE DELETE

  4. ON DELETE RESTRICT


Correct Option: B
Explanation:

To answer this question, the user needs to have knowledge of database management systems and the concept of Foreign Keys.

When a Foreign Key references a Primary Key in another table, there is a possibility that the referenced record(s) may be deleted. In such cases, four actions can be taken: SET NULL, CASCADE, DELETE, or RESTRICT.

  • ON DELETE SET NULL: This option sets the Foreign Key value to NULL when the referenced record(s) are deleted. This may lead to data integrity issues and is not ideal in most cases.

  • ON DELETE CASCADE: This option deletes all the dependent rows in the child table when the referenced rows in the parent table are deleted. This is usually the preferred option when the child rows are no longer relevant without the parent rows.

  • ON DELETE DELETE: This syntax does not exist, and hence, it is incorrect.

  • ON DELETE RESTRICT: This option prevents the deletion of the referenced rows in the parent table when there are dependent rows in the child table. This is useful when the data in the child table is still relevant and associated with the data in the parent table.

Therefore, the correct answer is:

The Answer is: B. ON DELETE CASCADE

TRANSLATE

  1. Restricts the length of the String

  2. Replaces a sequence of characters in a string with another set of characters

  3. Modifies the datatype of a column

  4. Renames a column


Correct Option: B

which of these can be used to filter aggregate functions?

  1. WHEN

  2. HAVING

  3. WHERE

  4. ANY


Correct Option: B

REPLACE

  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

How is IN different form EXISTS ?

  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

Teradata components handle data distribution by

  1. AMP bucket number

  2. Primary Index

  3. Primary Key

  4. None of the above


Correct Option: B

_____ and _____ are true about the Primary Index

  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.

A new table has been created in the employee. There are no rows in the table.What would be the output of the following query?select count(*) from employee

  1. Error

  2. 1

  3. No data Found

  4. 0


Correct Option: D
  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

Session Handling is done by which part of teradata system?

  1. AMP

  2. PE

  3. BYNET

  4. CLIQUE


Correct Option: B

TERADATA is Shared _________ architecture.

  1. Nothing

  2. Everything

  3. Disk

  4. Processor


Correct Option: A
- Hide questions