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]
3 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]3 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
When initiating a connection how does tcp establish a connection?
Pani-rosa [81]
It uses a 3-way handshake

1. SYN from client to server.
2. SYN-ACK from server to client.
3. ACK from client to the server.

At this point, both client and server have received an acknowledgement of the connection.

4 0
3 years ago
Which of the following is not a scene mode?
tatiyna
I believe the answer is C) Model.
7 0
4 years ago
Read 2 more answers
Which of the following advancements in agriculture is most environmentally conscious?
Otrada [13]
Aquaculture or genetic engineering!
5 0
3 years ago
When you set up a worksheet, you should use cell references in formulas whenever possible, rather than ____ values.
vovangra [49]

Answer:

Constant

Explanation:

One of the flexibility of worksheet is using cell references to get the value of a cell, this will make the overall formula update itself when cell values are changed, but when using a constant to make computation the formula is not keeping track of the contents of the cells for any change and this will make it a fresh work to get a value based on changed values.

4 0
3 years ago
****plz help soon! **** i need help creating a children's story about online safety!
Ray Of Light [21]

Just explain in your story that kids should be careful what websites they go to and what they search for and what they download.


5 0
3 years ago
Read 2 more answers
Other questions:
  • Which type of word processing programs enables us to include illustrations within the program?
    9·2 answers
  • What’s of the following can be used to visually represent information similar to diagrams format painter Helens smart are a clip
    8·1 answer
  • Why is important to maintain a naming convention within the company that is developing computer programs?
    6·1 answer
  • Plssss helpppp!!<br><br>Thanks
    11·2 answers
  • . File systems do not maintain the attributes associated with the files. Select one: True False
    13·1 answer
  • Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
    7·1 answer
  • Write a program that will draw a red circle on top of a blue square in the center of the canvas. The blue square should have sid
    12·1 answer
  • When in global configuration mode, which steps are necessary to edit an ip address on an Ethernet interface?
    11·1 answer
  • write a function that returns a list, where each member of list contains previous day’s value multiplied by 2.​
    15·1 answer
  • Any BTS army here
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!