📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which statement counts only students from Lahore?

A. SELECT COUNT(City) FROM Students
B. SELECT COUNT(*) FROM Students WHERE City = 'Lahore' ✅
C. SELECT COUNT(*) FROM Students GROUP BY City
D. SELECT * FROM Students WHERE City = 'Lahore'

Correct Answer: B. SELECT COUNT(*) FROM Students WHERE City = 'Lahore'

Explanation

COUNT(*) with WHERE counts only rows that pass the Lahore filter.