1. Home
  2. Computer Science MCQs
  3. Django
  4. What is the purpose of Django's distinct() method?

Added 28 Apr 2024

What is the purpose of Django's distinct() method?

  1. It removes duplicate rows from query results Correct answer
  2. It retrieves related objects after the main query is executed
  3. It performs additional filtering on query results
  4. It orders query results in ascending or descending order

Correct answer

A. It removes duplicate rows from query results

19 views

MCQSEXAM

Explanation

distinct() removes duplicate rows from query results by adding SELECT DISTINCT to the SQL.

It is most useful after joins across relationships, which can otherwise return the same object several times.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Django MCQs

Practise all Django MCQs

Similar MCQs