Objective
Manage a library's loans by storing the books in an in-memory SQLite database. Use queries with parameters (?), do not concatenate text into the SQL.
Instructions
- Create a table
bookswithtitle(primary key),authorandlent_to(null if available). - The first line has the number
nof commands:add title author,lend title user,return titleorlist. Titles, authors and users are a single word. - Show
OKor one of these errors:Error: duplicate book,Error: book not found,Error: already lent,Error: was not lent. The listing is sorted by title, with the formattitle (author): availableortitle (author): lent to user.
5
add Dune Herbert
add Emma Austen
lend Dune ana
return Emma
list
OK
OK
OK
Error: was not lent
Dune (Herbert): lent to ana
Emma (Austen): available
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise