update_data.py · مثال الكتاب: price و year للفئة Art
1import sqlite3
2connection = sqlite3.connect('fut_club.db')
3cursor = connection.cursor()
4# Update data
5cursor.execute('''UPDATE players
6 SET club = ?, price = ?
7 WHERE name = ?''',
8 ('Red FC', 9.5, 'Yousef'))
9print('Number of rows updated:', connection.total_changes)
10connection.commit()
11connection.close()