Глава 41: черновик

This commit is contained in:
Igor Simdyanov
2022-06-06 13:04:56 +03:00
parent b36c18e70e
commit c247ecd342
7 changed files with 24 additions and 0 deletions

8
postgresql/articles.sql Normal file
View File

@ -0,0 +1,8 @@
CREATE TABLE articles (
id SERIAL,
title VARCHAR(40),
body TEXT,
user_id INTEGER,
created_at TIMESTAMP,
updated_at TIMESTAMP
);

View File

@ -0,0 +1 @@
DROP TABLE IF EXISTS articles, users;

5
postgresql/users.sql Normal file
View File

@ -0,0 +1,5 @@
CREATE TABLE users (
id SERIAL,
first_name VARCHAR(40),
last_name VARCHAR(40)
);

View File

@ -0,0 +1 @@
DELETE FROM users LIMIT 1;

View File

@ -0,0 +1,2 @@
INSERT INTO users VALUES (DEFAULT, 'Игорь', 'Симдянов');
INSERT INTO users (last_name, first_name) VALUES ('Кузнецов', 'Максим');

View File

@ -0,0 +1,5 @@
INSERT INTO
users (first_name, last_name)
VALUES
('Максим', 'Кузнецов'),
('Игорь', 'Симдянов');

View File

@ -0,0 +1,2 @@
TRUNCATE TABLE users;
DELETE FROM users;