SQL Server Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 297 Page Views: 

Write the query to Select the name of the product whose total sales is 20 form the following table named sales:- PID Pname Sale 1 Soap 5 2 Brush 10 3 Tea 8 1 Soap 12 2 Brush 5



Posted By: Avi Date: 1 October 2010 11:42:07 AM
 Answer:

select Pname from sales group by PID having sum(sale)=130


Posted By: avibtech


Date: 1 October 2010 11:42:07 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image xyTmZe
Related Questions
SQL Server : The file got corrupted . How can I retrieve the data from log files in SQL Server?

The file got corrupted . How can I retrieve the data from log files in SQL Server?

There are no specific commands or methods in SQL server to retrieve the data from the log files. Som....
Category: SQL Server Date: 10/1/2010 11:58:08 AM
SQL Server : While updating some rows there is some sort of failure such as power failure. So what will be the state of data?

While updating some rows there is some sort of failure such as power failure. So what will be the st....

There will be no changes done since commit operation was not performed. It will be in the last commi....
Category: SQL Server Date: 10/1/2010 11:57:08 AM
SQL Server : Differentiate between IN and EXISTS operator in SQL Server?

Differentiate between IN and EXISTS operator in SQL Server?

IN:- The IN operator tells the rule-based optimizer to run the inner query first and then drive the ....
Category: SQL Server Date: 10/1/2010 11:56:08 AM
SQL Server : How many types of backups are available in SQL Server?

How many types of backups are available in SQL Server?

The scope of data backup can be whole data, partial ,or some files. On this basis of scope the follo....
Category: SQL Server Date: 10/1/2010 11:55:07 AM
SQL Server : While generating a realtionship between two tables why is it recommended to use CASCADE constraint?

While generating a realtionship between two tables why is it recommended to use CASCADE constraint?

Cascade constraint is used to maintain the consistency of the data. It automatically deletes the row....
Category: SQL Server Date: 10/1/2010 11:54:07 AM