SQL Query | Level – Basic

Question

Write an SQL Query find number of employees
according to gender whose DOB is between 01/01/1960 to
31/12/1975.
Use column name as sex,DOB table name Employees

in progress 0
Ritika Sohal 4 years 3 Answers 856 views Member 0

Answers ( 3 )

  1. SELECT COUNT (*) AS “Number of Employees”
    FROM Employees
    WHERE DOB BETWEEN ‘1960-01-01’ AND ‘1975-12-31’
    GROUP BY sex;

  2. This query will give me employee_count , Gender as output.

    SELECT COUNT(1) as NumberofEmployees , sex
    from Employees
    WHERE DOB BETWEEN 01/01/1960 AND 31/12/1975.
    GROUP BY sex

  3. SELECT COUNT (*) AS No_of_Employees”
    FROM Employees
    WHERE DOB BETWEEN ‘CAST(1960-01-01’ as DATE) AND CAST(‘1975-12-31’ as DATE)
    GROUP BY sex;

Leave an answer

Browse
Browse