add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE course(course_id INT, title VARCHAR(10), dept_name VARCHAR(10), credits INT);
CREATE TABLE instructor(ID INT, name VARCHAR(10), dept_name VARCHAR(10), salary INT);
CREATE TABLE teaches(ID INT, course_id INT, sec_id INT, semester INT, year INT);
INSERT INTO course VALUES (1, 'Course_1', 'DeptX', 10);
INSERT INTO instructor VALUES (1, 'Prof X', 'DeptY', 10000);
INSERT INTO teaches VALUES (1, 1, 10,10,2000)
select name, title
from instructor natural join teaches, course
where teaches.course_id = course.course_id;
name title
Prof X Course_1
select name, title
from instructor natural join teaches natural join course;

SELECT i.name, c.title
FROM instructor i
JOIN teaches t
ON t.ID = i.ID
JOIN course c
ON t.course_id = c.course_id;
name title
Prof X Course_1