Jezzy Grey

Generation

text to sql syntaxFri, 17 Feb 2023

The catalog_book table has the following columns: id - id summary - description isbn - isbn author_id - Author ID title - title language_id - The language of the book The catalog_author table has the following columns: id - id first_name - First name last_name - last name date_of_birth - Date of birth date_of_death - Date of death The catalog_bookinstance table has the following columns: id - id imprint - imprint due_back - Due date back status - status book_id - book id Print the titles of the books, their authors, a short description for the books, the language of the book. Consider only living authors who have books in the "o" status.

SELECT cat.title, cat_aut.first_name, cat.summary, cat_lan.name as language FROM catalog_book as cat LEFT JOIN catalog_author as cat_aut ON cat_aut.id=cat.author_id LEFT JOIN catalog_language as cat_lan ON cat_lan.id=cat.language_id LEFT JOIN catalog_bookinstance as cat_ins ON cat_ins.book_id=cat.id WHERE cat_aut.date_of_death IS NULL AND cat_ins.status='o';

Questions about programming?Chat with your personal AI assistant