SQL and Database Concepts Quiz

Quiz covering SQL functions, database views, privileges, and Teradata architecture concepts

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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
Question 2 Multiple Choice (Single Answer)

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.
Question 3 Multiple Choice (Single Answer)

What option can best describe Teradata's architecture

  1. Shared nothing
  2. Shared memory
  3. Shared everything
  4. shared data
Question 4 Multiple Choice (Single Answer)

Why to Choose a Non Unique primary index instead of a unique primary index

  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
Question 5 Multiple Choice (Single Answer)

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
Question 6 Multiple Choice (Single Answer)

Temporary space is

  1. assigned at the table level
  2. permanent space currently not used
  3. spool space currently not used
  4. subtracted form sysadmin
Question 7 Multiple Choice (Single Answer)

Which is the component limits queries based on set thresholds?

  1. Teradata Manager
  2. TDQM
  3. BTEQ
  4. QueryMan
Question 8 Multiple Choice (Single Answer)

Sybase char_length equialent of SQL is

  1. length
  2. char_length
  3. char_len
  4. len
Question 9 Multiple Choice (Single Answer)

How to change <> null in sybase to SQL?

  1. is not null
  2. is null
  3. != null
  4. <> null
Question 10 True/False

" in sybase is changed to ' in sql

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

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
Question 12 True/False

*= operator belongs to SQL server 2008

  1. True
  2. False
Question 13 Multiple Choice (Single Answer)

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table?

  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');
Question 14 Multiple Choice (Single Answer)

You need to give the MANAGER role the ability to select from, insert into, and modify existing rows in the STUDENT_GRADES table. Anyone given this MANAGER role should be able to pass those privileges on to others. Which statement accomplishes this?

  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;
Question 15 Multiple Choice (Single Answer)

The database administrator of your company created a public synonym called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query? SELECT * FROM HR;

  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
Question 16 Multiple Choice (Single Answer)

Which statement about views are true?

  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.
Question 17 Multiple Choice (Single Answer)

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
Question 18 Multiple Choice (Single Answer)

Management has asked you to calculate the value 12salary commission_pct for all the employees in the EMP table. The EMP table contains these columns: LAST NAME VARCNAR2(35) NOT NULL SALARY NUMBER(9,2) NOT NULL COMMISION_PCT NUMBER(4,2) Which statement ensures that a value is displayed in the calculated columns for all employees?

  1. SELECT last_name, 12salary commission_pct FROM emp;
  2. SELECT last_name, 12salary (commission_pct,0) FROM emp;
  3. SELECT last_name, 12salary(nvl(commission_pct,0)) FROM emp;
  4. SELECT last_name, 12salary(decode(commission_pct,0)) FROM emp;
Question 19 Multiple Choice (Single Answer)

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)
Question 20 Multiple Choice (Single Answer)

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;