0

databases Online Quiz - 43

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

Given below, What is the maximum level of data protection

  1. RAID 1 and Fallback

  2. RAID 5 and Fallback

  3. RAID 5 and No Fallback

  4. RAID 1 and No Fallback


Correct Option: A

AI Explanation

To answer this question, we need to understand the concept of RAID (Redundant Array of Independent Disks) and data protection levels associated with it.

RAID is a technology that combines multiple physical disk drives into a single logical unit to improve performance, reliability, and data protection. Different RAID levels provide different levels of data protection, depending on the redundancy and fault tolerance mechanisms they employ.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) RAID 1 and Fallback - This option is correct because RAID 1, also known as mirroring, provides the highest level of data protection. In RAID 1, data is mirrored across multiple drives, meaning that each drive contains an exact copy of the data. This redundancy ensures that even if one drive fails, the data can still be accessed from the other drive. Fallback refers to the ability to switch to a backup or redundant system in case of failure, further enhancing data protection.

Option B) RAID 5 and Fallback - This option is incorrect because RAID 5 does not provide the maximum level of data protection. RAID 5 uses striping with parity, distributing data and parity across multiple drives. While it offers some fault tolerance by allowing the system to continue functioning even if one drive fails, it does not provide the same level of redundancy as RAID 1.

Option C) RAID 5 and No Fallback - This option is incorrect for the same reasons mentioned above. RAID 5 without fallback does not provide the maximum level of data protection.

Option D) RAID 1 and No Fallback - This option is incorrect because while RAID 1 offers a high level of data protection, not having fallback limits the ability to switch to a backup or redundant system in case of failure, reducing the overall level of data protection.

Therefore, the correct answer is A) RAID 1 and Fallback. This option provides the maximum level of data protection by combining the redundancy of RAID 1 with the ability to switch to a backup or redundant system in case of failure.

Which statement is true if using NUPIs to accomplish data distribution?

  1. The increase of hash buckets has resulted in more hash collisions.

  2. Duplicate NUPI values will produce the same row hash.

  3. Uniform row distribution is accomplished using UPIs.

  4. The low-order 16 bits of the row hash are input to the hash map.


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of NUPIs (Non-Unique Primary Index) and how they are used for data distribution in a database.

Option A) The statement "The increase of hash buckets has resulted in more hash collisions" is incorrect. Increasing the number of hash buckets reduces the likelihood of hash collisions, as it provides more space for the data to be distributed evenly.

Option B) The statement "Duplicate NUPI values will produce the same row hash" is correct. In a database using NUPIs, rows with duplicate NUPI values will be hashed to the same hash bucket. This ensures that rows with the same NUPI value are stored together for efficient access.

Option C) The statement "Uniform row distribution is accomplished using UPIs" is incorrect. UPIs (Unique Primary Index) are used for unique row identification, not for achieving uniform row distribution. NUPIs are typically used for data distribution across multiple AMPs (Access Module Processors) in the Teradata database.

Option D) The statement "The low-order 16 bits of the row hash are input to the hash map" is not directly related to NUPIs or data distribution. It seems to be discussing a specific implementation detail that is not relevant to the given question.

Based on the explanations above, the correct answer is Option B. Duplicate NUPI values will produce the same row hash, ensuring that rows with the same NUPI value are stored together for efficient access.

What option can best describe Teradata's architecture

  1. Shared nothing

  2. Shared memory

  3. Shared everything

  4. shared data


Correct Option: A
  1. A Non Unique primary index may be more effective for query access and joins

  2. A NUPI query simplifies the optimization process in the PE

  3. A NUPI provides better data distribution

  4. A NUPI requires less disk space to store the data row


Correct Option: A

When utilizing a unique secondary index, how many AMP(s) are most probably accessed

  1. 1 AMP

  2. Multi - AMP

  3. 2 -AMP

  4. All-AMP


Correct Option: C
  1. assigned at the table level

  2. permanent space currently not used

  3. spool space currently not used

  4. subtracted form sysadmin


