Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andriikot/postgresql-lesson-1
PostgreSQL Lesson 1
https://github.com/andriikot/postgresql-lesson-1
Last synced: 3 days ago
JSON representation
PostgreSQL Lesson 1
- Host: GitHub
- URL: https://github.com/andriikot/postgresql-lesson-1
- Owner: AndriiKot
- Created: 2023-03-27T11:27:41.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-27T15:18:01.000Z (almost 2 years ago)
- Last Synced: 2024-11-07T15:18:00.207Z (about 2 months ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostgreSQL-lesson-1
PostgreSQL Lesson 1
```sql
CREAT DATABASE testdbCREATE TABLE publisher
(
publisher_id integer PRIMARY KEY,
org_name varchar(130) NOT NULL,
address text NOT NULL,
);CREATE TABLE book
(
book_id integer PRIMARY KEY,
title text NOT NULL,
isbn varchar(32) NOT NULL
)DROP TABLE publisher;
DROP TABLE book;INSERT INTO book
VALUES
(1,'The Diary of a Young Girl','0123403430430'),
(2,'Pride and Prejudice','93232304204'),
(3,'To Kill a Mockingbird','3424254456'),
(4,'The Book of Gutsy Women','12344532');INSERT INTO publisher
VALUES
(1,'Evereman''s Library','NY'),
(2,'Oxford University Press', 'NY'),
(3,'Grand Central Publishing','Washington'),
(4,'Simon & Schister','Chicago');SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'testdb'
AND pid <> pg_backend_pid()DROP DATABASE testdb
"test string"
```