Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
-- создание чистой таблицы (просто колонки с определенными типами данных) create table orders (id serial primary key, name varchar(50)); -- добавление самих данных в таблицу insert into orders (name) values ('Nastya'),('Vova'); -- добавление колонок к существующей таблице alter table orders add column age_old float, add column date_trans timestamp; -- тоже добавление данных в таблицу, данные добавляются с добавлением новой строки, -- если значение указываются не во все столбцы, то неуказанные столбцы будут --содержать null insert into orders (age_old) values (100); -- обновление данных в таблице update orders set date_trans = '11-22-1990 15:40:00' where id = 1; update orders set date_trans = '01-13-1990 15:10:00' where id = 2; update orders set date_trans = '11-07-1990 01:12:00' where id = 3; select to_char(date_trans, 'day-month-yyyy'), date_trans from orders;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear