Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USEING SQL Server Database Development Open the AP database using the SQL Server 2012 Management Studio. Please make sure you review the SQL syntax for

USEING SQL Server Database Development

Open the AP database using the SQL Server 2012 Management Studio. Please make sure you review the SQL syntax for each query that is created.

Please create solutions to the following queries:

1. Write a select statement that returns four columns based on the InvoiceTotal column of the invoices table, AP database.

a. Use the CAST function to return the first column with 0 digits to the right of the decimal point

b. Use the CAST function to return the second column with a $ in front of the value.

c. Using the CONVERT function to return the third column with the smallest precision in mind to return the scale of 3.

d. Use the CONVERT function to return the fourth column with a $ in front and back of the value. There should be no spaces between the symbols and number. i.e $3,813.33$

One row example without the headers:

3813 $3813.33 3813.330 $3,813.33$

2. Write a SELECT statement that returns two columns based on the Vendors table. The first column, Contact, is the vendor contact name, the second is the phone.

a. For the contact, the first name is followed by last name initial (for example, John S.)

b. The second column, Phone, is the VendorPhone column without the area code.

Criteria:

1) Only return rows for those vendors in the 559 area code. You can only use the numbers 559 in the search, no parenthesis.

2) Sort the result set by last name.

One row example with headers:

Contact Phone

Thom A. 555-8484

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

3 How supply and demand together determine market equilibrium.

Answered: 1 week ago