Answer the question
In order to leave comments, you need to log in
How to pull additional course and student id information from one table and put into another?
I have a database which has a PurchaseList table. It contains the following fields: student_name,
course_name, price, subscriptionDate. The task is to use the table PurcahseList to pull out additional. information (ID of the course and student) and add everything to another table with the fields: student_id and course_id.
How can I do that?
Answer the question
In order to leave comments, you need to log in
Well, something like this, depending on what database.
INSERT INTO other_table (student_id, course_id)
VALUES (SELECT course_id, student_id FROM PurchaseList)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question