Question 15
Consider the schema for the Class Student.
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?
>>> 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)