I need some help with SQL in extracting data from one table into another. In the table transactions, I have the Seller, SellerID, Listing, ListingID, SoldPrice, Date. I would like to extract each instance of Seller and Listing into individual records in another table called individualtransactions.
I figured the best way to showcase what I would like to accomplish is with an example before and after. Is this possible with one SQL statement or would I need to run multiple statements? If it is, can an expert guide me on how to accomplish this?
Table name: transactions
Seller, SellerID, Listing, ListingID, SoldPrice, Date
John, 1, Bill, 2, 1900, 12/01/2017
Jane, 3, Becky, 4, 2400, 12/02/2017
Joe, 5, Jane, 1, 2100, 12/03/2017
Table name: individualtransactions
Name, Price, Role, Date
John, 1900, Seller, 12/01/2017
Bill, 1900, Listing, 12/01/2017
Jane, 2400, Seller, 12/02/2017
Becky, 2400, Listing, 12/02/2017
Joe, 2100, Seller, 12/03/2017
Jane, 2100, Listing, 12/03/2017