EXPERIMENT-1: Develop Relational Database Schema for Boat Club database using
DDL.
TOOL USED: Paiza
LINK TO REVIEW
https://paiza.io/projects/uHwiisL0sNGEcogoLzVyEw?language=mysql
COMMANDS AND RESPECTIVE OUTPUTS:
CREATE database BoatClube;
CREATE table Sailors(SID int,Name char(20),Rating int,Age int);
DESC Sailors;
Field Type Null Key Default Extra
SID int YES NULL
Name char(20) YES NULL
Rating int YES NULL
Age int YES NULL
ALTER table Sailors add(gender char(10));
DESC Sailors;
Field Type Null Key Default Extra
SID int YES NULL
Name char(20) YES NULL
Rating int YES NULL
Age int YES NULL
Field Type Null Key Default Extra
SID int YES NULL
Name char(20) YES NULL
Rating int YES NULL
Age int YES NULL
gender char(10) YES NULL
CREATE table Boat(BID int,Name char(20),Colour char(10));
DESC Boat;
Field Type Null Key Default Extra
BID int YES NULL
Name char(20) YES NULL
Colour char(10) YES NULL
ALTER table Boat modify BID varchar(10);
DESC Boat;
Field Type Null Key Default Extra
BID int YES NULL
Name char(20) YES NULL
Colour char(10) YES NULL
Field Type Null Key Default Extra
BID varchar(10) YES NULL
Name char(20) YES NULL
Colour char(10) YES NULL
Field Type Null Key Default Extra
SID int YES NULL
BID int YES NULL
Date date YES NULL
Duration int YES NULL
CREATE database BoatClub;
CREATE table Reservations(SID int,BID int,Date date,Duration int);
DESC Reservations;
Field Type Null Key Default Extra
SID int YES NULL
BID int YES NULL
Date date YES NULL
Duration int YES NULL
ALTER table Reservations DROP column date;
DESC Reservations;
Field Type Null Key Default Extra
SID int YES NULL
BID int YES NULL
Date date YES NULL
Duration int YES NULL
Field Type Null Key Default Extra
SID int YES NULL
BID int YES NULL
Duration int YES NULL
ALTER table Boat RENAME COLUMN BID to BoatID;
DESC Boat;
Field Type Null Key Default Extra
BoatID int YES NULL
Name char(20) YES NULL
Colour char(10) YES NULL
RENAME table Sailors to SailorsInfo;
DESC SailorsInfo;
Field Type Null Key Default Extra
SID int YES NULL
Name char(20) YES NULL
Rating int YES NULL
Age int YES NULL
TRUNCATE table Reservations;
DESC Reservations;
DROP table Boat;
DESC Boat;
Table 'test.Boat' doesn't exist
NOTE: I should see total 9 commands execution and their respective outputs.