SQL and Database Concepts Quiz
Quiz covering SQL functions, database views, privileges, and Teradata architecture concepts
Questions
Given below, What is the maximum level of data protection
- RAID 1 and Fallback
- RAID 5 and Fallback
- RAID 5 and No Fallback
- RAID 1 and No Fallback
Which statement is true if using NUPIs to accomplish data distribution?
- The increase of hash buckets has resulted in more hash collisions.
- Duplicate NUPI values will produce the same row hash.
- Uniform row distribution is accomplished using UPIs.
- The low-order 16 bits of the row hash are input to the hash map.
What option can best describe Teradata's architecture
- Shared nothing
- Shared memory
- Shared everything
- shared data
Why to Choose a Non Unique primary index instead of a unique primary index
- A Non Unique primary index may be more effective for query access and joins
- A NUPI query simplifies the optimization process in the PE
- A NUPI provides better data distribution
- A NUPI requires less disk space to store the data row
When utilizing a unique secondary index, how many AMP(s) are most probably accessed
- 1 AMP
- Multi - AMP
- 2 -AMP
- All-AMP
Temporary space is
- assigned at the table level
- permanent space currently not used
- spool space currently not used
- subtracted form sysadmin
Which is the component limits queries based on set thresholds?
- Teradata Manager
- TDQM
- BTEQ
- QueryMan
Sybase char_length equialent of SQL is
- length
- char_length
- char_len
- len
How to change <> null in sybase to SQL?
- is not null
- is null
- != null
- <> null
" in sybase is changed to ' in sql
- True
- False
exp1 LIKE exp2 in sybase is changed to
- exp1 like exp2
- exp1 like ltrim(exp2)
- exp1 like rtrim(exp2)
- ltrim(exp1) like exp2
*= operator belongs to SQL server 2008
- True
- False
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?
- INSERT INTO employees VALUES (NULL, 'JOHN','Smith');
- INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');
- INSERT INTO employees VALUES ('1000','JOHN','NULL');
- INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');
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?
- GRANT select, insert, update ON student_grades TO manager
- GRANT select, insert, update ON student_grades TO ROLE manager
- GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;
- GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;
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;
- You obtain the results retrieved from the public synonym HR created by the database administrator.
- You obtain the results retrieved from the HR table that belongs to your schema.
- You get an error message because you cannot retrieve from a table that has the same name as a public
- You obtain the results retrieved from both the public synonym HR and the HR table that belongs to
Which statement about views are true?
- A view can be created as read only.
- A view cannot have an ORDER BY clause in the SELECT statement.
- A view cannot be created with a GROUP BY clause in the SELECT statement.
- A view must have aliases defined for the column names in the SELECT statement.
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?
- SELECT dept_id, job_cat, MAX(salary)
- ELECT dept_id, job_cat, MAX(salary)
- SELECT dept_id, MAX(salary)
- SELECT dept_id, salary
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?
- SELECT last_name, 12salary commission_pct FROM emp;
- SELECT last_name, 12salary (commission_pct,0) FROM emp;
- SELECT last_name, 12salary(nvl(commission_pct,0)) FROM emp;
- SELECT last_name, 12salary(decode(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)
- SUM(start_date)
- AVG(start_date)
- COUNT(start_date)
- AVG(start_date, end_date)
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?
- SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;
- SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;
- SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;
- SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;