Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.*. TIA .*. SQL 1. Write a SELECT statement that returns two columns based on the EMPLOYEES table. Contact, is the employee lastname and the

image text in transcribed

.*. TIA .*.

SQL

1. Write a SELECT statement that returns two columns based on the EMPLOYEES table. Contact, is the employee lastname and the first initial of the first name. The second column, Phone, is the homephone without the area code. Only return rows for those employees in the 206 area code, sort the results by the last name.

2. Write a SELECT statement, using the invoices table, that returns the invoicenumber and balance due to every invoice with a non-zero balance and an InvoiceDueDate thats less than 30 days from today.

3. Modify the search expression for invoiceduedate from the solution in exercise 2. Rather than 30 days from today, return invoices due before the last day of the current month. 4. Add a column to the query described in exercise 2 that uses the RANK() function to return a column named BalanceRank that ranks the balance due in descending order.

Products Column Name Condensed Type ProductNa Supplier ID 22 8 5 int UnitPrice Unitsin Stock UnitsOnOrde Reorderleve Discontinued bit nvarchar(30) nvarchar(30) Yes nvarchar(60) Yes nvarchar(15) Yes nvarchar(15) Yes nvarchar(10) Yes nvarchar(15) Yes nvarchar(24) Yes nvarchar24 CustomerCustomerDemo Column Name Condens... Nullable CustomeID nchar(5) No CustomerType. nchar(10) No mone smalli Customer Demographics nvarchar(20) Yes tes TypeNullable NO nvarchar(40) No nvarchar(24) Yes

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_2

Step: 3

blur-text-image_3

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 Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions