wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Django-quiz

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following SQL clauses is used to DELETE tuples from a database table?

a)

DELETE

b)

REMOVE

c)

DROP

d)

CLEAR

2.

The UPDATE SQL clause can _____________

a)

update only one row at a time

b)

update more than one row at a time

c)

delete more than one row at a time

d)

delete only one row at a time

3.

How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?

a)

UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

b)

MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

c)

MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

d)

UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

4.

SQL query to find all the "cities" from the "weather" table whose humidity is 95.

a)

SELECT city WHERE humidity = 95

b)

SELECT city FROM weather WHERE humidity = 95

c)

SELECT humidity = 89 FROM weather

d)

SELECT city FROM weather

5.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

6.

What is a method in python?

a)

a way of doing something

b)

a special kind of function that is defined in a class definition

c)

the creation of an instance of a class

d)

orderliness of thought or behavior; systematic planning or action

7.

Attributes of an object are also known as

a)

methods

b)

properties

c)

classes

d)

functions

8.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
9.

Identify the term that describes the creation of a new object.

a)

instantiation

b)

declare

c)

iteration

d)

initialize

10.

What does __init__ do?

a)

Constructs the instance

b)

Initialize the instance values

c)

Calls the Super class

d)

Creates a circle

11.

Identify the code that properly creates an instance of a class named Car.

a)

camero.car(make, model)

b)

tesla = car.make()

c)

mustang = Car(make,model)

d)

porsche = car.make.model()

12.

What happens when url.py file is edited while the development server is still running?

a)

Development server terminates.

b)

The development server automatically restarts.

c)

The development server does nothing.

d)

The web page is automatically reloaded.

13.

What is the value of DEBUG when website is online/ or deployed?

a)

True

b)

False

c)

None

d)

0

14.

What does {{ name }} this mean in Django Templates?

a)

It will be displayed as name in HTML.

b)

The name will be replaced with values of Python variable.

c)

{{ name }} will be the output.

d)

None of the above

15.

What is a Django App?

a)

An app is a functionality, including models and views, that lives together in a single Python package.

b)

Django app is a python package with its own components.

c)

Django app is an extended package with base package is Django.

d)

All of the above

16.

What are Migrations in Django?

a)

Migrations are files where Django stores changes to your models.

b)

They are files saved in migrations directory.

c)

They are created when you run makemigrations command.

d)

All of the above

17.

What are request.GET and request.POST objects?

a)

Python Dictionaries

b)

Python Lists

c)

Python Dictionary-Like objects

d)

None of the above

18.

What is the difference between media and static files settings?

a)

The media settings holds videos and images while static files hold CSS, js.

b)

The media setting manages files uploaded by the user. Static settings manages the static assets of the website.

c)

All of the above

d)

None of the above

19.

Which of these commands are used to print the SQL query of the model?

a)

migrate

b)

makemigrations

c)

sqlmigrations

d)

showmigration

20.

Select the difficulty level of the quiz.

a)

Easy

b)

Medium

c)

Hard