Question
My question is #1 below. #1. All new books in the Excel file should be added to the Book table. If there are books that
My question is #1 below.
#1. All new books in the Excel file should be added to the Book table. If there are books that were already in the table, only the quantity should be updated. All purchased books are new.
I am thinking I need to write a Merge Query to answer this problem but the columns are named different in each table(Type is the same as Category, Stock is the same as St, and Price(EUR) needs to be converted to Price ($), so I'm not sure how I get them to merge correctly. Should I use a JOIN first? I started the below code but I'm stuck... am I even on the right track?
SELECT Book.Title, Book.ISBN
MERGE Book AS T USING Inventory AS S ON T.Title = S.Title WHEN MATCHED THEN UPDATE SET
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I've imported the Excel files into the Access database as additional tables. Below is the assignment, followed by a screenshot of the tables in the database.
The first one is the same Microsoft Access database you were given in Assignment 5, last week. The second one is an Excel file that that contains information about a new batch of books that was recently purchased by the bookstore that handles the first database. It also contains a client list from the old bookstore that was also acquired by the new bookstore. Your job is to integrate the information provided in the Excel file onto the current database file. To do that you must do the following:
- All new books in the Excel file should be added to the Book table. If there are books that were already in the table, only the quantity should be updated. All purchased books are new.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started