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
:(.
AnnZ [28]

Answer:

Um what?

Explanation:

Chile anyways so-

7 0
3 years ago
Read 2 more answers
HELP BRAINLIEST FOR RIGHT ANSWER
Scilla [17]

Answer:

true I know this cuz I smart

7 0
3 years ago
Read 2 more answers
Any single girls 12-14 im a 13 yo boy idc if this aint a dating site
-BARSIC- [3]

Answer:

THIS AN'T DATING APP

Explanation:

THIS IS THE ONE THE ONLY

BRAINY

5 0
3 years ago
Read 2 more answers
What important technology most helps small businesses compete with larger international companies
Novay_Z [31]

Answer: wireless net work

Explanation:

7 0
3 years ago
A ____ paragraph places the first character of a text line near the left border of a placeholder.
faltersainse [42]
A left - align paragraph places the first character of a text line near the left border of a placeholder. Paragraph alignments such as left - align, center - align and etc.. Are available on every word processing programs. The answer to your question is LEFT - ALIGN.
7 0
3 years ago
Other questions:
  • On what dates did the 2016 Olympics take place( list all)
    9·2 answers
  • Software that interprets commands from the keyboard and mouse is also known as the ​
    7·1 answer
  • Do you think boot-camp-style treatment centers can help young. People kick smartphones addictions?
    14·2 answers
  • The process of converting information from a form/questionnaire is referred to as data preparation. This process follows a four-
    10·1 answer
  • Hi, what’s up, im really bored and have nothing to do
    7·2 answers
  • Write at least complete set of HTML code to hyperlink to “Home.html”..
    8·1 answer
  • A natural language processor reads the sentence The walk was tiring and mistakes the noun “walk” as a verb. What is such an erro
    13·1 answer
  • What is 5 times 5 times 16 times 11 2345
    6·2 answers
  • What is the difference between compliled and intebrated language?
    7·2 answers
  • What are the basic data types supported in C programing language?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!