-


cursor.execute(“SELECT * FROM employees”)



Download 9,79 Mb.
Pdf ko'rish
bet60/64
Sana16.01.2022
Hajmi9,79 Mb.
#372467
1   ...   56   57   58   59   60   61   62   63   64
Bog'liq
[Nichola Lacey] Python by Example Learning to Pro(1)

cursor.execute(“SELECT * FROM employees”) 
for x in cursor.fetchall(): 
 print(x) 
Displays all the data from the employees table and displays each record on a separate 
line. 
cursor.execute(“SELECT * FROM employees ORDER BY name”) 
for x in cursor.fetchall(): 
 print(x) 
Selects all the data from the employees table, sorted by name, and 
displays each record on a separate line. 
cursor.execute(“SELECT * FROM employees WHERE salary>20000”) 
Selects all the data from the employees table where the salary is over 20,000. 
cursor.execute(“SELECT * FROM employees WHERE dept=‘Sales’”) 
Selects all the data from the employees table where the department is “Sales”. 
cursor.execute(“SELECT id,name,salary FROM employees”) 
Selects the ID, name and salary fields from the employees table. 
cursor.execute(“““SELECT employees.id,employees.name,dept.manager 

Download 9,79 Mb.

Do'stlaringiz bilan baham:
1   ...   56   57   58   59   60   61   62   63   64




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish