Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
