Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL Relational Database - Your task is to write SQL statements to define tables for the corresponding relations. Make sure that the data type and
SQL Relational Database - Your task is to write SQL statements to define tables for the corresponding relations. Make sure that the data type and size for each attribute are appropriate. For example, DATE data type is a better choice than a string data type for the attribute birthdate. In addition, you have to write SQL statements to load data into each table based on the given records. Put your SQL statements into a text editor (i.e., Notepad++) and save it as a SQL script file
You should use a text editor to type your SQL statements and save it as a SQL script file. A SQL script file is a text file which contains a sequence of SQL statements. Lab2Ex.sql is an example of the SQL script file. The file extension of a SQL script file is typical sal. You may use SOURCE command to run the whole script file (all SQL commands) or copy and paste each SQL statement from the text editor to MySQL client. You will be required to prepare and submit a number of SQL scripts for this and future labs. Tasks: 1. Write a SQL statement to select the database with your last name to store the data. If it does not exist in your MySQL server, use "CREATE DATABASE" command to create one. 2. Write SQL statements to define the above three tables in the database. 3. Write SQL statements to display the structure of the built tables. birthdate Consider the following database schema for a local library. Stars(ID, (Name, IName, email, birthdate) ID fName Name Email S101 Judith Barsi jbarsi@gmail.com S202 Marlon Brando Brando@gmail.com S203 Amy Anderson aPrice@yahoo.com 1978-12-15 1924-04-03 4. Write SQL statements to load records into the built tables. Add one more record with your own data. 1895-03-16 Movies(ID, title, genre, studio, released Year, boxOffice) ID Title genre Studio U0022 The Land Before Time Adventure Universal Pictures P0121 The Godfather Drama Paramount Pictures W0130 Harry Potter Fantasy Warner Bros. Pictures W0012 The Hobbit Fantasy Warner Bros. Pictures releasedYear boxOffice 1988 84,500,000 1972 136,800,000 2011 1,002,000,000 2012 1,021,000,000 Plays(starID, mold, cast) starID myID cast S101 U0022 Ducky S202 W0130 Vito CorleoneStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started