Improve company productivity with a Business Account.Sign Up
SELECT MIN(dob) AS dob, COUNT(*) AS dob_count, SUM(buyprice) AS buyprice, SUM(sellprice) AS sellprice, ;
SUM(sellprice-buyprice) AS p_l, 100.00*SUM(sellprice-buyprice)/SUM(buyprice) AS p_l_perc, ;
SUM(held) AS held, SUM(sold) AS sold, 100.00*SUM(sold)/SUM(held) AS sold_perc ;
FROM sales ;
WHERE dob BETWEEN DATE(1954, 4, 1) AND DATE(1956, 4, 24) ;
AND gender = "F" AND age BETWEEN 20 AND 44 ;
AND religion = "C" AND location = "Germany"
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.