Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import sqlite3
  3.  
  4. con = sqlite3.connect('./sample.db')
  5. cur = con.cursor()
  6. cur.execute("SELECT fruit.name, color.color FROM fruit JOIN color ON fruit.color_id = color.color_id")
  7. for row in cur:
  8. print("fruit.name:" + str(row[0]) + ", color.color:" + str(row[1]))
  9. con.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement