Question
Create a table for invoices that have been paid. Name this table invoicespaid. The table should have columns for the VendorName, InvoiceNumber, InvoiceDate, InvoiceTotal, AccountNo,
Create a table for invoices that have been paid. Name this table invoicespaid. The table should have columns for the VendorName, InvoiceNumber, InvoiceDate, InvoiceTotal, AccountNo, InvoiceLineItemAmount, and InvoiceLineItemDescription. You can use this create table statement. CREATE TABLE [dbo].[invoicespaid]( [VendorName] [varchar](200) NOT NULL, [InvoiceNumber] [varchar](50) NOT NULL, [InvoiceDate] [smalldatetime] NOT NULL, [InvoiceTotal] [money] NOT NULL, [AccountNo] [int] NOT NULL, [InvoiceLineItemAmount] [money] NOT NULL, [InvoiceLineItemDescription] [varchar](300) NOT NULL)
VendorName is a column that you must get from the vendors table. Insert into the invoicespaid table all of the records from the invoices and invoicelineitems tables that have been paid making sure to include any tables required to populate all columns in invoicespaid. This should be an insert into statement that is using a select statement to get the records from the required tables
Mark the records that have been moved to this table.
Add a column named moved to the invoices table using an alter table statement.
Write an update statement to update the records that were moved to true. All other records should be false.
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