<jupyter_start><jupyter_text>Предыдущие функции работают, проверили. Попробуем дальше.<jupyter_code>def give_book(cursor, k1, k2, date):
  cursor.execute("SELECT Count(*) FROM Record")
  id = cursor.fetchone()[0]
  new_record = [
    (id + 1, k1, k2, date, None)   
  ]

  connection.executemany(
    "INSERT INTO Record VALUES (?, ?, ?, ?, ?)",
    new_record
  )
def check_records(cursor):
  cursor.execute("SELECT * FROM Record")
  for row in cursor.execute("SELECT * FROM Record"):
    print(*row)
def receive_book(cursor, k1, k2, date1, date2):
  cursor.execute("SELECT Count(*) FROM Record")
  id = cursor.fetchone()[0]
  new_record = [
    (id + 1, k1, k2, date1, date2)   
  ]

  connection.executemany(
    "INSERT INTO Record VALUES (?, ?, ?, ?, ?)",
    new_record
  )
give_book(cursor, 1, 3, '2020-09-28')
check_records(cursor)
receive_book(cursor, 2, 3, '2020-06-12', '2020-07-12')
check_records(cursor)<jupyter_output>1 3 4 1842-02-14 1842-07-01
2 4 4 1996-10-26 None
3 1 2 2006-06-13 2006-06-14
4 1 1 2006-06-14 2006-06-15
5 1 3 2006-06-15 2006-07-20
6 2 5 1985-10-11 1987-12-25
7 5 3 2001-03-15 None
8 5 3 2002-09-19 2002-09-25
9 1 3 2020-09-28 None
10 1 3 2020-09-28 None
11 1 3 2020-09-28 None
12 1 3 2020-09-28 None
13 1 3 2020-09-28 None
14 1 3 2020-09-28 None
15 2 3 2020-06-12 2020-07-12
{'fraction_non_alphanumeric': 0.1497326203208556, 'fraction_numerical': 0.20702826585179526, 'mean_word_length': 3.3812709030100336, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '272561', 'license': 'MIT', 'n_tokens_mistral': 732, 'n_tokens_neox': 544, 'n_words': 151, 'path': 'labs/lab20/sql.ipynb', 'repo_name': 'ludmilask/informatics2020', 'size': '1309'}