mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-10 03:01:01 +00:00
Глава 41: переработка раздела, посвященного вставке данных
This commit is contained in:
5
postgresql/catalog_null.sql
Normal file
5
postgresql/catalog_null.sql
Normal file
@ -0,0 +1,5 @@
|
||||
DROP TABLE IF EXISTS catalogs;
|
||||
CREATE TABLE catalogs (
|
||||
id INTEGER,
|
||||
name TEXT
|
||||
);
|
13
postgresql/multi_insert.sql
Normal file
13
postgresql/multi_insert.sql
Normal file
@ -0,0 +1,13 @@
|
||||
DROP TABLE IF EXISTS catalogs;
|
||||
CREATE TABLE catalogs (
|
||||
id SERIAL,
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
INSERT INTO catalogs
|
||||
(name)
|
||||
VALUES
|
||||
('Процессоры'),
|
||||
('Материнские платы'),
|
||||
('Видеоадаптеры'),
|
||||
('Жесткие диски'),
|
||||
('Оперативная память');
|
5
postgresql/timestamp.sql
Normal file
5
postgresql/timestamp.sql
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE tbl (
|
||||
id INTEGER NOT NULL,
|
||||
putdate TIMESTAMP NOT NULL,
|
||||
lastdate DATE NOT NULL
|
||||
);
|
@ -1 +0,0 @@
|
||||
DELETE FROM users LIMIT 1;
|
@ -1,2 +0,0 @@
|
||||
INSERT INTO users VALUES (DEFAULT, 'Игорь', 'Симдянов');
|
||||
INSERT INTO users (last_name, first_name) VALUES ('Кузнецов', 'Максим');
|
@ -1,5 +0,0 @@
|
||||
INSERT INTO
|
||||
users (first_name, last_name)
|
||||
VALUES
|
||||
('Максим', 'Кузнецов'),
|
||||
('Игорь', 'Симдянов');
|
@ -1,2 +0,0 @@
|
||||
TRUNCATE TABLE users;
|
||||
DELETE FROM users;
|
Reference in New Issue
Block a user