Correct Option: B

Which is the component limits queries based on set thresholds?

  1. Teradata Manager

  2. TDQM

  3. BTEQ

  4. QueryMan


Correct Option: B

Sybase char_length equialent of SQL is

  1. length

  2. char_length

  3. char_len

  4. len


Correct Option: D

AI Explanation

To answer this question, we need to understand the Sybase database and its equivalent functions.

The Sybase equivalent function for the SQL char_length is len.

Let's go through each option to understand why it is correct or incorrect:

Option A) length - This option is incorrect because length is not the Sybase equivalent function for char_length.

Option B) char_length - This option is incorrect because char_length is not the Sybase equivalent function for char_length.

Option C) char_len - This option is incorrect because char_len is not the Sybase equivalent function for char_length.

Option D) len - This option is correct because len is the Sybase equivalent function for char_length.

The correct answer is Option D. This option is correct because len is the Sybase equivalent function for char_length.

How to change <> null in sybase to SQL?

  1. is not null

  2. is null

  3. != null

  4. <> null


Correct Option: A

" in sybase is changed to ' in sql

  1. True

  2. False


Correct Option: A

exp1 LIKE exp2 in sybase is changed to

  1. exp1 like exp2

  2. exp1 like ltrim(exp2)

  3. exp1 like rtrim(exp2)

  4. ltrim(exp1) like exp2


Correct Option: C
  1. INSERT INTO employees VALUES (NULL, 'JOHN','Smith');

  2. INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');

  3. INSERT INTO employees VALUES ('1000','JOHN','NULL');

  4. INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');


Correct Option: C
  1. GRANT select, insert, update ON student_grades TO manager

  2. GRANT select, insert, update ON student_grades TO ROLE manager

  3. GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;

  4. GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;


Correct Option: D
Explanation:

To solve this question, the user needs to understand SQL syntax for granting privileges to a specific role or user.

Now, let's go through each option and explain why it is right or wrong:

A. GRANT select, insert, update ON student_grades TO manager

This option grants SELECT, INSERT, and UPDATE privileges on the STUDENT_GRADES table to a user named "manager". However, it does not grant the ability to pass on these privileges to others.

B. GRANT select, insert, update ON student_grades TO ROLE manager

This option is similar to Option A, but grants privileges to a role named "manager" instead of a specific user. However, it still does not grant the ability to pass on these privileges to others.

C. GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;

This option is incorrect because there is no "MODIFY" privilege in SQL. It should be "UPDATE" instead.

D. GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;

This option is correct. It grants SELECT, INSERT, and UPDATE privileges on the STUDENT_GRADES table to a user named "manager" and also includes the "WITH GRANT OPTION" clause, which allows this user to pass on these privileges to others.

Therefore, the correct answer is:

The Answer is: D

  1. You obtain the results retrieved from the public synonym HR created by the database administrator.

  2. You obtain the results retrieved from the HR table that belongs to your schema.

  3. You get an error message because you cannot retrieve from a table that has the same name as a public

  4. You obtain the results retrieved from both the public synonym HR and the HR table that belongs to


Correct Option: B
  1. A view can be created as read only.

  2. A view cannot have an ORDER BY clause in the SELECT statement.

  3. A view cannot be created with a GROUP BY clause in the SELECT statement.

  4. A view must have aliases defined for the column names in the SELECT statement.


Correct Option: A

Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) JOB_CAT VARCHARD2(30) SALARY NUMBER(8,2) Which statement shows the maximum salary paid in each job category of each department?

  1. SELECT dept_id, job_cat, MAX(salary)

  2. ELECT dept_id, job_cat, MAX(salary)

  3. SELECT dept_id, MAX(salary)

  4. SELECT dept_id, salary


Correct Option: B

AI Explanation

To find the maximum salary paid in each job category of each department from the EMPLOYEES table, we need to group the data by department and job category and then find the maximum salary within each group.

