Apply Operation To Column

Create Table Of Adventurers

-- Create table called adventurers
CREATE TABLE adventurers (
    -- string variable
    name varchar(255),
    -- integer variable
    age int,
    -- string variable
    race varchar(255)

Insert Rows

-- Insert into the table adventurers
INSERT INTO adventurers (name, age, race)
VALUES ('Fjoak Doom-Wife', 28, 'Human'),
       ('Alooneric Cortte', 29, 'Elf'),
       ('Piperel Ramsay', 35, 'Elf'),
       ('Casimir Yardley', 14, 'Elf')

Apply Operation To Column

-- Update the age column, multiplying all age values by 10
UPDATE adventurers SET age = age * 10

Apply Operation To Column With Conditions

-- Update the name column where the race column is 'Elf'
UPDATE adventurers SET name = 'Some Elf'
WHERE race = 'Elf'

View Table

-- Retrieve data
SELECT * FROM adventurers
Fjoak Doom-Wife280Human
Some Elf290Elf
Some Elf350Elf
Some Elf140Elf