NEW
Font size
WorksheetsDjango-quiz
Total questions: 20
Worksheet time: 11mins
Which of the following SQL clauses is used to DELETE tuples from a database table?
DELETE
REMOVE
DROP
CLEAR
The UPDATE SQL clause can _____________
update only one row at a time
update more than one row at a time
delete more than one row at a time
delete only one row at a time
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
SQL query to find all the "cities" from the "weather" table whose humidity is 95.
SELECT city WHERE humidity = 95
SELECT city FROM weather WHERE humidity = 95
SELECT humidity = 89 FROM weather
SELECT city FROM weather
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”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
What is a method in python?
a way of doing something
a special kind of function that is defined in a class definition
the creation of an instance of a class
orderliness of thought or behavior; systematic planning or action
Attributes of an object are also known as
methods
properties
classes
functions
Identify the term that describes the creation of a new object.
instantiation
declare
iteration
initialize
What does __init__ do?
Constructs the instance
Initialize the instance values
Calls the Super class
Creates a circle
Identify the code that properly creates an instance of a class named Car.
camero.car(make, model)
tesla = car.make()
mustang = Car(make,model)
porsche = car.make.model()
What happens when url.py file is edited while the development server is still running?
Development server terminates.
The development server automatically restarts.
The development server does nothing.
The web page is automatically reloaded.
What is the value of DEBUG when website is online/ or deployed?
True
False
None
0
What does {{ name }} this mean in Django Templates?
It will be displayed as name in HTML.
The name will be replaced with values of Python variable.
{{ name }} will be the output.
None of the above
What is a Django App?
An app is a functionality, including models and views, that lives together in a single Python package.
Django app is a python package with its own components.
Django app is an extended package with base package is Django.
All of the above
What are Migrations in Django?
Migrations are files where Django stores changes to your models.
They are files saved in migrations directory.
They are created when you run makemigrations command.
All of the above
What are request.GET and request.POST objects?
Python Dictionaries
Python Lists
Python Dictionary-Like objects
None of the above
What is the difference between media and static files settings?
The media settings holds videos and images while static files hold CSS, js.
The media setting manages files uploaded by the user. Static settings manages the static assets of the website.
All of the above
None of the above
Which of these commands are used to print the SQL query of the model?
migrate
makemigrations
sqlmigrations
showmigration
Select the difficulty level of the quiz.
Easy
Medium
Hard
