Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please create a .sql file that answers the 7 questions below. */ /*================================================================================ Q1: Write a SELECT statement that returns 3 columns from a Vendors

Please create a .sql file that answers the 7 questions below.

*/ /*================================================================================ Q1: Write a SELECT statement that returns 3 columns from a Vendors table: VendorContactFName, VendorContactLName, and VendorName. Sort the result set by the last name, then by first name */ /*================================================================================ Q2 Write a SELECT statement that returns the following 4 columns from an Invoice table: number alias for InvoiceNumber total alias for InvoiceTotal credits PaymentTotal + CreditTotal balance InvoiceTotal - PaymentTotal - CreditTotal use "Old-School" notation for assigning the column aliases */ /*================================================================================ Q3: Write a SELECT statement that returns one column from a Vendors table: fullName. Create this column from the VendorContactFName and VendorContactLName columns. Format it as last name, first name (ex: Doe, John) Sort the set by last name then first name. */ /*================================================================================ Q4: Write a SELECT statement that returns 3 columns: invoiceTotal From the Invoices table interest 10% of the value of InvoiceTotal grandTotal InvoiceTotal + the interest Where the balance is more than 1,000 */ /*================================================================================ Q5: Write the same query from question #2 but modify the query to filter for invoices with an InvoiceTotal that's greater than or equal to 500 but less than or equal to 10000 */ /*================================================================================ Q6: Write the same query from question #3 but modify the query to filter for contacts whose last name begins with the letter A, B, C, or E */ /*================================================================================ Q7: Write a SELECT statement that determines whether the PaymetDate column of the Invoices table has any invalid values. To be valid, PaymentDate must be a null value if there's a balance due and a non-null value if there's no balance due. Code a compound condition in the WHERE clause that tests for these conditions. */ 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago