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...


SELECT category, type, AVG(price)
FROM products GROUP BY category, type ORDER BY 1, 2

If there are three distinct categories in the "products"
table, and each one has five different types, how many rows
are returned by the query above?

1. 1 row
2. 3 rows
3. 5 rows
4. 8 rows
5. 15 rows

Answers were Sorted based on User's Feedback



SELECT category, type, AVG(price) FROM products GROUP BY category, type ORDER BY 1, 2 If there..

Answer / vijay

15 rows

Is This Answer Correct ?    9 Yes 2 No

SELECT category, type, AVG(price) FROM products GROUP BY category, type ORDER BY 1, 2 If there..

Answer / sreeharibabu

create table products (category varchar2(30), type varchar2(20) ,price number ) ;

insert into products values('c1','t1',100);
insert into products values('c1','t2',200);
insert into products values('c1','t3',300);
insert into products values('c1','t4',400);
insert into products values('c1','t5',500);

insert into products values('c2','t1',100);
insert into products values('c2','t2',200);
insert into products values('c2','t3',300);
insert into products values('c2','t4',400);
insert into products values('c2','t5',500);

insert into products values('c3','t1',100);
insert into products values('c3','t2',200);
insert into products values('c3','t3',300);
insert into products values('c3','t4',400);
insert into products values('c3','t5',500);

select * from products ;

SELECT category, type, AVG(price)
FROM products GROUP BY category, type ORDER BY 1 ;

3 *5 => 15 rows

Is This Answer Correct ?    1 Yes 0 No

SELECT category, type, AVG(price) FROM products GROUP BY category, type ORDER BY 1, 2 If there..

Answer / hemanth

5 Rows

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

Write a query to find second highest salary of an employee.

27 Answers  


What is cursor and its types?

0 Answers  


what are the different type of sql's statements ? : Sql dba

0 Answers  


can we create index on index?

7 Answers   iFlex, Symphony,


What is the difference between row level and statement level trigger?

0 Answers  


Please let me know if UNION ALL and Natural Join does the same operation and are same...

7 Answers   iGate,


What are stored procedures in mysql?

0 Answers  


How many primary keys can a table have?

0 Answers  


Is pl sql a scripting language?

0 Answers  


what is the use of HASH, LIST partitions?

1 Answers   ITC Infotech,


What is crud stand for?

0 Answers  


What is compute?

0 Answers  


Categories