Quiz Space

Modern Application Development I · Quiz 2 · 6 Aug 2023 · May 2023 term

Question 10: Consider the following models Brand and Cellphone corres…

Question 10

+4.5 marksOne correct option

Consider the following models Brand and Cellphone corresponding to tables brand and cellphone in SQLite database.

python
class Brand(db.Model):
id = db.Column(db.Integer(), primary_key = True)
name = db.Column(db.String(), unique = True)
class Cellphone(db.Model):
id = db.Column(db.Integer(), primary_key = True)
name = db.Column(db.String(), unique = True)
brand = db.Column(db.Integer(), unique = True, db.ForeignKey("brand.id"))

Based on the model schemas, what relationship do the classes Brand and Cellphone share?

  1. A

    One-to-One

  2. B

    One-to-Many

  3. C

    Many-to-Many

  4. D

    The tables are not at all related

Show answer

Correct answer

  • A

    One-to-One

Question 10 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 6 Aug 2023, in the May 2023 term (IIT M FOUNDATION AN2 EXAM QPF2 06 Aug 2023). It carries 4.5 marks.

More questions from this paper

  1. Q1Consider the following flask application and select the correct option if the application is running locally on http://…
  2. Q2Figure question
  3. Q3Figure question
  4. Q4Consider the following view function. If this flask app is running locally on <u>http://127.0.0.1:5000</u>, which of th…
  5. Q5What will be the output of the following Python code snippet on the terminal?
  6. Q6Consider the following HTML Document file given below. index.html Suppose the index.html is rendered on the browser. Wh…
  7. Q7Consider the following Python code snippet. If this application is running locally on http://127.0.0.1:5000, which of t…
  8. Q8Consider the following code. If the flask application is running on <u>http://127.0.0.1:5000</u>, what will browser ren…
  9. Q9In the code snippet given below, what should come in place of code 1 and code 2 such that one parent can have multiple …
  10. Q11Consider the schema for the Class Student. What will be the output of the flask_sqlalchemy command given below?
  11. Q12Consider the following route in the flask for a signup page and select the correct option.
  12. Q13Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  13. Q14Which of the following is/are valid JSON format.
  14. Q15Consider the following flask application. If this flask app is running locally on http://localhost:5000, then which of …
  15. Q16Consider the following flask application. If this flask app is running locally on <u>http://localhost:5000</u>, what is…