How can I write an SQL comment to find below question when I
How can I write an SQL comment to find below question when I have a table called salaries with variables, employee_id, salary, from_date, to_date.
The important thing is from date can be started by 05.04.1999 and ends by 05.04.2000.
What is the total payroll of the company in 2000?
Thank you!
Solution
Answer:
select sum(salary) from salaries where from_date > \'05.01.2000\';
this query will calculate and display the total of payroll in 2000.
