Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
OUTER JOIN
CREATE TABLE myStudents ( id INT, name VARCHAR(100), age INT CHECK(age > 0) ); CREATE TABLE myCourses( id INT PRIMARY KEY, name VARCHAR(100), catagory VARCHAR(100), numberOfStudents INT CHECK ( numberOfStudents > = 0) ); CREATE TABLE enrolled( student INT, course INT, PRIMARY KEY (student, course) ) INSERT INTO enrolled VALUES (1,1), (1,2), (2,3), (2,1), (3,1), (1,4); INSERT INTO myStudents VALUES (1,'Petr', 20), (2, 'AVA', 23); INSERT INTO myCourses (name, numberOfStudents, id, catagory) VALUES ('SQL', 5000, 1, 'Development'), ('Java', 10000, 2, 'Programming'), ('C', 1000, 3, 'Programming'); SELECT s.name as student, c.name as course FROM enrolled FULL OUTER JOIN myStudents as s ON s.id = enrolled.student FULL OUTER JOIN myCourses as c ON c.id = enrolled.course;
run
|
edit
|
history
|
help
0
Running Total
zani
Empresa
DGDFGDFG
store2
split a string into pairs of words
on_thi_cuoi_ky
MyDb
Create MS SQL Server CUSTOMERS Table
Mass Insert using Except