0% found this document useful (0 votes)
87 views4 pages

Dbms Lab Report: K.Priyanka 191fa04570

This lab report summarizes the student's work in developing a relational database schema for a boat club using SQL DDL commands. The student created tables for sailors, boats, and reservations, then used alter, drop, rename, and truncate commands to modify the tables. The commands and respective outputs are documented to show the changes made to the table structures and data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views4 pages

Dbms Lab Report: K.Priyanka 191fa04570

This lab report summarizes the student's work in developing a relational database schema for a boat club using SQL DDL commands. The student created tables for sailors, boats, and reservations, then used alter, drop, rename, and truncate commands to modify the tables. The commands and respective outputs are documented to show the changes made to the table structures and data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

DBMS LAB REPORT

K.PRIYANKA
191fa04570

EXPERIMENT-1: Develop Relational Database Schema for Boat Club database


using DDL.
TOOL USED: Paiza
LINK TO REVIEW EXECUTION:
https://paiza.io/projects/WVlR0q0tiETapVPSJZPUJA?
language=mysql#&togetherjs=41xUfftisJ
COMMANDS AND RESPECTIVE OUTPUTS:

1. CREATE :
COMMAND: create table sailors(SID varchar(20),name char(20),rating
int(21),age int(4)); desc sailors;

OUTPUT:

Field Type Null Key Default


Extra
SID varchar(20) YES NULL
Name char(20) YES NULL
Rating int YES NULL
Age int YES NULL

COMMAND: create table boat(BID char(10),name


char(20),colour char(10)); desc boat; OUTPUT:

Field Type Null Key Default Extra


BID char(10) YES NULL
Name char(20) YES NULL colour
char(10) YES NULL

COMMAND:
create table reservation(SID char(20),BID char(20),time date,duration
int); desc reservation; OUTPUT:

Field Type Null Key Default Extra


SID char(20) YES NULL
BID char(20) YES NULL
Time date YES NULL Duration
int YES NULL

2. ALTER TABLE...ADD...:

COMMAND:
alter table sailors add(experience int(20));
desc sailors; OUTPUT:

Field Type Null Key Default Extra


SID varchar(20) YES NULL
Name char(20) YES NULL
Rating int YES NULL
age int YES NULL
experience int YES NULL

3. ALTER TABLE...MODIFY..:

COMMAND:
alter table sailors modify rating int(5);
desc sailors;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL name char(20) YES
NULL
Rating int YES NULL age
int YES NULL

4. ALTER TABLE..DROP..:

COMMAND:
alter table sailors drop column experience;
desc sailors;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL name char(20) YES
NULL rating int YES NULL age int
YES NULL

5. ALTER TABLE..RENAME...:

COMMAND:
alter table sailors change column name sailorname varchar(10);
desc sailors;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL sailorname varchar(10) YES
NULL rating int YES NULL age int
YES NULL

6. DROP TABLE:

COMMAND:
drop table sailors;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL sailorname varchar(10) YES
NULL rating int YES NULL Age int
YES NULL

7. RENAME: COMMAND:
rename table sailors to wrecker;
desc wrecker;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL name char(20) YES
NULL Rating int YES NULL age int
YES NULL

8. TRUNCATE TABLE:

COMMAND:
truncate table sailors;
desc sailors;
OUTPUT:

Field Type Null Key Default Extra SID


varchar(20) YES NULL name char(20) YES
NULL rating int YES NULL age int
YES NULL

You might also like