human
Schema:
works_on (Essn, Pno, Hours)
employee (Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno)
department (Dname, Dnumber, Mgr_ssn, Mgr_start_date)
project (Pname, Pnumber, Plocation, Dnum)
dependent (Essn, Dependent_name, Sex, Bdate, Relationship)
dept_locations (Dnumber, Dlocation)
Please answer with SQL.
assistant
Sure, I understand.
human
Yes. Can you tell me the number of employees?
assistant
SELECT COUNT( * ) FROM employee;
human
Thank you. Can you tell me how many of them are males?
assistant
SELECT COUNT( * ) FROM employee WHERE Sex = 'M';
human
Can you also tell me how many employees have a salary lower than 50000?
assistant
SELECT COUNT( * ) FROM employee WHERE salary < 50000;
human
Ok.How many male employees have a salary lower than 50000?
assistant
SELECT COUNT( * ) FROM employee WHERE salary < 50000 AND Sex = "M" ;