postgres DDL

Last updated on November 22, 2024 pm

🧙 Questions

☄️ Ideas

postgre 分层为 DB -> schema -> table 和mysql不一样

创建database

这是真正的创建一个数据库,不推荐

create database ispong_db;
创建schema
create schema schema_name;
建表
CREATE TABLE IF NOT EXISTS users
(
    username varchar,
    age      int   
);
插入数据
insert into users(username, age) values ('ispong',18);
视图
create view users_view as select user1.id ,username ,age from user1 left join user2 on user1.id=user2.id

postgres DDL
https://ispong.isxcode.com/db/postgre/postgres DDL/
Author
ispong
Posted on
September 15, 2022
Licensed under