You can use the UNION operator to merge the data from the two tables and add a constant value indicating the year of the new book. Then, use the WHERE clause to filter out books with a release year after 1900, and use the ORDER BY clause to sort the books alphabetically by the name column. The following is the corresponding query:
SELECT name, year
FROM Books
WHERE year > 1900
UNION
SELECT name, 2022 as year
FROM New
ORDER BY name.
This query first selects books from the Books table with a year after 1900, and then uses UNION to merge them into the new books table New with the year set to 2022. Finally, use ORDER BY to sort the result set alphabetically by the name column.
Note that UNION removes duplicate rows by default; if you want to keep duplicate rows, you can use UNION ALL. In this scenario, I used UNION because you probably don't want the same book to appear twice.
I hope this helps you! If you have any other questions, please feel free to ask.