Using a calculation to evaluate JOIN condition.

Custom functions used in Google Sheets for ease of use and improved functionality.

SQL JOIN

SELECT 
    books.id, books.title, authors.first_name, authors.last_name 
    FROM books 
    INNER JOIN authors 
    ON books.author_id = authors.id 
    ORDER BY books.id
        select invoice, name 
        from booksales 
        inner join customers on substr(booksales.invoice, 2, 5) = customers.id