Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


If a table has a column "dept" (declared to have nulls) and
there are 10 rows in the table of which 3 have a null value
in the dept column, what will select count(*) and select
count(distinct dept) return?

Answers were Sorted based on User's Feedback



If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / virender

SELECT(*) Will return 10 and SELECT (distinct dept) will
return 8.

Is This Answer Correct ?    7 Yes 2 No

If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / madhuri tungal

select count(*) returns 10 --- this is right. But,
select count(distinct dept) returns 7. Because null values
are not considered as distinct.

Is This Answer Correct ?    6 Yes 1 No

If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / keshireddy

Hmm Virender is correct

Is This Answer Correct ?    1 Yes 0 No

If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / i go crazy

MADHURI IS CORRECT.

Is This Answer Correct ?    1 Yes 0 No

If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / austin

MADHURI IS CORRECT.

Is This Answer Correct ?    1 Yes 0 No

If a table has a column "dept" (declared to have nulls) and there are 10 rows in the tab..

Answer / abhilash

SELECT(*) Will return 10 and SELECT (distinct dept) will
return 8.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

What should be specified along with a cursor in order to continue updating process after commit?

1 Answers   IBM,


query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop

2 Answers   IBM,


When is the results table for the query in a DECLARE CURSOR statement created?

5 Answers  


Where could you look if you had a question about whether a column has been defined as an index?

2 Answers  


Do we have any optinon to search part of integer in DB2 as we have for character Like,SUBSTR optins?

1 Answers  


How does cobol compile db2 program?

0 Answers  


List out the buffer pools in db2

0 Answers  


How many clustering indexes can be defined for a table?

2 Answers  


Generally if I want to select the names starting with c I need to use c% But how could I code to select the data which contains % as a part of data.

5 Answers  


What is isolation level?

4 Answers  


How can we retrieve the total number of records in RPG & CLLE?

0 Answers  


How do you simulate the explain of an embedded sql statement in spufi/qmf?

0 Answers  


Categories