Assignment Python and Databse
Assignment Python and Databse
You have been tasked with developing a web application using Flask and MySQL
to manage student and course information. The application should facilitate CRUD
(Create, Read, Update, Delete) operations for both students and courses, and
display a dashboard interface for easy management.
Requirements:
1. Database Setup:
o Create a MySQL database named students_db.
o Design the following tables:
students:
id (INT, Primary Key, Auto Increment)
name (VARCHAR(100))
age (INT)
grade (FLOAT)
courses:
id (INT, Primary Key, Auto Increment)
name (VARCHAR(100))
description (TEXT)
student_courses:
student_id (INT, Foreign Key referencing students.id)
course_id (INT, Foreign Key referencing courses.id)
Primary Key on (student_id, course_id)
2. Flask Application:
o Implement a Flask application (app.py) with the following routes:
/: Display a dashboard with sections for managing both students
and courses.
Students Management:
/students: Display a table listing all students with options
to add, update, and delete students.
/students/add: Form to add a new student. Upon
submission, insert the student record into the students
table.
/students/update/<int:id>: Form to update an existing
student record identified by <int:id>.
Instructions:
Submission: