1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Otrada [13]
2 years ago
12

Write a SELECT statement that returns these columns from the Orders table: The CardNumber column The length of the CardNumber co

lumn The last four digits of the CardNumber columnWhen you get that working right, add the column that follows to the result set. This is more difficult because the column requires the use of functions within functions. A column that displays the last four digits of the CardNumber column in this format: XXXX-XXXX-XXXX-1234. In other words, use Xs for the first 12 digits of the card number and actual numbers for the last four digits of the number.selectCardNumber,len(CardNumber) as CardNumberLegnth,right(CardNumber, 4) as LastFourDigits,'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumberfrom Orders
Computers and Technology
1 answer:
Pepsi [2]2 years ago
8 0

Answer:

SELECT

CardNumber,

len(CardNumber) as CardNumberLength,

right(CardNumber, 4) as LastFourDigits,

'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumber

from Orders

Explanation:

The question you posted contains the answer (See answer section). So, I will only help in providing an explanation

Given

Table name: Orders

Records to select: CardNumber, length of CardNumber, last 4 digits of CardNumber

From the question, we understand that the last four digits should display the first 12 digits as X while the last 4 digits are displayed.

So, the solution is as follows:

SELECT ----> This implies that the query is to perform a select operation

CardNumber, ---> This represents a column to read

len(CardNumber) as CardNumberLength, -----> len(CardNumber) means that the length of card number is to be calculated.

as CardNumberLength implies that an CardNumberLength is used as an alias to represent the calculated length

right(CardNumber, 4) as LastFourDigits, --> This reads the 4 rightmost digit of column CardNumber

'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumber --> This concatenates the prefix XXXX-XXXX-XXXX to the 4 rightmost digit of column CardNumber

as FormattedNumber implies that an FormattedNumber is used as an alias to represent record

from Orders --> This represents the table where the record is being read.

You might be interested in
Write a program that asks the user to input an integer named numDoubles. Create a dynamic array that can store numDoubles double
Hitman42 [59]

Answer:

Answered in C++

#include <iostream>

using namespace std;

int main() {

   int size;

   cout<<"Length of array: ";

   cin >> size;

   double *numDoubles = new double[size];

   double sum =0;

   cout<<"Array Elements: ";

   for(int i=0;i<size;i++){

       cin>>numDoubles[i];

       sum += numDoubles[i];

   }

   delete [] numDoubles;

   cout<<"Average: "<<sum/size;

   return 0;  

}

Explanation:

This line declares the size (or length) of the array

<em>    int size; </em>

This line prompts the user for the array length

<em>    cout<<"Length of array: "; </em>

This gets the input from the user

<em>    cin >> size; </em>

This dynamically declares the array as of double datatype

<em>    double *numDoubles = new double[size]; </em>

This declares and initializes sum to 0

<em>    double sum =0; </em>

This prompts the user for elements of the array

<em>    cout<<"Array Elements: "; </em>

The following iteration gets input from the user and also calculates the sum of the array elements

<em>    for(int i=0;i<size;i++){ </em>

<em>        cin>>numDoubles[i]; </em>

<em>        sum += numDoubles[i]; </em>

<em>    } </em>

This deletes the array

<em>    delete [] myarray; </em>

This calculates and prints the average of the array

<em>    cout<<"Average: "<<sum/size; </em>

6 0
3 years ago
Which options are available in the Conditional Formatting dialog box? Check all that apply.
IrinaVladis [17]

Answer:

There are several options within this dialog box for applying Conditional Formatting ☼ Click the desired option under the Select a Rule Type list. ☼ The bottom portion of the dialog box will change depending on the Rule Type that was selected. ✞ Click Format Only Cells That Contain under Select a Rule Type

6 0
2 years ago
Read 2 more answers
What type of message authentication code uses hashing to authenticate the sender by using both a hash function and a secret cryp
Vesna [10]
Answer is (HMAC) Hashed Message Authentication Code

This combines authentication via a shared secret cryptography algorithm key with hashing. It involves the client and server each with a private key. The client creates a unique hash per request to the server through hashing the request with private keys.






3 0
3 years ago
​Five elements that can prove the genuineness of a user: what you know, what you have, what you are, what you do, and where you
yuradex [85]

Answer: Authentication factor

Explanation: Authentication factor are the factors that describes about the ingenuity or originality of the user .This is the term that tells about the actuality of user that is getting connected with network by the five elemental question .

The question is regarding the possession, inherency, knowledge/information , identity and location.The answers to these question help in finding the authenticated user.

6 0
3 years ago
Read 2 more answers
What's an e-mail server? An e-mail server is the computer to which the e-mail message is sent. An e-mail server is the e-mailing
umka2103 [35]

Answer:

An e-mail server is a specialized computer that stores, processes, and sends e-mails is the correct answer.

Explanation:

An email server is also called a mail transfer agent is a program that is responsible for delivering, storing and receiving the email by following standard email rules.

Types of Email server:

  • Outgoing mail servers.
  • Incoming mail servers.

The main purpose of the e-mail server is to stores the incoming mail and sends outgoing mails.

8 0
3 years ago
Other questions:
  • Consider a file system that uses inodes to represent files. Disk blocks are 2KB in size and a pointer to a disk block requires 4
    13·1 answer
  • It is a good idea to use more than one typeface in a document when _____.
    8·2 answers
  • What were precomputed tables and why were they necessary?​
    12·2 answers
  • What cell address indicates the intersection of the first row and the first column in a worksheet?
    15·2 answers
  • What two units are used to measure the frequency and amplitude of a sound wave?
    10·1 answer
  • What best describes deflation?
    9·2 answers
  • Describe the differences between program development and program execution, including the installed software required for develo
    5·1 answer
  • What percent of the internet is the deep web?
    14·1 answer
  • List three ways of breaking a copyright law with the illegal copy of software.​
    11·1 answer
  • Limitations of systems analysis and design​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!