Arithmetic operation performance in SQL Say I have a table with prices and different percents, and I need to calculate the sum of the percentage. 

And I run this query, 

SELECT 
    i.user_id,
    i.payment_type,
    SUM(id.price),
    SUM(ROUND(id.price / (1 + (id.some_percent / 100)))) AS subtotal,
    SUM(ROUND(id.price - (id.crc_price / (1 + (id.some_percent / 100))))) AS some_percent_sum,
    SUM(ROUND((id.price / (1 + (id.some_percent / 100))) * (id.another_percent / 100))) AS another_percent_sum
FROM
    invoice i
        INNER JOIN
    invoice_details id ON i.invoice_id = id.invoice_id
GROUP BY i.user_id , payment_type


Will this query affect my SQL performance? Assuming all my index are optimized.

Or is it better to return the raw data and do the calculations in the server (whatever language c#, java, etc..)
The answer to this question depends on the server-side language being used.
I ran two simple benchmarks and compared the results using MySQL and PHP.
The database used in the tests contained 500,000 records
Test #1 (Calculation in MySQL):
$start_time = microtime( true );

$sql =  'SELECT
            SUM( ROUND( retail - ( wholesale / ( 1 + ( 8.25 / 100 ) ) ) ) ) AS percent_sum
        FROM
            invoice';

$result  = $mysqli-&gt;query( $sql );
$invoice = $result-&gt;fetch_assoc();

$end_time = microtime( true );

echo $end_time - $start_time;       // Result: 0.56663717265

Test #2 (Calculation in PHP):
$start_time = microtime( true );

$sql =  'SELECT
            retail,
            wholesale
        FROM
            invoice';

$result = $mysqli-&gt;query( $sql );

$percent_sum = 0;

while ( $invoice = $result-&gt;fetch_assoc() )
{
    $percent_sum += round( $invoice['retail'] - ( $invoice['wholesale'] / ( 1 + ( 8.25 / 100 ) ) ) );
}

$end_time = microtime( true );

echo $end_time - $start_time;       // Result: 0.76414209361

These results remained typical for all tests performed, so my conclusion is that calculations in MySQL seem to perform faster than PHP for the types of calculations performed in the question given.
Regardless, I would prioritize maintainability over micro-optimizations, so if you are performing calculations on the data extracted from the database in PHP for the majority of the functions, consistency is key.