Code: Alles auswählen
cursor.execute('''SELECT einwohner_mio * 1000000 FROM laender_info ''').fetchall()
Out[15]:
[(652000.0,),
(2000000.0,),
(3000000.0,),
(4000000.0,),
(2000000.0,),
(998000.0,),
(12000000.0,),
(3000000.0,),
(2000000.0,),
(4000000.0,),
(6000000.0,),
(2000000.0,),
(2000000.0,),
(18000000.0,),
(11000000.0,),
(8000000.0,)]
cursor.execute('''SELECT sum (einwohner_mio * 1000000) FROM laender_info ''').fetchall()
Out[16]: [(80650000.0,)]
cursor.execute('''SELECT insgesamt FROM migrationshintergrund_2013 ''').fetchall()
Out[17]:
[(10599,),
(12556,),
(3396,),
(2448,),
(655,),
(1744,),
(6029,),
(1598,),
(7784,),
(17553,),
(3991,),
(992,),
(4044,),
(2250,),
(2810,),
(2164,)]
cursor.execute('''SELECT sum(insgesamt) FROM migrationshintergrund_2013 ''').fetchall()
Out[18]: [(80613,)]