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

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.
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
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning