Which of the following SQL statement will display all the records of employee "Mahesh" having employee ID =101 in the relation 'EMPLOYEE' on the basis of 'EMPID'?
Which of the following SQL statement will display all the records of employee "Mahesh" having employee ID =101 in the relation 'EMPLOYEE' on the basis of 'EMPID'?
Solution
✅ Correct Option: 1
The WHERE clause filters rows using a condition, and SQL uses a single = to test equality. So select * from EMPLOYEE where EMPID=101; returns every column of the row(s) whose EMPID is 101.
Option 4: == is the equality operator in languages like C and Python, but SQL does not accept it.
Option 3: HAVING filters groups after GROUP BY and needs a comparison operator, so it cannot replace a WHERE condition here.
Option 2: "is equal to" is plain English, not SQL syntax.
Related questions:
2026: 31 May Shift 1
2026: 29 May Shift 2