This is a school project which I am a bit lost on.
I have two tables with a relationship between
course
+-------------+----------------+
|id(primary) |coursename |
+-------------+----------------+
enrolled
+-------------+----------------+----------------+
|id(primary) |studentName |courseid(FK_from|
| | |course.id) |
+-------------+----------------+----------------+
I can insert a new course into the course table using the INSERT syntax however when I cannot find how I would go about inserting a new student that is enrolled onto the newly inserted course, I have looked at the MySQL docs and tried to hunt down tutorials, though none seem to be of any use. So if anyone could point me in the direction of tutorials that would be awesome.
Thanks in advance.
EDIT: After digging deeper - It would seem my understanding of FK is a bit warped. I was under the impression that I could Cascade on INSERT, but it only works on UPDATE and DELETE. Time to rethink.