Discussion
The qualifier DISTINCT must be used in an SQL statement when we want to eliminate duplicate rows.
Answer: A
Correct answer: True
A plain SELECT returns every row that matches, duplicates included, because SQL tables are multisets rather than true sets. To collapse repeats, DISTINCT must be stated explicitly.
Two details are worth knowing. It applies to the whole selected row, so SELECT DISTINCT city, state removes only rows where both values repeat. And it is not free: the engine must sort or hash the result to find the duplicates, so on a large result set the cost is real.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development