Answer all questions as instructed that I will provide. Read carefully. I will provide the databases needed to fulfill all requirements. Send back screenshots of each query when executed in a word document and label them to match each question. You will also send back the .slx file that contains all of the statements you use for this assignment.
USE master GO /****** Object: Database AP ******/ IF DB_ID('AP') IS NOT NULL DROP DATABASE AP GO CREATE DATABASE AP GO USE [AP] GO /****** Object: Table [dbo].[ContactUpdates] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ContactUpdates]( [VendorID] [int] IDENTITY(1,1) NOT NULL, [LastName] [varchar](50) NULL, [FirstName] [varchar](50) NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[GLAccounts] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[GLAccounts]( [AccountNo] [int] NOT NULL, [AccountDescription] [varchar](50) NOT NULL, CONSTRAINT [PK_GLAccounts] PRIMARY KEY CLUSTERED ( [AccountNo] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[InvoiceArchive] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[InvoiceArchive]( [InvoiceID] [int] NOT NULL, [VendorID] [int] NOT NULL, [InvoiceNumber] [varchar](50) NOT NULL, [InvoiceDate] [date] NOT NULL, [InvoiceTotal] [money] NOT NULL, [PaymentTotal] [money] NOT NULL, [CreditTotal] [money] NOT NULL, [TermsID] [int] NOT NULL, [InvoiceDueDate] [date] NOT NULL, [PaymentDate] [date] NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[InvoiceLineItems] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[InvoiceLineItems]( [InvoiceID] [int] NOT NULL, [InvoiceSequence] [smallint] NOT NULL, [AccountNo] [int] NOT NULL, [InvoiceLineItemAmount] [money] NOT NULL, [InvoiceLineItemDescription] [varchar](100) NOT NULL, CONSTRAINT [PK_InvoiceLineItems] PRIMARY KEY CLUSTERED ( [InvoiceID] ASC, [InvoiceSequence] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Invoices] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Invoices]( [InvoiceID] [int] IDENTITY(1,1) NOT NULL, [VendorID] [int] NOT NULL, [InvoiceNumber] [varchar](50) NOT NULL, [InvoiceDate] [date] NOT NULL, [InvoiceTotal] [money] NOT NULL, [PaymentTotal] [money] NOT NULL, [CreditTotal] [money] NOT NULL, [TermsID] [int] NOT NULL, [InvoiceDueDate] [date] NOT NULL, [PaymentDate] [date] NULL, CONSTRAINT [PK_Invoices] PRIMARY KEY CLUSTERED ( [InvoiceID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Terms] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Terms]( [TermsID] [int] IDENTITY(1,1) NOT NULL, [TermsDescription] [varchar](50) NOT NULL, [TermsDueDays] [smallint] NOT NULL, CONSTRAINT [PK_Terms] PRIMARY KEY CLUSTERED ( [TermsID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Vendors] Script Date: 2/14/2020 12:45:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Vendors]( [VendorID] [int] IDENTITY(1,1) NOT NULL, [VendorName] [varchar](50) NOT NULL, [VendorAddress1] [varchar](50) NULL, [VendorAddress2] [varchar](50) NULL, [VendorCity] [varchar](50) NOT NULL, [VendorState] [char](2) NOT NULL, [VendorZipCode] [varchar](20) NOT NULL, [VendorPhone] [varchar](50) NULL, [VendorContactLName] [varchar](50) NULL, [VendorContactFName] [varchar](50) NULL, [DefaultTermsID] [int] NOT NULL, [DefaultAccountNo] [int] NOT NULL, CONSTRAINT [PK_Vendors] PRIMARY KEY CLUSTERED ( [VendorID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET IDENTITY_INSERT [dbo].[ContactUpdates] ON INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (5, N'Davison', N'Michelle') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (12, N'Mayteh', N'Kendall') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (17, N'Onandonga', N'Bruce') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (44, N'Antavius', N'Anthony') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (76, N'Bradlee', N'Danny') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (94, N'Suscipe', N'Reynaldo') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (101, N'O''Sullivan', N'Geraldine') INSERT [dbo].[ContactUpdates] ([VendorID], [LastName], [FirstName]) VALUES (123, N'Bucket', N'Charles') SET IDENTITY_INSERT [dbo].[ContactUpdates] OFF INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (100, N'Cash') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (110, N'Accounts Receivable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (120, N'Book Inventory') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (150, N'Furniture') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (160, N'Computer Equipment') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (162, N'Capitalized Lease') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (167, N'Software') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (170, N'Other Equipment') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (181, N'Book Development') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (200, N'Accounts Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (205, N'Royalties Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (221, N'401K Employee Contributions') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (230, N'Sales Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (234, N'Medicare Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (235, N'Income Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (237, N'State Payroll Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (238, N'Employee FICA Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (239, N'Employer FICA Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (241, N'Employer FUTA Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (242, N'Employee SDI Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (243, N'Employer UCI Taxes Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (251, N'IBM Credit Corporation Payable') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (280, N'Capital Stock') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (290, N'Retained Earnings') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (300, N'Retail Sales') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (301, N'College Sales') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (302, N'Trade Sales') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (306, N'Consignment Sales') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (310, N'Compositing Revenue') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (394, N'Book Club Royalties') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (400, N'Book Printing Costs') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (403, N'Book Production Costs') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (500, N'Salaries and Wages') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (505, N'FICA') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (506, N'FUTA') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (507, N'UCI') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (508, N'Medicare') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (510, N'Group Insurance') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (520, N'Building Lease') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (521, N'Utilities') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (522, N'Telephone') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (523, N'Building Maintenance') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (527, N'Computer Equipment Maintenance') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (528, N'IBM Lease') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (532, N'Equipment Rental') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (536, N'Card Deck Advertising') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (540, N'Direct Mail Advertising') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (541, N'Space Advertising') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (546, N'Exhibits and Shows') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (548, N'Web Site Production and Fees') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (550, N'Packaging Materials') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (551, N'Business Forms') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (552, N'Postage') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (553, N'Freight') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (555, N'Collection Agency Fees') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (556, N'Credit Card Handling') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (565, N'Bank Fees') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (568, N'Auto License Fee') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (569, N'Auto Expense') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (570, N'Office Supplies') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (572, N'Books, Dues, and Subscriptions') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (574, N'Business Licenses and Taxes') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (576, N'PC Software') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (580, N'Meals') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (582, N'Travel and Accomodations') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (589, N'Outside Services') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (590, N'Business Insurance') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (591, N'Accounting') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (610, N'Charitable Contributions') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (611, N'Profit Sharing Contributions') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (620, N'Interest Paid to Banks') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (621, N'Other Interest') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (630, N'Federal Corporation Income Taxes') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (631, N'State Corporation Income Taxes') INSERT [dbo].[GLAccounts] ([AccountNo], [AccountDescription]) VALUES (632, N'Sales Tax') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (1, 1, 553, 3813.3300, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (2, 1, 553, 40.2000, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (3, 1, 553, 138.7500, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (4, 1, 553, 144.7000, N'Int''l shipment') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (5, 1, 553, 15.5000, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (6, 1, 553, 42.7500, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (7, 1, 553, 172.5000, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (8, 1, 522, 95.0000, N'Telephone service') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (9, 1, 403, 601.9500, N'Cover design') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (10, 1, 553, 42.6700, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (11, 1, 553, 42.5000, N'Freight') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (12, 1, 580, 50.0000, N'DiCicco''s') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (12, 2, 570, 75.6000, N'Kinko''s') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (12, 3, 570, 58.4000, N'Office Max') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (12, 4, 540, 478.0000, N'Publishers Marketing') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription]) VALUES (13, 1, 522, 16.3300, N'Telephone (line 5)') INSERT [dbo].[InvoiceLineItems] ([InvoiceID], [InvoiceSequence], [AccountNo], [InvoiceLineItemAmount], [InvoiceLineItemDescription])