Questions about Teradata

General

Questions about Teradata

Good day everyone,

 

I have some questions regarding teradata and i need to know the correct answers :

 

1- create table t1( col1 int, col2 int) primary index(col2);

 

What is the correct answer

a) UPI on col1

b)NUPI on col2

c) NUSI on col2

d) None of the above

 


2- What the following SQL will output?

SELECT customer_number, zip_code

FROM location

WHERE zip_code MOD 10000 = 0;

a)All rows from location table where zip codes end with only one zero.

b) Throws an error ecause zip_code can't be zero

c) All rows from location table where zip codes end with four zeroes

d) Gives "Division By Zero" error

 

3- Consider the following SQL:

 

SELECT dept_no, dept_name,

,SUM (grant_amount)

FROM department

GROUP BY dept_no;

 

What is should return when executed :

 

  1. Shows the total grant_amount for each department
  2. Shows the total grant_amount for each department and department name
  3. Gives a syntax error as GROUP BY should come before FROM clause
  4. Give as error as non-aggregates in the SELECT list must also appear in the GROUP BY clause.

 

 

4- CREATE MULTISET TABLE t1 (a INTEGER, b INTEGER)

UNIQUE PRIMARY INDEX (a);

INSERT INTO t1 VALUES (1,1);

INSERT INTO t1 VALUES (1,2);

UPDATE t1 SET b = b + 1 WHERE B = 1;

 

Which statement is true ?

a) The INSERTs succeed but the UPDATE fails

b) The CREATE TABLE fails

c) The INSERTs and the UPDATE succeed

d) The second INSERT fails

 

1 REPLY 1
Ambassador

Re: Questions about Teradata

What happened when you tried these (fairly simple) tests? That should give you the correct answers.

 

1 b

2 c

3 4

4 d

 

HTH

Dave

 

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com