#!/usr/bin/python3
import MySQLdb
import sys

db = MySQLdb.connect(host="localhost",
                     port=3306,
                     user=sys.argv[1],
                     passwd=sys.argv[2],
                     db=sys.argv[3])

cursor = db.cursor()
cursor.execute(""" SELECT cities.id, cities.name, states.name FROM cities
LEFT JOIN states ON cities.state_id = states.id ORDER BY cities.id ASC """)

for data in cursor.fetchall():
    print(data)

cursor.close()
db.close()

693c7e15f2bfb5f4c929a551ab05957fc5c16f66
<mask token>

<mask token>
cursor.execute(
    """ SELECT cities.id, cities.name, states.name FROM cities
LEFT JOIN states ON cities.state_id = states.id ORDER BY cities.id ASC """
    )
for data in cursor.fetchall():
    print(data)
cursor.close()
db.close()

<mask token>
db = MySQLdb.connect(host='localhost', port=3306, user=sys.argv[1], passwd=
    sys.argv[2], db=sys.argv[3])
cursor = db.cursor()
cursor.execute(
    """ SELECT cities.id, cities.name, states.name FROM cities
LEFT JOIN states ON cities.state_id = states.id ORDER BY cities.id ASC """
    )
for data in cursor.fetchall():
    print(data)
cursor.close()
db.close()

import MySQLdb
import sys
db = MySQLdb.connect(host='localhost', port=3306, user=sys.argv[1], passwd=
    sys.argv[2], db=sys.argv[3])
cursor = db.cursor()
cursor.execute(
    """ SELECT cities.id, cities.name, states.name FROM cities
LEFT JOIN states ON cities.state_id = states.id ORDER BY cities.id ASC """
    )
for data in cursor.fetchall():
    print(data)
cursor.close()
db.close()

#!/usr/bin/python3
import MySQLdb
import sys

db = MySQLdb.connect(host="localhost",
                     port=3306,
                     user=sys.argv[1],
                     passwd=sys.argv[2],
                     db=sys.argv[3])

cursor = db.cursor()
cursor.execute(""" SELECT cities.id, cities.name, states.name FROM cities
LEFT JOIN states ON cities.state_id = states.id ORDER BY cities.id ASC """)

for data in cursor.fetchall():
    print(data)

cursor.close()
db.close()
