#๐ sqlite3
16 messages ยท Page 1 of 1 (latest)
@tribal remnant
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
BELOW is the question Q#3: Create a Python program that manages book loans in a library. The system should allow adding books, registering members, and managing loans.
Specifications:
Database Setup: Create a SQLite database called Library.db with the following tables:
Books table with columns: book_id (primary key), title, and author.
Members table with columns: member_id (primary key), name, and email.
Loans table with columns: loan_id (primary key), book_id (foreign key linked to Books), member_id (foreign key linked to Members), and due_date.
Adding Books and Members:
Include functions add_book(title, author) and add_member(name, email) to insert data into the Books and Members tables, respectively.
Borrowing Books:
Implement a function borrow_book(book_id, member_id, due_date) that records a new loan in the Loans table. Ensure that a book can only be borrowed if it is not currently loaned out.
Returning Books:
Add a function return_book(loan_id) to delete an entry from the Loans table, signifying that the book has been returned.
Querying the Database:
Provide a function list_available_books() that displays all books currently not on loan.
Include a function list_active_loans() that shows all current loans with the book titles, member details, and due dates.
Write the complete implementation of the library management system with functions to manipulate the database as specified. Ensure to test each function for both expected behavior and edge cases.
this is the code i have
idk if its uploading correclty
it's not letting me attach this lol
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
you can't attach text files here. use the pastebin instead, @tribal remnant
follow the instructions in that embed to upload the text to the pastebin, instead, and then share a link to it here
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
basically im not sure if im doing the quesetion properly
soo.. what is the question?
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.