Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following database schema for student organizations. Students ( ID , fName, lName, phone, dateOFBirth ) Clubs ( ID , title, establishedDate ) Note
Consider the following database schema for student organizations.
StudentsID fName, lName, phone, dateOFBirth
ClubsID title, establishedDate
Note that table Clubs has two candidate keys: ID and title. One is
implemented as the PRIMARY KEY, and the other is a UNIQUE KEY.
MemberOfstudentID clubID, joinedDate
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 joinedDate. 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 ie Notepad and save it as a SQL script file.
Tasks:
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.
WRITE SQL statements to remove the tables from the database.
Write SQL statements to define the above three tables in the database.
Write SQL statements to display the structure of the newlybuilt tables.
Write SQL statements to load records into the tables. Add one more record
with your own data.
Step 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