Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
student_registration sc ON s.student_id = sc.student_id
*
ERROR at line 12:
ORA-00942: table or view does not exist
select * from student_registration_details order by 1
*
ERROR at line 1:
ORA-00942: table or view does not exist

What I have tried:

CREATE VIEW student_registration_details AS
SELECT
s.studid AS "Student id",
s.firstname AS "First name",
s.lastname AS "Last name",
c.coursename AS "Course name",
c.duration AS "Duration",
r.doj AS "Date of joining"
FROM
student s
JOIN
registration r ON s.studid = r.studid
JOIN
course c ON r.courseid = c.courseid;
Posted
Comments
Richard MacCutchan 2-Dec-23 4:32am    
The error message is clear, the view has not yet been created.
0x01AA 3-Dec-23 6:56am    
Just guessing.
Can it be that

JOIN registration r ON s.studid = r.studid

should be more

JOIN student_registration r ON s.studid = r.studid
Maciej Los 4-Dec-23 3:07am    
I gues, you're right. :)
0x01AA 4-Dec-23 11:58am    
:)

1 solution

One problem you are having is you're not creating the view correctly, try this;
Refer: Joins and aliases[^]
SQL
CREATE VIEW student_registration_details AS
SELECT
s.studid AS "Student id",
s.firstname AS "First name",
s.lastname AS "Last name",
c.coursename AS "Course name",
c.duration AS "Duration",
r.doj AS "Date of joining"
FROM
student AS s
JOIN
registration AS r ON s.studid = r.studid
JOIN
course AS c ON r.courseid = c.courseid;
 
Share this answer
 
Comments
0x01AA 3-Dec-23 10:16am    
Usually a missing 'AS' does not cause a problem. At least not for MSSQL and many others ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900