Ashish 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

9 rows in set (e.

64 sec)

s use cse
Databese changed
ble student_ashish (
s id int(6),
Tnae varcnar28)
arcnare
uEy rows atrected, 2 warnings (3.33 sec)

mysqi> desc student_ashish;

Field Type NUli Key | Default| Extra

5 id 1int YES NULL


fname varchar (20) YES NULL
ULL
SCtyvarchare)YES
CEp float(2,2) YES NULL
****** ********
roNs 2n set (0.34 sec)

my sql> insert into student_ashish values (1,"Ashish", "Patna",8.00), (2,"Aman", "Gaya",8.8),(3, "Aditya", "Bodh Gaya",7.98),(4, "Rajan", "Hadhubani", 8.2), (5, "Sourav", "uP",8.00
ro
ERRO 0u ot ranee vu tOrcounceDt
Query OK, e rows affected, 1 warning (e.45 sec)
Records: Duplicates: Warnings: 1

ysq1> insert into student_ashish values (1,"Ashish", "Patna",8.00),(2, "Aman", "Gaya",8.8), (3,"aditya", "Bodh Gaya",7.98), (4, "Rajan", "kadhubani",8.2), (5,"sourav", "UP",8.00
Query Ok, 5 rows affected (e.14 sec)
Records: S5 Duplicates: e warnings: 6

mysql> select fron


student ashish;
sid nam
** -------+ ...
8.ee
1AshishPatna

5 Souray i uP
----- - - -
rows A set
(e.Be sec)

y5q1 ater table student.ashish add column percent loat (18, 2) ;


Records: e Duplicates: warnings: 1 Activate Windows
18
Go to Settings to activate Windas
my5q1 update student ashisn 5et percent=cgpa
(e.13 sec)
Query OK, 5 rows
OWS MBtCnEd 5
affected
Lnanged5 Narinirgs.
select Number from
mysqls count (f_name) as student_ashish;
Number
-

row in set (0.e5 sec)

mysql> select round(avg(cgpa) ,2) as Average_cGPA from student_ashish;

Avera _CGPA

row in set (8.05 sec)

Number from student_ashish where


mysqls select count (nane) as cgpas7.5;
Number

51

row in set (8.88


sec
where from
nysql select fros student_ashish cgpan (select max (cgpa) student ashish) ;
5id fname 5_city 1 cgpa percent
2 Aan Gaya 8.88 | 88.08

1 row in set (.88 sec)

min(cgpa) from student_ashish);


mysql select from student ashish where cgpa=(select
4d nane s_city Cgpa percent

AdityaBodh Gaya7.98
* *
79.88
*

set (0.84 sec)


row in
eectasA a v e
Arom studentashish here cgpa(select sax(CEpa) as Max_CapA rom student ashish);
ro n you 5yntax; Check the anua tnat corresponds t o your xysQL server version tor the rght syntax to use near as MAX_CGPA from student_ashish where cgpa-(select max(cgpa) as Max_
PA ros st at ine
mys eiectaACGP trom sTudent ashish where cEpa(select ax(cgpa) as MaxCGPA from student_ashish)
. z ou nave an error n your sqL syntax; check the sanua that corresponds to your Mysq server version for the right syntax to use near a s MAX CGPA from student ashish where cgpa-(select max(cgpa) as Max_

mysal selectsid,fnane,cgpa as Max_cGPA FROM studentashish cgpan (select max(cgpa) as MaxcGPA fron student ashish) ;
ENO 14zeeYouhave an error in your sq syntax check the manual that corresponds to your MysQL server version for the student ashish)
"
right syntax to use near -(select max(cgpa) as Max_CGPA from at 1ine 1
Max_GPA ros student_ashish where cgpa(select max(cgpa)
as Max_cGPA from student_ashish) ;
nysq seiect 51d,tnane, cgpa as

_id fnane Max_cGPA

Aman 8.88
Activate Windows
Go to Settings to activate Window
set (e.88 seC)
OM n
select Number from student_ashish where cgpas7.5;
mysql> count (fname) as

NumberI

row in set (e.e8 sec)

mysql> select from student ashish where cgpa-(select max(cgpa) from studentashish);

0 n a e 5_CtycEpapercent

2 Aman Gaya 8.88 88.ee


*****
row in set (e.88 sec)

mysq select trom student ashish where cEpa=( select min(cgpa ) trom student_ashsh) ;

S4d name 5city cgpa percent

Aditya Bodh Gaya 7.98 79 88


row in set (e.04 sec)

mysql select a s MAX CGPA from student ashish where cgpa=(select max(cgpa) as Max_CGPA From student-ashish);
N aVe an e r o a n . your tax cneck tnenu at coptesponas to your y server vers10n ror the right 5yntax to use near as RA_CaPA r o m s t u d e n t _ a s h i s h where CEPa(select max(CEpa) as Max

GPA TO
MAX CGPA from student ashish where cgpa=(select max(cgpa) as Max_CGPA from student ashish);
have in your sQL syntax; check the manual that
ERROR 1864 (428e0): You
aPA fron st at ne
an error correspands to your MysqL server version far the right
syntax to use near 'as
MAX CGPA From student_ashish where cgpa-(select nax(cgpa) as Max_c
i e d n a e , CRpa as axCGPA RO STudent ashnish cEpa=(select max(cEpa) a s a C G P A from student_ashish )
the right syntax to use near -(select max(cgpa) from
"
at line 1
mysql> select s_id,f_nane,cgpa as Max_cGPA fron student_ashish where cgpa=(select max(cgpa) as Max CGPA from student ashish) ;
for as Max_cGPA student_ashish)

1d nae Max_CGPAA

2 Aman 8.88 |
rOW An set (8.88 sec)

select Min_cGPA fran student_ashish where Cgpan(select min(cgpa) Min_cGPA from student_ashish) ;
mysql s_1d,fnane, cgpa as as

d nane Min_cGPA

------
Aditya
---+
7.98
****
set
(0.e8 sec)
o

mysql>

Activate WindowS
Go to Settings to activate Windows
my sl> select from student _ashish;
****** ****
S1d _name -Cy Ep

an3nrotna

Aditya Bodh Gaya 7.98


Rajan!unubsn
SourayIUP
8.2
*******

5 rows in set (e.ee sec)

my sql> alter table student_ashish add (e.18


columnsec)
percent float(18,2)
1
uery roS dtected, warning
ecords: Dupicotes: nartnangs
mysql> update studentashish set percemt=Cgpa"18,
Query OR, 5 roS affected (e.13 sec)
ROWS matched: 5 Changed: 5 Warnings: e

mysql> select from studentashish;

S10 name city CEpa percent

Aditya Bodh Gaya 7.98 79.88


Rajan nubni8.2 82
5 Sourav UP 8.ee Be.ee
****************

5 rows in set (e.ee sec)

count(f_nane) Number from student_ashish;


mysql select as

amher

row in set (e.e5 sec)

mysql> select round (avg(cgpa), 2) as Average_cGPA from student_ashish;


- - - - -

Average_cGPA

8.2

row in Set (e.e


*t
my sql> select count(fname) as Number from
student ashish where cgpas7.5; Activate Windows
har Go to Setings to activate Windove
-+

You might also like