Click here to Skip to main content
15,569,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Field name. | Data type.

___________. _________
Mobile_id. Integer.Primarykey
Mobile_name. Varchar (10)
Mobile_company date
Mobile_price integer
The doubt is how to select total price of the mobiles whose company name is nokia

What I have tried:

Mysql doubt I've no idea of solving this
Posted
Updated 26-Apr-22 9:43am

Try the SUM function: SQL COUNT(), AVG() and SUM() Functions[^].
 
Share this answer
 
Comments
coderlearner 26-Apr-22 12:25pm    
Is it something like select sum(distinct..........) I don't know exactly but..
Richard MacCutchan 26-Apr-22 12:41pm    
Follow the link above, it shows you example usage.
Maciej Los 26-Apr-22 14:34pm    
5ed!
Quote:
The doubt is how to select total price of the mobiles whose company name is nokia


Use WHERE clause[^]!
SQL
SELECT ... SUM()
FROM TableName
WHERE `Mobile_name` = 'Nokia'
GROUP BY ...


BTW: I'd strongly suggest to read this: MySQL :: MySQL 8.0 Reference Manual :: 9.2.3 Identifier Case Sensitivity[^]
 
Share this answer
 
Comments
coderlearner 26-Apr-22 20:18pm    
Field name. Data type constraints
Book_id. Integer. Pk,foreignke
Student_id. Integer pk,FK
Issue_id. Date
How to create this table using foreign key

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900