Insert values from different tables in a single statement [message #669908] |
Wed, 23 May 2018 22:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/76f1fdd6cbb4ee489c1aa9da8403f64e?s=64&d=mm&r=g) |
caiz
Messages: 2 Registered: May 2018
|
Junior Member |
|
|
I would like to insert these values into a table. Student_ID, Student_Name are in the STUDENT table. Course_Code, Course_Name are in the COURSE table. Grade is in the GRADE table.
I have tried to put this in a single statement using:
INSERT INTO student (student_no, student_name, course_code, course_name, grade)
VALUES ('S-1478','Carol Wang', 'P1', 'Programming 1',70);
and have tried separating them:
INSERT INTO student (student_no, student_name)
VALUES ('S-7895','John Little');
INSERT INTO course (course_code, course_name)
VALUES ('ML', 'Machine Learning');
Both, with no luck
|
|
|
|
|
|
|
|