Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 24 Jul 2005 @ 13:42:04 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: TD SQL Exam: Doubts
 
From:   Dieter Noeth

Anomy Anom wrote:

  I was going thru the parctice tests in one of the sites.  


Which site?


  Came across below questions. Am not sure why certain answers are marked wrong or correct!! Would appreciate if experts could throw light on the below marked correct/ incorrect/missed. I've indeed gone through the SQL reference books provided as a part of the documentation but couldnt find answers!  


  1.Which of the following would cause the Macro UPDROW to run:  


          > EXEC MACRO UPDROW(:'abc', :123); (MISSED)
          > EXEC MACRO UPDROW VALUES('abc', 123);
          > EXEC UPDROW VALUES('abc', 123);
          > EXEC UPDROW ('abc', 123); (INCORRECT)
          > EXEC UPDROW (:'abc', :123)

1 & 2: wrong, because of the "EXEC MACRO", it's just EXEC

3: wrong, because of VALUES, this is no Insert

4: Correct

5: wrong, because of :'abc', a colon indicates a parameter, but there are no quoted parameters


  2. How can you UPDATE a table without using UPDATE? (Select 2)
By Using a Self Join. (MISSED) -- HOW???
 


I really don't know :-(


          > By Using a Nested Join.
          > By using a Macro. (INCORRECT)
          > By using a Volatile Temporary Table.
          > By using a View. (CORRECT)

?

Only a macro could be considered correct, because it's an EXEC and the UPDATE might be hidden within the macro.

Another possible solution: Insert/Select into a new table, drop old and rename.


  3.Consider the following SQL:  


          > SELECT region, state, store_number, total_sales
          > WITH sum(total_sales) BY region,
          > Avg(total_sales), Sum(total_sales)>From Sales_Table;
  What will be returned if this query is run?  


Nothing, because it will result in an syntax error.


          > Total sales by store with subtotals by state within region.
          > Total sales by state within region.
          > Total sales by store with subtotals by region and average and total
          > sales within state. (MISSED)
          > Total sales by region within state. (INCORRECT) --  I choose it based on
          > GUESS. but is there a way the above select can run??

Only if there's another WITH added, but don't ask me about the exact result set, i never used WITH.


  4.What would you use to extract Ben from the words Ben Johnson?  


          > Cast
          > Pos
          > Substring (INCORRECT) -- why not?? select substring('Ben Johnson' from 1
          > for 3)
          > Coalesce (MISSED)

Of course Substring is correct.

Hopefully the real exam questions are better than those ;-)


Dieter



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023