-- Retrieve all students with their program names, including students without programs 

-- Return the student name( as Student_Name) and the program name(As Program_Name)

CREATE TABLE Student( 
    ID MEDIUMINT UNSIGNED PRIMARY KEY, 
    Name VARCHAR(150), 
    Age INT, 
    Program_ID INT, 
    FOREIGN KEY(Program_ID) REFERENCES Program(ID)
    );

CREATE TABLE Program ( 
    ID INT PRIMARY KEY, 
    Name VARCHAR(100), 
    Number_Of_Courses INT, 
    Rating DECIMAL(3,2), 
    Department_ID INT
    );

SELECT Student.Name AS Student_Name 
       Program.Name AS Program_Name 

FROM Student 
LEFT JOIN Program ON Student.Program_ID = Program.ID; 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: