Quiz Space

Modern Application Development I · End Term · 13 Apr 2025 · January 2025 term · Set QDD3

Question 15: Consider the schema for the Class Student. What will be …

Question 15

+4.5 marksOne correct option

Consider the schema for the Class Student.

sql
CREATE TABLE "student" (
"s_id" INTEGER,
"roll_number" TEXT NOT NULL UNIQUE,
"first_name" TEXT NOT NULL,
"last_name" TEXT NOT NULL,
PRIMARY KEY("s_id" AUTOINCREMENT)
);

What will be the output of the flask_sqlalchemy command given below?

python
>>> s1 = Student(roll_number = "M01", first_name = "John", last_name = "Dewis")
>>> db.session.add(s1)
>>> s2 = Student(roll_number = "M02", first_name = "John", last_name = "Nector")
>>> db.session.add(s2)
>>> s3 = Student(roll_number = "M03", first_name = "Nick", last_name = "Dewis")
>>> db.session.add(s3)
>>> db.session.commit()
>>> user1= Student.query.filter_by(first_name="John").first()
>>> user1.first_name= "Nick"
>>> db.session.commit()
>>> s1 = Student.query.all()
>>> for student in s1:
print(student.first_name)
print(student.last_name)
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 15 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD3 13 Apr 2025). It carries 4.5 marks.

More questions from this paper

  1. Q1A certain text document consisting of only alphanumeric characters (including spaces) takes 320000 bits, when encoded w…
  2. Q2Which of the following is true about the term “stateful” in the client-server model?
  3. Q3Consider the following git branches for a remote repository.
  4. Q4The Quiz Master application at IITM BS allows students to attempt quizzes online. To prevent automated bots from mass-s…
  5. Q5A mobile client starts from and is cruising away continuously at 120 kmph from the network tower whose network range is…
  6. Q6Consider the code below in a file called test_students.py test_students.py Which of these is the correct output when th…
  7. Q7Consider the following models Department and Student corresponding to tables department and student in SQLite database.…
  8. Q8Consider the following statements and choose the correct option\ Statement 1: It is always mandatory to implement serve…
  9. Q9Figure question
  10. Q10Consider the following example: Which of the following accessibility principles is followed in this example?
  11. Q11Figure question
  12. Q12Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  13. Q13Consider the following Python code. File name: main.py What will be the output, when running the above code using the c…
  14. Q14Consider the following Python code File name: main_test.py What will be the output of running the above python script u…
  15. Q16Consider the following flask application "app.py" given below. If the application is running locally on http://127.0.0.…
  16. Q17You are given a project with three files: conftest.py, test_multiples_of_3_and_6.py, and test_multiples_of_13.py. The p…
  17. Q18A client machine and a server machine located 120 kilometers apart start moving towards each other along a straight lin…
  18. Q19Which of the following are benefits of using the MVC (Model-View-Controller) architecture?
  19. Q20Consider the following Python code. Which of the following statement(s) should replace ==Missing code here=== so that i…
  20. Q21Which of the following statements about server architectures, Apache and Nginx, is/are correct?
  21. Q22Consider the following route in the flask for a signup page and select the correct option:
  22. Q23Consider the following HTML code.
  23. Q24Consider the following Flask app code. The above flask app is running on “http://127.0.0.1:5000”. Which of the followin…
  24. Q25Consider the following Jinja2 templating code: Will the above Jinja templating code return the correct output? If yes, …
  25. Q26The following Flask-RESTful API code snippet is intended to create a RESTful API for managing student registrations in …
  26. Q27IITM BS degree program conducts an annual event called Paradox every summer. The event is open to students, and partici…
  27. Q28IITM BS degree program conducts an annual event called Paradox every summer. The event is open to students, and partici…
  28. Q29The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the …
  29. Q30The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the …
  30. Q31Which of the following storage types should be used for storing frequently accessed small student records that need low…
  31. Q32The college wants to store archived counseling records from past students for future reference. These records are rarel…