The correct statement to achieve this is:

B. SELECT dept_id, job_cat, MAX(salary)

Explanation:

Option A) SELECT dept_id, job_cat, MAX(salary) - This option includes all the necessary columns and the MAX(salary) function to find the maximum salary. This is the correct statement.

Option B) SELECT dept_id, job_cat, MAX(salary) - This option is the correct statement as it includes all the necessary columns and the MAX(salary) function to find the maximum salary.

Option C) SELECT dept_id, MAX(salary) - This option does not include the job_cat column, so it will not show the maximum salary per job category. Therefore, this option is incorrect.

Option D) SELECT dept_id, salary - This option does not include the MAX(salary) function to find the maximum salary. It will simply display the salary column for each department. Therefore, this option is incorrect.

The correct answer is B. SELECT dept_id, job_cat, MAX(salary). This statement includes all the necessary columns and the MAX(salary) function to find the maximum salary paid in each job category of each department.

  1. SELECT last_name, 12*salary* commission_pct FROM emp;

  2. SELECT last_name, 12*salary* (commission_pct,0) FROM emp;

  3. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;

  4. SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;


Correct Option: C
Explanation:

To solve this question, the user needs to know SQL syntax and the concept of NULL values. The user must use the proper SQL function to ensure that all employees' values are displayed in the calculated columns.

Option A: SELECT last_name, 12*salary* commission_pct FROM emp; This option is incorrect because it does not handle NULL values. If any employee has a NULL value in the commission_pct column, the entire expression would result in NULL, and no value would be displayed.

Option B: SELECT last_name, 12*salary* (commission_pct,0) FROM emp; This option is incorrect because it contains a syntax error. The expression (commission_pct, 0) is not valid SQL syntax.

Option C: SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp; This option is correct. The NVL function is used to handle NULL values in the commission_pct column. The function replaces any NULL value with 0, ensuring that all employees have a value in the calculated column.

Option D: SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp; This option is incorrect because the DECODE function is not used correctly. The DECODE function should have a second argument to return if the first argument is not equal to 0. Without the second argument, the function would not handle any non-zero values in the commission_pct column.

Therefore, the correct answer is:

The Answer is: C. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;

Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHARD2(10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column? (Choose two)

  1. SUM(start_date)

  2. AVG(start_date)

  3. COUNT(start_date)

  4. AVG(start_date, end_date)


Correct Option: C
Explanation:

Explanation: Aggregate functions operate on a set of rows and return a single result. The two valid aggregate functions on the START_DATE column are: C. COUNT(start_date) - This function returns the number of rows where START_DATE is not null.

Option A is invalid because the SUM function is used to add numeric values and cannot be used with a DATE data type. Option B is invalid because the AVG function will not work with DATE, you can convert DATE to NUMERIC then it can be used, but without Casting it will not work Option D is invalid because the AVG function can only be used with a single column, and the argument passed in should be numeric.

The EMPLOYEE tables has these columns: LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) COMMISSION_PCT NUMBER(5,2) You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column. Which SQL statement displays the desired results?

  1. SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;

  2. SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;

  3. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;

  4. SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;


Correct Option: D
Explanation:

Explanation: To display the name and annual salary multiplied by the commission_pct for all employees, we need to use the multiplication (*) operator. For records that have a NULL commission_pct, a zero must be displayed against the calculated column, we need to use the NVL function.

Option A) SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES; This option is incorrect because it does not account for NULL commission_pct values and does not use the NVL function.

Option B) SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES; This option is incorrect because the IFNULL function is not valid in Oracle SQL, and it does not use the NVL function.

Option C) SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES; This option is incorrect because the NVL2 function is not valid in Oracle SQL. It should be replaced with the NVL function.

Option D) SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES; This option is correct because it uses the multiplication operator to calculate the annual salary multiplied by the commission_pct and the NVL function to handle NULL commission_pct values.

Therefore, the correct answer is D.

- Hide questions