clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2805490 fiddles created (40760 in the last week).

CREATE TABLE people ( id INT GENERATED ALWAYS AS IDENTITY, firstName VARCHAR(100), lastName VARCHAR(100), fullName VARCHAR(200) ); INSERT INTO people (firstName, lastName) VALUES ('firstName1', 'lastName1'), ('firstName2', 'lastName2'); SELECT * FROM people;
2 rows affected
id firstname lastname fullname
1 firstName1 lastName1
2 firstName2 lastName2
 hidden batch(es)


ALTER TABLE people DROP COLUMN fullName, ADD COLUMN fullName VARCHAR(200) GENERATED ALWAYS AS (firstName || ' ' || lastName) STORED;
 hidden batch(es)


SELECT * FROM people; INSERT INTO people (firstName, lastName) VALUES ('firstName3', 'lastName3'); SELECT * FROM people; UPDATE people SET firstName = firstname || '_changed'; SELECT * FROM people;
id firstname lastname fullname
1 firstName1 lastName1 firstName1 lastName1
2 firstName2 lastName2 firstName2 lastName2
1 rows affected
id firstname lastname fullname
1 firstName1 lastName1 firstName1 lastName1
2 firstName2 lastName2 firstName2 lastName2
3 firstName3 lastName3 firstName3 lastName3
3 rows affected
id firstname lastname fullname
1 firstName1_changed lastName1 firstName1_changed lastName1
2 firstName2_changed lastName2 firstName2_changed lastName2
3 firstName3_changed lastName3 firstName3_changed lastName3
 hidden batch(es)