Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.

### Tables ###
TABLE: CREATE TABLE works_on ( Essn INTEGER, Pno INTEGER, Hours REAL )
TABLE: CREATE TABLE dependent ( Essn INTEGER, Dependent_name TEXT, Sex TEXT, Bdate TEXT, Relationship TEXT )
TABLE: CREATE TABLE department ( Dname TEXT, Dnumber INTEGER, Mgr_ssn INTEGER, Mgr_start_date TEXT )
TABLE: CREATE TABLE project ( Pname Text, Pnumber INTEGER, Plocation TEXT, Dnum INTEGER )
TABLE: CREATE TABLE employee ( Fname TEXT, Minit TEXT, Lname TEXT, Ssn INTEGER, Bdate TEXT, Address TEXT, Sex TEXT, Salary INTEGER, Super_ssn INTEGER, Dno INTEGER )
TABLE: CREATE TABLE dept_locations ( Dnumber INTEGER, Dlocation TEXT )

### Question ###
Find the number of employees of each gender whose salary is lower than 50000 Visualize by bar chart, I want to rank by the Y in descending.

### Accurate SQL ###

SELECT Sex, COUNT(*) FROM employee WHERE Salary < 50000 GROUP BY Sex ORDER BY COUNT(*) DESC