0
votes
select 
    grade.sectionid,
    grade.studentid,
    course.courseid
FROM grade, course, section
    INNER JOIN grade
            ON grade.sectionid = section.sectionid
    INNER JOIN course
            ON course.courseid = section.courseid;

Keep getting error: ORA-00918: column ambiguously defined

error is on the course.courseid line

2

2 Answers

0
votes
SELECT
    grade.sectionid,
    grade.studentid,
    course.courseid
FROM section
    INNER JOIN grade
            ON grade.sectionid = section.sectionid
    INNER JOIN course
            ON course.courseid = section.courseid;
0
votes

You have course defined twice in FROM so it doesn't know which one to pull the information from. Give your tables in FROM some aliases so you can be specific on where things come from, or remove one of the references if you didn't mean to include it twice.

...
FROM grade, course, section
...
INNER JOIN course
...