@@ -64,7 +64,7 @@ def get_authors(connection) -> List:
6464 :return: list of authors data
6565 """
6666 cursor = connection .cursor ()
67- sql = f """
67+ sql = """
6868 SELECT
6969 a.fname || ' ' || a.lname as author,
7070 b.title,
@@ -105,14 +105,14 @@ def add_new_book(connection, author_name, book_title, publisher_name):
105105 cursor = connection .cursor ()
106106
107107 # Does the book exist?
108- sql = f """SELECT 1 FROM book WHERE title = ?"""
108+ sql = """SELECT 1 FROM book WHERE title = ?"""
109109 book = cursor .execute (sql , (book_title ,)).fetchone ()
110110
111111 if book is not None :
112112 raise Exception ("Book exists" , book_title )
113113
114114 # Get author
115- sql = f """
115+ sql = """
116116 SELECT
117117 author_id
118118 FROM author
@@ -127,7 +127,7 @@ def add_new_book(connection, author_name, book_title, publisher_name):
127127 raise Exception ("No author found" , author_name )
128128
129129 # Get publisher
130- sql = f """
130+ sql = """
131131 SELECT
132132 publisher_id
133133 FROM publisher
@@ -140,15 +140,15 @@ def add_new_book(connection, author_name, book_title, publisher_name):
140140 raise Exception ("No publisher found" , publisher_name )
141141
142142 # Add the book
143- sql = f """
143+ sql = """
144144 INSERT INTO book
145145 (title, author_id)
146146 VALUES(?, ?)
147147 """
148148 book_id = cursor .execute (sql , (book_title , author ["author_id" ])).lastrowid
149149
150150 # Update the relationships
151- sql = f """
151+ sql = """
152152 INSERT INTO book_publisher
153153 (book_id, publisher_id)
154154 VALUES(?, ?)
0 commit comments