First it depends if you are referring to V2 or V3 as they use different database tables.
If you just simply want the very last 8 entered a query such as:
SELECT TOP 8 [Id]
,[Name]
,[DepartmentId]
,[LastUpdateTime]
,[TicketNumber]
,[PrintJobData]
,[Date]
,[LastOrderDate]
,[LastPaymentDate]
,[LocationName]
,[CustomerId]
,[CustomerName]
,[CustomerGroupCode]
,[IsPaid]
,[RemainingAmount]
,[TotalAmount]
,[Note]
,[Locked]
,[Tag]
FROM [SambaData2].[dbo].[Tickets]
ORDER BY [LastUpdateTime] DESC
This is the fastest way to recall the information that you require, from here you will need to reference the [Id] in the dbo.TicketItems table to recall the relevant items in the ticket and then display.
You do not need to include all the columns I mentioned it just depends what information you want to recall from dbo.Tickets, place it in an array, then query the dbo.TicketItems for the product items on each ticket.
V3 has a different setup so you can use the same principal but reference the correct tables and data.