Hello ,
I have one question that am struggle with and I need help please.
I have two table students and courses which is each student take more than one course .
for example St1 take 2 courses (C1 , C2).
St2 take 3 courses (C1,C2, C3).
I need to create a table that contain student information plus all the courses and the score for each course in one row.
for example St1_Id ,C1_code ,C1_name ,C1_Score ,C2_code C2_name , C2_Score ..etc.
My Struggle in the insert statement
I tried the following but it show an error
Insert Into Newtable
( St_ID, C1_code,c1_name, C1_Score ,C2_code ,C2_name,C2_score)
Select
(Select St_ID from Student)
,
(Select C_code,c_name,c_Score
from course ,student
where course.Stid =Studet.stid and C_code= 'CMP')
,
(Select C_code,c_name,c_Score
from course ,student
where course.Stid =Studet.stid and C_code= 'SYS')
;
May you please help in my inster into stmt
thank you.