LAB6 (Views)
LAB6 (Views)
Consider the same database for the organization with the following tables:
• Books (book_id, title, author_id, publication_year, available_copies)
• Authors (author_id, author_name)
• Members (member_id, member_name, address, phone_number)
• BorrowedBooks (transaction_id, book_id, member_id, borrow_date, return_date)
Tasks
i. Create a Simple View
• Create a view named BorrowedBooksDetails that shows member names along with the book
titles they borrowed.
• Include information about borrow and return dates.
• Write a SELECT statement to verify the view's contents.
iii. Update Views
• Demonstrate how to update the definition of the BookDetails view to include additional
information (e.g., publication year).
• Show the impact of the update on queries.
iv. Security Using Views
• Discuss how views can be used to restrict access to certain columns and rows.
• Create a view named MemberDetails that only shows member names and addresses.
• Explain how this view can be used to provide limited access to member information.
Solution: