Logo 
Search:

sql Interview FAQs

Submit Interview FAQ
Home » Interview FAQs » sqlRSS Feeds
SQL
Comments: 0

What will SELECT COUNT(*) FROM TEAMSTATS; query return?

It will return total number of records.
Posted By:Shruti Sharma      Posted On: Dec 21

SQL
Comments: 0

What will SELECT SUBSTR LASTNAME,1,5 FROM NAME_TBL; query retunr?

No, missing () around lastname,1,5. Also, a better plan is to give the column an alias. The statement should look like this:

SELECT SUBSTR(LASTNAME,1,5) NAME FROM NAME_TBL;
Posted By:Shruti Sharma      Posted On: Dec 21

SQL
Comments: 0

Using today's TEAMSTATS table, write a query to determine who is batting under .25

Using today's TEAMSTATS table, write a query to determine who is batting under .25. (For the baseball-challenged reader, batting average is hits/ab.)

INPUT:

SELECT NAME FROM TEAMSTATS
WHERE (HITS/AB) < .25;

OUTPUT:

NAME
-----------...
Posted By:Shruti Sharma      Posted On: Dec 21

SQL
Comments: 0

Which clause works just like LIKE(%)?

Which clause works just like LIKE(%)?

STARTING WITH
Posted By:Shruti Sharma      Posted On: Dec 21

SQL
Comments: 0

What is the function of the GROUP BY clause, and what other clause does it act like?

The GROUP BY clause groups data result sets that have been manipulated by various functions. The GROUP BY clause acts like the ORDER BY clause in that it orders the results of the query in the order the columns are listed in the GROUP BY.
Posted By:Shruti Sharma      Posted On: Dec 21

SQL
Comments: 0

When using the HAVING clause, do you always have to use a GROUP BY also?

When using the HAVING clause, do you always have to use a GROUP BY also?

Yes.
Posted By:Shruti Sharma      Posted On: Dec 21

  1  2  3  4  5  6  7  8