Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Setup: Use create _ ap . sql to create database 1 . Write a SELECT statement that returns four columns based on the InvoiceTotal column

Setup:
Use create_ap.sql to create database
1. Write a SELECT statement that returns four columns based on the
InvoiceTotal column of the Invoices table:
o Use the CAST function to return the first column as data type decimal
with 2 digits to the right of the decimal point.
o Use CAST to return the second column as a varchar
o Use the CONVERT function to return the third column as the same data
type as the first column.
o Use CONVERT to return the fourth column as a varchar, using style 1
2. Write a SELECT statement that returns two columns based on the Vendors
table. The first column, Contact, is the vendor contact name in this format:
first name followed by last initial (for example, John S.) The second
column, Phone, is the VendorPhone column without the area code. Only
return rows for those vendors in the 559 area code. Sort the result set by
first name, then last name.
3. Write a SELECT statement that returns the InvoiceNumber and balance due
for every invoice with a non-zero balance and an InvoiceDueDate thats less
than 30 days from today.

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Define and discuss affirmative action.

Answered: 1 week ago

Question

Discuss diversity management.

Answered: 1 week ago