Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 subjective questions Getting started with databases

INT221 — Mvc Programming 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define Database Migrations in Laravel. How do the up and down methods function within a migration file?

  2. Question 2 of 20

    Explain the concept of Eloquent ORM. How does it map models to database tables?

  3. Question 3 of 20

    Differentiate between Query Builder and Eloquent ORM with respect to performance and syntax.

  4. Question 4 of 20

    Describe the process of Seeding in Laravel. How can Model Factories be utilized within seeders?

  5. Question 5 of 20

    Write a PHP script to perform CRUD operations (Create, Read, Update, Delete) using Laravel's Query Builder.

  6. Question 6 of 20

    Explain Mass Assignment in Eloquent ORM. What is the role of the $fillable and $guarded properties?

  7. Question 7 of 20

    How can Laravel be configured to use MongoDB? What are the key differences when interacting with MongoDB compared to a SQL database in Laravel?

  8. Question 8 of 20

    Discuss the implementation of REST APIs in Laravel. How do API Resources assist in transforming data?

  9. Question 9 of 20

    Explain the concept of Soft Deletes in Eloquent ORM. How do you implement and retrieve soft deleted models?

  10. Question 10 of 20

    What are Accessor and Mutator methods in Eloquent models? Provide examples.

  11. Question 11 of 20

    Describe how to create a One-to-Many relationship using Eloquent ORM. Give an example of a Post and Comment scenario.

  12. Question 12 of 20

    How do you modify an existing database table using Migrations? Explain with an example of adding a new column.

  13. Question 13 of 20

    Explain the significance of HTTP Status Codes when implementing REST APIs in Laravel.

  14. Question 14 of 20

    Write the Laravel artisan command to create a Model, Migration, Factory, and Controller simultaneously. Explain the flags used.

  15. Question 15 of 20

    How does Laravel handle database configuration for different environments (Local vs Production)?

  16. Question 16 of 20

    Explain how to perform a Join operation using Laravel's Query Builder.

  17. Question 17 of 20

    What are API Routes in Laravel? How do they differ from Web Routes?

  18. Question 18 of 20

    Define Database Seeding and write the procedure to run a specific seeder class.

  19. Question 19 of 20

    Illustrate Aggregates in Query Builder with examples (count, max, min, avg, sum).

  20. Question 20 of 20

    Discuss the Active Record Pattern and how Eloquent ORM implements it.

That's unit 6

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.