Работа с базами данных (БД)

# Connect to the database
# ...
cursor = conn.cursor()

# SQL query execution
cursor.execute("""
  SELECT
    Language, Percentage
  FROM countrylanguage
  WHERE CountryCode = 'RUS'
  ORDER BY Percentage DESC""")

# Get first row
firstRow = cursor.fetchone()
print(firstRow)

# Get all rows
rows = cursor.fetchall()
for row in rows:
    print(row)

# Close the connection
conn.close()