Skip to main content

1.3 - Verify the Database

Last updated 13/06/2023

Say we want to check the date borrowed in the BorrowHistory table in the database as we cannot see the BorrowHistory records in the Book Club application. We can easily check the records by using Five's SQL Editor.

1. Select Visual in the menu.

2. Select Queries in the sub-menu.


Queries Menu Item
Figure 1 - Queries menu item


Check the Record in the Database

1. Click the Add Item button.

2. Click in the Query field to open Five's Query Builder.


Open the Query Builder
Figure 2 - Open the Query Builder


3. Click the SQL tab.


Sql Tab
Figure 3 - SQL tab


4. Click the Copy button on the syntax block below


MySQL
Testing Do Before Update Event
SELECT
Book.Title,
Book.BookKey,
Book.BorrowMemberKey,
BorrowHistory.Date,
BorrowHistory.DateReturned,
iUser1.FullName AS Owner,
iUser2.FullName AS Borrower
FROM
Book
INNER JOIN BorrowHistory On Book.BookKey = BorrowHistory.BookKey
INNER JOIN iUser AS iUser1 ON Book.MemberKey = iUser1.iUserKey
INNER JOIN iUser AS iUser2 ON Book.BorrowMemberKey = iUser2.iUserKey
WHERE Book.Title LIKE '%Mastering%'



5. Paste in the SQL Editor.

6. Click the Run button.


Run Button
Figure 4 - Run button


info
You can see in the results that the borrowed date has been inserted in the BorrowHistory table here for the Mastering TypeScript 3 record.


Returned Records
Figure 5 - Returned records


7. Click the Cancel button in the SQL Editor.


Cancel Button
Figure 6 - Cancel button


8. Click the Cancel button in the form app bar.


Cancel Button
Figure 7 - Cancel button