A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 4, Problem 5RQ

Explanation of Solution

Computed column in SQL:

  • User can perform computations using SQL queries.
  • A computed column does not occurs in the database however it can be computed by using data present in the existing columns.
  • The computations can involve any arithmetic operator.
  • Computations can computed by using the arithmetic operator such + (addition), - (subtraction), * (multiplication) and / (division).
    • Then write the computation result into a place of a particular column name.

Example:

The example for using computed column in SQL is given below:

SELECT STUDENT_ID, STUDENT_NAME, MAXIMUM_LIMIT – SCORE FROM STUDENT;

The above query is used to display student id, student name and student credit from “STUDENT” table...

Explanation of Solution

Naming the computed column in SQL:

  • User can assign a name to the computation by using below ways:
    • Name the computation with the word “AS”.
    • User desired name.

Example:

The example for naming the computed column in SQL is shown below:

SELECT STUDENT_ID, STUDENT_NAME, MAXIMUM_LIMIT – SCORE AS STUDENT_CREDIT FROM STUDENT;

The above query is used to display student id, student name and student credit from “STUDENT” table...

Blurred answer
Students have asked these similar questions
True or FalseString comparisons in SQL are case sensitive.
I was wondering if you could do this in PL/SQL format. declare begin  end; etc
How does the PARSE function differ from the TRY_PARSE function in SQL when converting data types?

Chapter 4 Solutions

A Guide to SQL

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    A Guide to SQL
    Computer Science
    ISBN:9781111527273
    Author:Philip J. Pratt
    Publisher:Course Technology Ptr
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr