Question: SQL SERVER (SQL FUNCTION CHAPTER) QUERY help. Please use the data entity and attribute names on the diagram provided. Any help would be greatly appreciated!
SQL SERVER (SQL FUNCTION CHAPTER) QUERY help. Please use the data entity and attribute names on the diagram provided. Any help would be greatly appreciated!
3Write a SELECT statement that returns
-The Credit Card Number column
-The length of the Credit Card Number column
-the last four digits of the Credit Card Number column
-A column that displays the last four digits of the Credit Card Number column in this format: XXXX-XXXX-XXXX-1234. Use Xs for the first 12 digits of the card number and actual numbers for the last four digits.
DO NOT hard code the Xs. Use an appropriate SQL function
4Write a SELECT statement that returns
-The Order ID column
-The Order Date column
-A column named ApproxServiceDate is calculated by adding 2 days to the order Date
-The completion date
-A column named DaysToComplete that shows the number of days between the order date and the completion date
-Return just the orders completed this year so far

\begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ LOCATION } \\ \hline PK & LocationID \\ \hline & LocStreetNum \\ & LocStreetName \\ & LocCity \\ LocState \\ LocZip \\ LocEmail \\ LocPhone \\ CreatedDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ SERVICE } \\ \hline PK & ServiceID \\ \hline FK & CategoryID \\ & ServiceDescriptionUnitPriceCreatedDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ INVOICE } \\ \hline PK & InvoicelD \\ \hline FK & CustomerlD \\ FK & OrderID \\ & EmployeelD \\ & SubTotal \\ TaxAmount \\ TotalAmount \\ & InvoiceDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ CATEGORY_SVC } \\ \hline PK & CategoryID \\ \hline & CategoryName \\ \hline \end{tabular} CellPhone Title
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
