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 8, Problem 5RQ

Explanation of Solution

Concatenating columns in Oracle:

  • User can combine values in character column by using two vertical lines (||).
    • The two vertical lines is placed between the column names.
  • Example for concatenating two columns is given below:

  SELECT STUDENT_ID, RTRIM(FIRST_NAME)||' '||RTRIM(LAST_NAME) AS STUDENT_NAME FROM STUDENT;

  • The above query is used to display the student ID, student name by concatenating the student first name and last name for each student from “STUDENT” table.
    • From the given query, the “RTRIM” means right trim which is used to remove any additional spaces inserted at the end of the value.
    • The “STUDENT_NAME” is computed by combining the first name and last name of student with the help of “AS” operator.

Concatenating columns in Access:

  • User can combine values in character column by using “&” symbol.
    • Since the Access will trim the column automatically, user need not to trim the columns in the table.
  • Example for concatenating two columns is given below:

  SELECT STUDENT_ID, FIRST_NAME&''&LAST_NAME AS STUDENT_NAME FROM STUDENT;

  • The above query is used to display the student ID, student name by concatenating the student first name and last name for each student from “STUDENT” table...

Blurred answer
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
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