Quiz Space

Modern Application Development I · End Term · 28 Apr 2024 · January 2024 term · Set QDF3

Question 7: In the code snippet given below, what should come in plac…

Question 7

+3 marksOne correct option

In the code snippet given below, what should come in place of code 1 and code 2 such that one book can have multiple sections and the converse does not hold true?

python
from sqlalchemy import ForeignKey
from sqlalchemy import Integer, Column
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import relationship
class Base(DeclarativeBase):
Pass
class Section(Base):
__tablename__ = "section_table"
id = Column(Integer, primary_key=True)
# write your code 1 here
class Book(Base):
__tablename__ = "book_table"
id = Column(Integer, primary_key=True)
# write your code 2 here
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 7 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 28 Apr 2024, in the January 2024 term (IIT M FOUNDATION DIPLOMA AN EXAM QDF3 28 Apr 2024). It carries 3 marks.

More questions from this paper

  1. Q1Consider the following Python code snippet. What will be printed on the terminal for the command python app.py 1 2 ?
  2. Q2Consider the following flask application running locally on http://127.0.0.1:5000 ? Which of the following URLs will th…
  3. Q3Consider the following view function. If this flask app is running locally on http://127.0.0.1:5000, which of the follo…
  4. Q4Which of the following is not a frontend framework?
  5. Q5Consider the following statements and select the correct option:\ Statement 1: In a database, an index can only be crea…
  6. Q6Figure question
  7. Q8Consider the following flask app and Jinja2 template. app.py index.html If the flask app is running locally on http://1…
  8. Q9Figure question
  9. Q10Consider the following flask application. If this flask app is running locally on http://localhost:5000, what is the ou…
  10. Q11Consider the following Python code snippet. log.py What will be the output on the terminal for the command: python log.…
  11. Q12The lens of an HDD can read data on the rotating disk with the speed of 42,000 bits per second. The disk is designed su…
  12. Q13Consider the following python code snippet. Which of the following statements, when substituted in place of === OUTPUT …
  13. Q14Figure question
  14. Q15Figure question
  15. Q16In an OpenAPI documentation, which field contains all the endpoints (routes) of the API?
  16. Q17Consider the below two data models Author and Book using SQLite database. What kind of relationship exists between Auth…
  17. Q18Consider a function func, and a set of test cases given below. Filename: test_file.py What will be the output on the te…
  18. Q19Consider the following python code snippet app.py, the html files, base.html and home.html residing in “templates” fold…
  19. Q20Consider the below Flask Restful API code snippet: app.py Assume that above app.py is running on http://127.0.0.1:5000/…
  20. Q21Consider the following graph that represents the variation in bandwidth of a network for an entire day (24 hours). Thre…
  21. Q22An HTML code and CSS code is given below. Which of the following correctly represents its rendered output? CSS Code: HT…
  22. Q23Consider the below two python files code snippets app.py and test_app_route.py. app.py test_app_route.py: Assume that a…
  23. Q24Which of the following is true about the term “stateful” in the client-server model?
  24. Q25Figure question
  25. Q26What is the name of the branch that we start with when we create a new git repository?
  26. Q27Which of the statements are true?
  27. Q28Consider a client ‘C’ and a server ‘S’, separated by distance ‘D’ are connected by a fictitious medium in which the spe…
  28. Q29Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  29. Q30Consider the following function to be tested and test functions given in the Python code snippet below. test_file.py On…
  30. Q31Consider the following Python code snippet. file.py Based on the above data, answer the given subquestions.
  31. Q32Consider the following Python code snippet. file.py Based on the above data, answer the given subquestions.