Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

CREATE A TABLE OF STUDENT DETAILS

 {Stu-ID, Name , Surname , Class , Age ,Gender}


 Stu-ID -var-char (15)(Primary key)
 Gender var-char (1)(‘Default’ F)
CREATE TABLE FOR SPORTS DETAILS.
 {Stu-ID var char (6), Name var-char (15) ,Surname var-char
(20) ,House var-char(15), Sport-ID var-char (6), Gender var-char(1),
Age numeric (2).}
 Stu-ID -char (Foreign key)
 Sport-ID var-char(Primary key) e.g Volleyball

SPORTS DETAILS
Student -ID Sport-ID Name House
FCA001 Ath0023 Athletics Lion
FCA002 Volo011 Volleyball -

INSERTING A TABLE
 Insert into FCA student.sport(Stu-ID, Sport-ID,
Name ,,House)’values’(‘FCA001, ’ATH ’,’ Athletics ‘, ‘ Lion’).
NB: you can use a shorter method of removing details such as name and
ID’s but you can
HOW TO DELETE DATA IN A TABLE.
 Use the command truncate table
ADDING A FIELD
 Use the command alter table e. add house e.t.c.
 Alter is also used to rename / change name.

You might also like