CREATE TABLE MovieCharacter (
    CharacterID INT UNSIGNED PRIMARY KEY,
    Name VARCHAR(30),
    Franchise VARCHAR(20),
    FirstAppearanceYear INT UNSIGNED
);

CREATE TABLE Movie (
    MovieID INT UNSIGNED PRIMARY KEY,
    Title VARCHAR(80) NOT NULL,
    Franchise VARCHAR(30),
    ReleaseYear INT UNSIGNED,
    BoxOfficeGross BIGINT UNSIGNED
);

INSERT INTO MovieCharacter (CharacterID, Name, Franchise, FirstAppearanceYear)VALUES
(1, 'Harry Potter', 'Harry Potter', 2001),
(2, 'Iron Man', 'Marvel', 2008),
(3, 'Darth Vader', 'Star Wars', 1977),
(4, 'Hermione Granger', 'Harry Potter', 2001),
(5, 'Captain America', 'Marvel', 2011),
(6, 'Frodo Baggins', 'Lord of the Rings', 2001),
(7, 'Batman', 'DC', 2005),
(8, 'Wonder Woman', 'DC', 2017),
(9, 'Legolas', 'Lord of the Rings', 2001),
(10, 'Jake Sully', 'Avatar', 2009);

INSERT INTO Movie (MovieID, Title, Franchise, ReleaseYear, BoxOfficeGross)VALUES
(1, 'Harry Potter and the Sorcerers Stone', 'Harry Potter', 2001, 974755371),
(2, 'Iron Man', 'Marvel', 2008, 585174222),
(3, 'Star Wars: A New Hope', 'Star Wars', 1977, 775398007),
(4, 'Avengers: Endgame', 'Marvel', 2019, 2797800564),
(5, 'Harry Potter and the Chamber of Secrets', 'Harry Potter', 2002, 879500000),
(6, 'The Lord of the Rings: The Fellowship of the Ring', 'Lord of the Rings', 2001, 871530324),
(7, 'The Dark Knight', 'DC', 2008, 1004558444),
(8, 'Wonder Woman', 'DC', 2017, 822854286),
(9, 'Avatar', 'Avatar', 2009, 2923706026),
(10, 'The Lord of the Rings: The Two Towers', 'Lord of the Rings', 2002, 926047111);

SELECT MovieCharacter.Name , Movie.Title 
FROM MovieCharacter 
LEFT JOIN Movie ON MovieCharacter.FirstAppearanceYear = Movie.ReleaseYear; 

SELECT MovieCharacter.Name , Movie.BoxOfficeGross 
FROM MovieCharacter 
LEFT JOIN Movie ON MovieCharacter.FirstAppearanceYear = Movie.ReleaseYear; 

SELECT Movie.Title , MovieCharacter.Name 
FROM Movie 
RIGHT JOIN  MovieCharacter ON Movie.ReleaseYear = MovieCharacter.ReleaseYear; -- values are the same thats how they work 


-- REMEMBER, LEFT, RIGHT, LEFT 


-- SELECT what you want to see 
-- FROM Where you start 
-- JOIN how you connect the dots 

Embed on website

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