Answered step by step
Verified Expert Solution
Link Copied!

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.
Students(ID, fName, lName, phone, dateOFBirth)
Clubs(ID, 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.
MemberOf(studentID, 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 (i.e., Notepad++) and save it as a SQL script file.
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 remove the tables from the database.
3. Write SQL statements to define the above three tables in the database.
4. Write SQL statements to display the structure of the newly-built tables.
5. Write SQL statements to load records into the tables. Add one more record
with your own data.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions