A GUIDE TO SQL
A GUIDE TO SQL
9th Edition
ISBN: 9781305897397
Author: Pratt
Publisher: CENGAGE L
Question
Book Icon
Chapter 4, Problem 10SCG
Program Plan Intro

“SELECT” command:

The “SELECT” command is used to retrieve data in a database.

Syntax for selecting values from the table is as follows:

SELECT STUDENT_ID FROM STUDENT;

  • The given query is used to display each student ID from “STUDENT” table.

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.

STUDENT_IDSTUDENT_NAMESTUDENT_CREDIT
123Merry90
208John86
408Rose98
564Joseph78

Explanation:

  • User can compute the student credit using the expression “MAXIMUM_LIMIT – SCORE”.
  • From the given query, the computation is calculated by using “-” operator that is from “MAXIMUM_LIMIT – SCORE”.
  • Here the computed result is name as “STUDENT_CREDIT” by using the word “AS”.

Blurred answer
Students have asked these similar questions
Answer two JAVA OOP questions please.
Please answer two JAVA OOP questions.
Answer two JAVA OOP questions.

Chapter 4 Solutions

A GUIDE TO SQL

Knowledge Booster
Background pattern image
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
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L