0% found this document useful (0 votes)
12 views9 pages

CS RECORD-WS1tt

Gegeigvufuf6dcuyczt g I u g8g8

Uploaded by

poilash227
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

CS RECORD-WS1tt

Gegeigvufuf6dcuyczt g I u g8g8

Uploaded by

poilash227
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Date

Expt. No. 13 CREATE TABLEs


Page No.

mysql> Create database LABAC1;


|Query ok, 1 foW affected (0.00 sec)
Evert Count rizeHoneyDE..
Gcode GomeNome So00014- O1- a3 |ysql> USe uGA1,
101 | Carom
10aBadminton
10000•o1q -12 -1a |Database change d
s000201q- 02-14
|103 | Toble Tenn is |mysql> reate talble GAMES
9000 20I9 - 01 -o |
|104 | Chess a014 -03 -19|
’ GCode int primary ey,
aSDOD
|i0s LawnTennis 5 GameName yarchar (30),
10000 NULL
|106 NULL ’ évent Count int,
shoohing
10000 NULL ’ fnize Money int
-....4. ’ 0t date
7 rows in set (o.01 sec)
Query oK,0rowS affecked lo.o3 see)
|mysql > in sert into GAMES
values (ioL, 'Carom', as0c0 'ao19- 01-a3'),
’ (102, Badmintom a, 1000, '2019-12-12'),
’ (03, Table Tennis,1, g000ao1992- 11).
-’ (104,Che ssa 9000,aQ19-O1-o1).
’ (i05, Lawn Tennis 4, a50002019- 03-19,
’ (106, nyll, L l0000, nul)
shoating
|Queny OK,2 rows atfeckd, 5 warnings (o.o sec)
|Records: 1 Duplicates: 0 Alarningsi S
mysql> select * from 6AMEs;

Teacher's Signature
Date
Expt. No.
Page No.
GCode
PCode Name
|mysql>TEate toble PLAYER(
I Arjun -’ PCode int
QRovi 105 ’ Namne primany key
varchur (a0)
3 Jignesh | 101 ’ Gcode int
4Nihol 103
5 Sohail 194 Ausy oK, 0 rowS affeckd (0.02 sec)

mysql >insert into LAYER


’ valyes (L,
’ (a, 'Ravi', 'I0),
Ariyn',10)
’ (3,igncsh, 10)
’ (4, Nihal', 103)
’ (5, Sohail'104)
|Query ox, Sows affected (0.o4 sec)
Records: 5 DuplicakeS: 0 amings: 0
mysql > select * from PLAYeR

Teacher's Signature.
Date

Expt. No. AY Page No.

Dmysql sclect PCode as PLAYER CO0E Name os PLAMER NAME'


PLAYER cODE PAVER NAME from PLAYER arder by Gcode desc, Name asc
Ravi

S Sohail
4Nihol
1Arjum
3 |Jignesh

.rizeHoney mysql >selcct disinct Prize Honey Grom GAMES order by Prize Maney
5000
80 00
9000
1D000
99000

Teacher's Signature
Date

Expt. No.
Page No.
¬vert Count )
GCode Gome Nome
Carom |mysql >Select Gcode, Game Name Event (ount om GAMES
102 Badminhon here mon th (0t) in (o1,0a) or Prize Money <15000
103 Table Tennis
104 hess
106 NULL

109 shookng

Gode Nonne mysqt> select Gcode, Name krom PLAYER where Gcode in (i01 105)
Arjun
105 Rovi
101 Jigresh|-+

bame Name nysql> select Gane Name From GHES Wwhere Game Name betuecn 'A' and'e'
Corom
|Badmintbn
Chess
| Lawn Tennis
+

4
IGome Nome misql > select 6ame Name from GAHes where 0A is NULLi
| NULL
|shoohng

Teacher's Signature,
Date
Expt. No,
Page No.

(oUnt (Gome Noume)


| GameNome Dmysql> select Game Nane coUnt (Gane Name) from GAMES qroup
4

| Carom
by Gam¢Name
|Bodminton
| ableTennis
Chess
ILawnTennis
|NULL
shooting

)
IEvert lount UUnt (tvent Coumt) 0 ysql>select EvenF Cant, aunt (eventount) rom GAMES graup by
event ount;

1..

|mysql> select Dt_count () Fronm GAHES qrDup by DE having cantO


NULL

HIGHES T
| H1GHEsT LOWEST TOTAL | AVERAGE I mysl >select max (PizHonay) as K min(PizHaney)as LONEST,
| 350oo S000 |77000 io00.0DD| sum (Prize Honey) as 10TAL, aYO (izemoncy) as ANERAGE Eronm GAMEs

Teacher's Signature
Date

Expt. No. 0)
Page No.

GomeNme Nome
my sql > alkr table PLAYER Gd foreian keu C6cote) eferences sAHES (GCte.
I01 Carom |Arjun
I04 Lhess |Rovi my sql> select PLAYER. GCode
|Jignesh
Game Name, Nane
(arom ’ FroM PLAYE, GAMES
|Nihal ’ whee
l03 Table Ternis
Sohail
GAMES.GCode- PLAYER.6Cade
chess

|PCode Name Pize Morney mysql > select PCode, Name,Pnize Honey
Arjun S000 ’ from PLAYER GAHES
9000
|a Rovi > where Gtgt GAHES. 6 Code = PLAVER. GCode;
Jigne sh so00

Nihal S000

Teacher's Signature
Date
Expt. No.
Page No.
) Oote.of -e vent
Event lount Prize Monty
0Gcode |GomeName
5000
|QO19 -01-23 )Imysq> aer table GAHES change Dt Date ofEvent date,
| Carom
10000
Query ok0 ows affected (0.04 sec)
I02dminton QO19-0 -14 Records:D QuplicatesS:0 Warnings:D
R000
| 103 | Table Tennis qpo
104 Uhess QS000 ao9-o3- 19 mysql >select * from 6AMES;
t0s Laun Tenni's 4
NäLL
1000D
104 NVL
NULL
shogting
) mysql> alter table PLAYER add Email yarchar (30)
IPCode | Nome I6code |Emoil I Auery oK, 0rows caffeckd (o.0L sec)
|NULL
| 105NULL
Records: 0 Ouplicaks:0 hlamins: .
aRoavi
| 3 | Jignesh101 NULL Mysql > glect r from pLAYER
u Nihal 03 NULs
5 | sohail | 04 NULL

3) Same as ) 3) mysql > alkr table 6AMES modify GameNamE vorchar (20)
|Qvery ok, ? rows affeckd (0.03 sec
|Records: 3,DuplicaeS:0 warnings: 0
mysql > select Fom GAMES;

Teacher's Signature
Datc
Expt. No.
Page No.
Field Type NUll! key Defavlt extral
NULL
|Gode int | NO
vorchar (320) YeS | |NULL mysql > YQk table qamescopy like GAHES
| Gome None
NULL QUery oK, QfowS affected (o.02 sec)
levent count int
|nzeMoney int
|NULL|
Dale. of_E vent do+e

ExpFJ exp F)
)
|6ode bome Name Vent count PnzeMony Dak -of -évent |
ao19-01- a3
mysql> delete rom GAMes whene Dale ofEvent is NULL;
| l01 Carom S000
Auery ox, Qrows affeckd (o.ol sec)
|102 | Bagminton | I0000

| 103 Table Ternis


9000 014 -o|- 0 |mysal > Select + from GAMES
|104 | Chess
| 105 Lawn Tennis | QS000 | a019 - 03-19 I

6(odeGame Name levent Count +


Prize Money |ak-of-event mysql update GAHES set GCode = 09 where GCode <|05;
10| | (arom Soo0
Query ok, 1 row affected (o.o1 sec)
I02 adminton 10000 |2014- |2-12 | Rows matehed:l Changed: I Wamings:0
103 Toable Tennis 8000

| 104| hess q000 20 19 - OI- o|


mysql >select * from 6nM Es
10 LawnTennis aso00 lao14 - 03

3) IGcode Event Count | PrzeMoney I Dakof_Event


GameName DACÔ mysql> insert into games copy
101 Carom S000 aoiq- o1- 93
’ select-o from qaMes;
I02 | adminton 10000 a019 - 2-2 Aueny Dx 5 rows affeckd (0.0Lsec
103 able Tennis 8000 2014 -05 - 14 |
Records: S Duplicaks: 0 wcmings: Q
104ness 9000 2019-01- 01 mysql> seicct * om games_copyi
10 Laun Tennis 4 a5000| a014- 03 -4 Teacher's Signature
Date
Expt. No.
Page No.

DATE |GomeName |
mysql> Select Dak ofevent as 'DATE'GameName GAMEs from
l2019 - O1 -23 CarOm where Game Name like B%' or Game NLme
Badminton like'c°l prdu by
| 3019-12-12 Dokkof_Grent asc
mysa select PrizeHoney coUt (Priemoney) From GAMES here
Emphy Set (0 o0 sec) Month (0ak 0E Event) in (oL,12) qroup by Pnze Hon ey having
cOunt (Pize Money) >1

Teacher's Signature

You might also like