# Django Web Framework - Module Quiz: Models

1. **The** `sqlmigrate` **command generates the SQL query that will be executed when the migration is done.**
    
    * <mark>True</mark>
        
    * False
        
2. **Which of the following sentences about the primary key is correct?** Select all that apply.
    
    * <mark>The primary key attribute of the model should not be null.</mark>
        
    * The primary key attribute of the model should be an integer.
        
    * The primary key attribute of the model can be a string.
        
    * <mark>The primary key attribute of the model should be unique for each instance.</mark>
        
3. **To use MySQL with Django, what actions need to be taken?**
    
    * <mark>Install mysqlclient</mark>
        
    * <mark>Set 'ENGINE': 'django.db.backends.mysql'</mark>
        
    * <mark>Set 'USER': 'root'</mark>
        
    * Set 'PORT': '8000'
        
4. **Which of the following statements are about the ForeignKey type is correct?** Select all that apply.
    
    * <mark>A field of the </mark> `ForeignKey` <mark> type is used to establish a many-to-one relationship.</mark>
        
    * <mark>A field of the </mark> `ForeignKey` <mark> type is used to establish a one-to-many relationship.</mark>
        
    * A field of the `ForeignKey` type is used to establish a one-to-one relationship.
        
    * A field of the `ForeignKey` type is used to establish a many-to-many relationship.
        
5. **Which of the following built-in field types of a model stores numeric data?** Select all that apply.
    
    * CharField
        
    * URLField
        
    * <mark>FloatField</mark>
        
    * <mark>IntegerField</mark>
        
6. **The Django form is rendered in a tabular manner with a tag in the template. Identify the correct tag.**
    
    * {{ [form.as](http://form.as)\_p }}
        
    * <mark>{{ </mark> [<mark>form.as</mark>](http://form.as)<mark>_table }}</mark>
        
    * {{ [form.as](http://form.as)\_ul }}
        
    * {{ [form.as](http://form.as)\_div }}
        
7. **Which of the following expressions extracts the data in the form submitted by the user?**
    
    * <mark>request.POST</mark>
        
    * [form.is](http://form.is)\_valid
        
    * request.GET
        
8. **Which of the following statements about a staff user is correct?** Select all that apply.
    
    * A staff user cannot modify the permissions enabled for a user.
        
    * <mark>A staff user can create a group</mark>
        
    * <mark>A staff user can log in to the admin site</mark>
        
    * A staff user cannot create a new user
        
9. **True or False. A superuser is allocated all permissions automatically to add, delete, and change the details of other users.**
    
    * <mark>True</mark>
        
    * False
        
10. **Which command option of the** [`manage.py`](http://manage.py) **script is used to create an admin user for the Django admin site?**
    
    * shell
        
    * runserver
        
    * createuser
        
    * <mark>createsuperuser</mark>
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1731214354090/beb82082-3bbc-41f8-8b08-d5a8a2d35e0d.png align="center")
