mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-13 14:45:09 +00:00
Глава 41: черновик
This commit is contained in:
8
postgresql/articles.sql
Normal file
8
postgresql/articles.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE articles (
|
||||
id SERIAL,
|
||||
title VARCHAR(40),
|
||||
body TEXT,
|
||||
user_id INTEGER,
|
||||
created_at TIMESTAMP,
|
||||
updated_at TIMESTAMP
|
||||
);
|
1
postgresql/tables_drop.sql
Normal file
1
postgresql/tables_drop.sql
Normal file
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS articles, users;
|
5
postgresql/users.sql
Normal file
5
postgresql/users.sql
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE users (
|
||||
id SERIAL,
|
||||
first_name VARCHAR(40),
|
||||
last_name VARCHAR(40)
|
||||
);
|
1
postgresql/users_delete_limit.sql
Normal file
1
postgresql/users_delete_limit.sql
Normal file
@ -0,0 +1 @@
|
||||
DELETE FROM users LIMIT 1;
|
2
postgresql/users_insert.sql
Normal file
2
postgresql/users_insert.sql
Normal file
@ -0,0 +1,2 @@
|
||||
INSERT INTO users VALUES (DEFAULT, 'Игорь', 'Симдянов');
|
||||
INSERT INTO users (last_name, first_name) VALUES ('Кузнецов', 'Максим');
|
5
postgresql/users_multi_insert.sql
Normal file
5
postgresql/users_multi_insert.sql
Normal file
@ -0,0 +1,5 @@
|
||||
INSERT INTO
|
||||
users (first_name, last_name)
|
||||
VALUES
|
||||
('Максим', 'Кузнецов'),
|
||||
('Игорь', 'Симдянов');
|
2
postgresql/users_truncate.sql
Normal file
2
postgresql/users_truncate.sql
Normal file
@ -0,0 +1,2 @@
|
||||
TRUNCATE TABLE users;
|
||||
DELETE FROM users;
|
Reference in New Issue
Block a user