We are going to work with the database that contains the Students and Department tables. Here's what they look like:
Department:
id | name |
|---|---|
1 | Engineering |
2 | Mathematics |
45 | Physics |
Students:
id | full_name | GPA | department | |
|---|---|---|---|---|
1 | Alan Turing | 9.5 | 1 | |
2 | Katherine Johnson | 10 | 2 | |
3 | Helen Quinn | 8.7 | 45 |
Ask the user for a department name, use the department's name to find out its id. Then, use the student information that is defined below, and insert a new student in the Students table. Finally, commit the changes. The cursor has been previously defined.