0% found this document useful (0 votes)
23 views

CS Assignment (Connectivity)

Project
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)
23 views

CS Assignment (Connectivity)

Project
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/ 8

Subject / Important Note

Page No. 54
Date
Exot. No.

OUTPUTS:
PyTHON LNTERACE WITH SQL
adei
==== RESTART: C:/0sers/Debadrita/cl.py
Connected successfully!! # nsasuing madule
cen = de danneet (hast= acalhot', baAsuas=dela',
Ae ='Ueot)#utauhing awnisian

lythan TbLE Quttut pint(" Aanetad uiejully !!"


peintl"annetian at sahihesl )

R.N. 256412
GOLDEN
EAGLE
Lab,

Remarks: Date Teacher's Signature:


Subject / Important Note
Page No. 60
Date
Expt. No.

2)at e lataleae und


OUTPUTS : which eentins th yalsuingtalevdatnile
named 'STUDE TAI LS'
i
RESTART: C:\Users\ Debadrita\c2 .py
(6) 6udent Noune () total Mash.
Connected successfully!!

Database Created

Table Created
dnpasutng madule.
(('ID', int', "N0', 'ERI', None, 'auto_Lncrement'), ("NAE', 'char (50), "TES,
"",None, "), ((CLASS', archar (5)', "ES', ', Mone, ), "STREAM", varcha Man = aniet (hast - oealhest', ouLaeo= dube',
(10)', 'ES',', None, "), (OT MARKS', 'int', 'YES' ", None, '))

Rythen IDLE eutt yint ("kametid wusoneujully!!")


ysql> show databases

Database UOL, AXeute("CREATE DATABASE 6TUDENT#uatins


infornation_schena

perforance schea iAuint("ln dataleae uatd')


saktla
student
Sys
UAeAeeute ("USe STUDENT
WOr Ld

rors in set O.00 sec)


wUeY. eute (CREATE TABLE STäDeTAILS (ID TNT(100)
ysql> use student; NOT NVLL AUT0_INCREMENT PRIMARY KeY, NAME
Database changed
DqL shom tables;
Tables in_student
VARCHAR (50), CLA3S VARCHAR(), STREAM VARCHAR (10),
stu_detaíls TOT- MARKS TNT(5) ")# eating tal
1 ro in set (0.00 sec)

nysql> desc stu_details;


puint("n ale euNed's
|Field Type | Null Key Default Extra

NANE
CLASS
STREAM
int
char(50)
varchar(5)
YES
YEC
varchar(10) | YES
| PRI NULL

NUL
NULI
auto_increnent |
puint lueuwusM.E1tehall0)
TOT_HARHS int YES NULL

O in et (8.B9 sec)

30L autut
R.N. 256412
GOLDEN
EAGLF
Lab.

Remarks Date Teacher's Signature


Subject/ mportant Note
Page No. 61
Date
Expt No

) dnast eaoo in tu weatd tal.


OuTPUTSi mpauting madue
RESTART: C:/Users/Debadrita/c3.py
Connected successfully!! an = e.lainict (est =leealhaat', hauuad dala
202, 1 Debadrita', '12B', 'Science', 95) , (132,
'Bhumija', '11B', 'Science!, B6 =Aet', datliee=wtudent)
'12A', 'CoTEIce', 97), (209, 'Maithili', '12C, 'Cormeroce!
), (201, Vaishali', 'Vaidehi', '11A', 'Arts', 90)1
92), (312,
, 85), (307, 'Tanki', '11C', 'Arts',
pint ("tennctid seezajutly !! ")
hytha TDLE Qutut
INSERI TNTO STU-DTAILS (ID, NAM£, CLASS,
STREAM, TOTMARKS) VALUES (%s, %s, l.s, hs, %<"
el=[(201, "Vaishali" "12A" "ammce" ),
(402, "Aladuta', "126", "6cinee", 95),
mysql> select * from stu_details; (807,"Janki", "140" "Aeta", 92),
I ID NAME | CLASS | STREAM |TOT_MARKS (209, "Meitili", "120" "amaue", 85),
102 | Debadrita | 12B Science 95
(312, "Vudehi","11A", "dut,40
132
201
Bhumija
Vaishali
11B
12A
Science
Commerce
86
97
(152, "Bhumija', "11B" "boinee", 86)]#alus
209 | Maithili | 12C Commerce 85
307
312
Janki
Vaidehi
11C
11A
Arts
Arts
92
90
sLARH. LCuiemanylauwny, ual)# jaining quuy and waluue
Cen. cemitl)
6 rows in set (0.00 sec) uint lwUARH, JAaUaunt,"ew) #esunting no. sf iKauLs
cULAOU.JACCOute l"se LECT * PROM 3TULDETIL^ ")

R.N. 256412
EN
pint (uian,utchalló)
EAGLE
Lab.

Remarks: Date Teacher's Signature:.


Subject/ Important Note:
Page No 62
Date
Expt No

DUTPUTS:
RESTART: C:\Users\Debadrita\c4.py
=
Connected successful ly!!
(132, Bhumija', 'l1B', 'Science', 86)
(102, 'Debadrita', '123', 'Science', 95) en = e.lennect (hast=leealhat', aienl ldlea,
(307, 'Janki', 'l1C', 'Arts', 92)
(209, 'Maithili', '12C', 'Commerce', 85) e=eat, dataleace student')
(312, Vaidehi', '1LA', 'Axts', 90)
(201, Vaishal1', '12A', 'Commerce', 97)
yoint ("hanutiol wLceufullyl!)
kythen IDLE utiut
quey = SeLL CT * PROM STULD£TAILS ORDER BY NAME"
mysql> select * from stu_details order by name;
ID NAME | CLASS | STREAM TOT_MARKS

132 Bhumija 11B Science 86


102 Debadrita | 12B Science 95
307 Janki 11C Arts 92
209 Maithili 12C Commerce 85
| 312 Vaidehi 11A Arts 90
| 201 Vaishali 12A Commerce 97

6 rows in set (0.00 sec)

RAGLE
R.N. 256412
GOLDEN
EAGLE
Lab.

Remarks Date Teacher's Signature


Subject / Important Note :
Page No 63
Date
Expt. No.

5) bdal the eeAude as thu, wuatid talle.


OUTPUTS:
#njanting madule
RESTART: C:/Users/Debadrita/c5 (i) . p y = * = * * =
= =
Connected successfully!! 'Bhumija. wen =e.lennet(et=Uecalht', aned=dlea'
95, '9564360701'), (132,
L(L02, 'Debadrita', 12B', 'Science', Vaishali', '12A', 'Comerce', 97, sseAs ea
'5cience', 86, 9564369702'), (201,
'Tanki', 1
u = eat', atalee= wtudnt')
793'), (209, Maithil1', '12C', 'Commerce', 85, '9564360704'), (307, '956436070e,
Vaideni', '11A', 'Arts', 90,
1C, 'Arts', 92, '9564360705'), (312,
)) puint l"lannotd ueAssullyl!
IDLE euthut
UAEH. LOeeut C"ALTER TABLE STUDETAI LS ABA PHNO
VARCHAR 40) ")PHNO
phone nme
CUAEM AILeute " UPOATE STU_D£TAILS KeT PHNO '455U 36DIO!
WHERA IN=109")
eUeyNeeue (UP DATE STU-ATATLS SET PHNO='466436oto2
mysql> select * from stu_details; WHERE TO=182 ")
ID | NAME | CLASs STREAM ITOT_MARKS | PHNO ot.AXORute UPDAT STU_DETAILS SET PHNO= l4564360 7o
102 Debadrita 12 Science 95
86
9564360701
95644360702
WHERE Id= 204 ")
132 Bhumija 11B Science
201
209
Vaishali
Maithili 120
Commerce
Commerce
9564360703
85 | 9564360704
ucAOM NLue ("UPDATE STUL D£TAILS SAT PHNO=(956M 360TOU?
307 Janki 110 Arts 92 95644360705 WHERE T= 204 ")
312 | Vaidehi 11A Arts 90 9564360706
cUH XLCut ("UPDATE STU DETAILS SET PHNO= 9564360105
6 rows in set (e.00 sec)
WHLRE I)= 30 ")
woNLeuta "UPDATE $TU_DETAILS SET PHNO=4564360106
WHERE TA= 842")

kWON.eKute l"SELECT * PROM STUeTAILS)


R.N. 256412
GOLDEN
EAGLE
Lab.
int (wweeh.jatchall0)
Ln.cemitt)
Remarks Date Teacher's Signature
Subject/ Important Note
Page No 64
Date
Expt No

QUTPUT$:
= RESTARI: C:/Users/Debadrita/ C5 (ii) -py =
Connected successfully!!
t(102, 'Debadrita', 123', 'Science', 95, '9564360701' ), (132, 3humija', '1131
nsuting madule
'95642Er
'ARIS', s6, '9564360702'), (201, 'aishali' , '122' r 'CommErce', 97, 1
). (20g, Maithili,'12C', 'Comerce', 85, '9564360704) , (307, 'Janes s
'956438h
an = elanneetlhest= Uealhat', pawiad - dilsa'
SCIENCE', 92, '9564360705') , (312, Vaidehi', '1lA', 'Arts', 90,
l =eet', dtalae =wtucent)
int ("lennatd ausesauly !!")
Aylhan ToLE aUtput Ue =

AUeY. 0eee(UPDATE 3TU_0TAILS SET SIREAM=


SCIENee WHERE IO=307 ")
We eceeute(VPDATA STUDATAILS SeT SIREAM =
mysql> select * from stu_details;
ARTS' WHERA IN=132 ")
ID NAME CLASS | STREAM | TOT_MARKS | PHNO
102
132
Debadrita
Bhumija
12B
11B
Science
ARTS
95 | 9564360701
86 9564360702 UHAA,lOeeue "SELLCT * PROM STU0JAILS )
201 Vaishali
209 | Maithili
12A
12C
Commerce
Commerce
97 956436O703
85 | 9564360704 uint lewaM.jutehall 0)
307 | Janki
312 | Vaidehi
110
11A
SCIENCE
Arts
92 | 9564360705
90 9564360706
en.eemmit
6 rows in set (0.00 sec)

R.N. 256412
GOLDEN
EAGLE
Lab.

Remarks Date Teacher 's Signature


Subject / Important Noto: Page tNo 65
Date
Expt. No

6)lelete the ouatid dalle


OUTPO TS - Cadei
# dpasuting medule
RESTART: C:\Users\ Debadrita\cé(1) -py
Connected success fully!!
1 record(s) deleted
((202, Debadrita', 12B', 'Science', 95), (201, Vaishals', '12A', Commerce',
en = eCennect hast=lecalhat assel = deleo'
97), (2o9, "Maithil1', 12C", "commerce' , 85), (307, Janki', 'l1c', 'Arts', 92) eH = aot', catalsae utudent)
(312, Vaidehi'. 11A'. 'Arts', 90))

int("lannicted ueeeuupuliy!! )
lythan IDLE autput
#dleting ee eeed in the tallle
cUAaeececute ("" DELE TE PROM STU DETAILS WHERE
ID =182 ANN NAME='BHUMIJA' ")
een.cemmitl)
mysql> select* from stu details; puint esueH, JOulesunt," eed(s) deleted")
|NAME I CLASs STREAM | TOT_MARKS | PHNO

102 Debadrita 12B Science 95 | 9564360701 cUAOL. CReute(" &ELECT * fROM ETU_ DE TAI S)
201 Vaishali
209 | Maithili
307 | Janki
12A
12C
11C
Commerce
Commerce
SCIENCE
97 | 9564360703
85 | 95643607O4
92 | 9564360705
fint lewuaM jetehall 0)
312 | Vaidehi 11A Arts 90 | 9564360706
5 rows in set (0.00 sec)

R.N. 256412
GOLDEN
EAGLE
Lab.

Remarks Date Teacher's Signature:


Subject/ mportant Nots Page No. 66
Date
Expt No

OUTPUTS :
RESTART : C:/Users/ Debadrita/c6 (1) (1) -py
Conne cted successfully ! !
dnpauting madule
Table successfully deleted
can =e.lannect (hast-laealhast asuLOsl dlia
see= Leet, dataleaseatudent')
can.il eenneoted ():
lythen IDLE Autut uint("lannitd ueceluly !! )

#laleting the scanlte talule


cUsa.CLCuto ("DROP TABLE STUDETAILS D
pint ("talli wuceetully delutad")
mysql> use student;
Database changed
mysql> show tables;
Empty set (0.00 sec)

B.N. 256412

GOLDEN
Lab.

RemarkS Date Teacher's Signature

You might also like