Multiple Table Test
Multiple Table Test
Instructions:
1. Create Database:
Write an SQL statement to create a new database named Movies.
2. Switch Database:
Write an SQL statement to switch to the Movies database.
3. Create Movies Table:
Write an SQL statement to create a table named movies with the following columns:
○ movie_id (Primary Key, Integer)
○ movie_name (VARCHAR, 100 characters)
○ release_year (Integer)
○ genre_id (Foreign Key, Integer)
4. Create Genres Table:
Write an SQL statement to create a table named genres with the following columns:
○ genre_id (Primary Key, Integer)
○ genre_name (VARCHAR, 50 characters)
5. Insert Records into Genres Table:
Write SQL statements to insert the following records into the genres table:
genre_i genre_nam
d e
1 Action
2 Drama
3 Romance
4 Comedy
5 Thriller
6.
Insert Records into Movies Table:
Write SQL statements to insert the following records into the movies table:
movie_i movie_name release_yea genre_i
d r d
1 KGF 2018 1
3 Googly 2013 4
5 Gaalipata 2008 1
6 Ugramm 2014 5
7 Thithi 2015 2
End of Test