1. Home
  2. Computer Science MCQs
  3. Django
  4. What does the bulk_create method do in Django?

Added 28 Apr 2024

What does the bulk_create method do in Django?

  1. Deletes multiple objects from the database
  2. Creates multiple objects in a single database query Correct answer
  3. Updates multiple objects in the database
  4. Performs a bulk insert operation using raw SQL

Correct answer

B. Creates multiple objects in a single database query

17 views

MCQSEXAM

Explanation

bulk_create() creates multiple objects in a single database query: Book.objects.bulk_create([Book(...), Book(...)]). It is far faster than saving objects one at a time.

Note that it does not call each model's save() method or send the save signals.

For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is B? 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