Formatted Practical File
Formatted Practical File
Submittedto-
Submittedby-
Ms. HimaniMa’am PraptiYadav
Teacher’sSignature
Page 1
ACKNOWLEDGEMENT
[Teacher’s signature]
Page 2
CERTIFICATE
InternalExaminer
Signature
ExternalExaminer Principal
Signature SealandSignature
Page 3
Page 4
No. Practical Date Signature
1 Createastudenttablewiththestudentid,name,
andmarksasattributeswherethe student id istheprimary key.
2 Insertthedetailsofanewstudentintheabovetable
3 Deletethedetailsofastudentintheabovetable
4 Usetheselectcommandtogetthedetails ofthestudents
withmarksmorethan80
5 Findthemin,max,sum, andaverageofthemarks inastudent
markstable
6 Find the total number of customers from each country in
thetable(customerID,customerName,country)usinggroupby.
7 WriteaSQLquerytoorderthe(studentID,marks)tableindescen
ding order of themarks
WriteaSQLquerytodisplaythemarkswithoutdecimalplace
8 s, displaythereminderafterdivingmarksby3and
displaythesquareofmarks
WriteaSQLquerytodisplaynames intocapitalletters, small
9 letters, displayfirst3letters
ofname,displaylast3lettersofname,displaytheposition
theletter Ain name
10 Removeextraspacesfromleft,rightandbothsides fromthetext-
"InformaticsPracticesClassXII"
11 Displaytoday'sdatein"Date/Month/Year"format
12 Displaydayname,monthname,day,dayname,dayofmonth,day
of year fortoday'sdate
IPPRACTICALRECORDFILE | | Page4
Page 5
1. Createastudenttablewiththestudentid,name,
andmarksasattributeswherethestudent idistheprimarykey.
Ans.:
createtablestudent(studentidin
t(3)primarykey,
name varchar(20) not
null,marksdecimal(5,2));
2. Insertthedetailsofanewstudentintheabovetable.
Tabledata:
IPPRACTICALRECORDFILE | | Page5
Page 6
:
deletefromstudentwherestudentid=5;
4. Usetheselectcommandtogetthedetailsofthestudentswithmarksmorethan80.
Ans.:
select*fromstudentwheremarks>80;
IPPRACTICALRECORDFILE | | Page6
Page 7
5. Findthemin,max, sum, andaverageofthemarksinastudentmarkstable.
Ans.:
selectmax(marks),min(marks),sum(marks),avg(marks)froms
tudent;
6. Find the total number of customers from each country in the table (customer
ID,customerName,country)usinggroup by.
Ans.:
select country, count(customer_id) from customer group
bycountry;
7. WriteaSQLquerytoorderthe(studentID,marks)tableindescendingorderofthemar
ks.
Ans.:
select*fromstudentorderbymarksdesc;
8. WriteaSQLquerytodisplaythemarkswithoutdecimalplaces,displaytheremin
der after divingmarksby3anddisplaythesquare ofmarks.
Ans.:
select round(marks,0),mod(marks,3),pow(marks,2)
fromstudent;
IPPRACTICALRECORDFILE | | Page7
Page 8
of name, display last 3 letters of name, display the position the letter A inname
Ans.:
select ucase(name), lcase(name),
left(name,3),right(name,3),instr(name,'a')fromstudent;
11. Displaytoday'sdatein"Date/Month/Year"formatA
ns.:
select concat(date(now()),
concat("/",concat(month(now()),concat("/",year(now())))));
IPPRACTICALRECORDFILE | | Page8
Page 9
Ans.:
select dayname(now()), monthname(now()),
day(now()),dayname(now()),dayofmonth(now()),dayofyea
r(now());
IPPRACTICALRECORDFILE | | Page9
Page 10
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Page 18
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35