Change Values

Create Table Of Elves

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

Insert Rows Into Elf Table

INSERT INTO elves (name, age, race, alive)
VALUES ('Dallar Woodfoot', 25, 'Elf', 'Yes'),
       ('Cordin Garner', 29, 'Elf', 'Yes'),
       ('Keat Knigh', 24, 'Elf', 'Yes'),
       ('Colbat Nalor', 124, 'Elf', 'Yes')

Update Row Values

-- Update the elves table
UPDATE elves
-- To set age to the current age plus 1
SET age = age + 1

View Elves Table

-- Retrieve all rows from the view Elf
SELECT * FROM elves
nameageracealive
Dallar Woodfoot26ElfYes
Cordin Garner30ElfYes
Keat Knigh25ElfYes
Colbat Nalor125ElfYes