Advertisements
Advertisements
प्रश्न
Consider the following table Supplier and item. Write a python script for the following Question?
| SUPPLIER | ||||
| Suppno | Name | City | Icode | SuppQty |
| S001 | Prasad | Delhi | 1008 | 100 |
| S002 | Anu | Bangalore | 1010 | 200 |
| S003 | Shahid | Bangalore | 1008 | 175 |
| S004 | Akila | Hydrabad | 1005 | 195 |
| S005 | Girish | Hydrabad | 1003 | 25 |
| S006 | Shylaja | Chennai | 1008 | 180 |
| S007 | Lavanya | Mumbai | 1005 | 325 |
Increment the SuppQty of Akila by 40
Advertisements
उत्तर
Increment the SuppQty of Akila by 40:
import sqlite3
connection = sqlite3.
connection/’ABC.db”)
cursor = connection, cursor ()
sqlcmd=”””UPDATE SUPPLIER
SET Suppqty=Suppqty+40 WHERE
Name=’Akila”””
cursor, execute(sqlcmd)
result = cursor.fetchall()
print
(“Records after SuppQty increment:”)
for r in result:
print(r)
conn.commit ()
conn, close ()
Output:
Records after SuppQty increment:
(‘S001′ /PrasadVDelhi’,1008,100)
(‘S002′ ,’Anu’ /Bangalore’,1010,200)
(‘S003′ /Shahid’/Bangalore’, 1008,175)
(‘S004’/Akila’/Hydrabad’,1005,235)
(‘S005′ /Girish’/Hydrabad’, 003,25)
(‘S006′ /Shylaja’/Chennai’,1008,180)
(‘S007′ ,’Lavanya’,’Mumbai’,1005,325)
