Mastering SQL: Creating Databases, Crafting Tables, and Perfecting Table Modification

Опубликовано: 01 Апрель 2026
на канале: GISWorld
960
35

#postgresql #opensource #postgres
DDL: Data Definition Language
DDL to create database, table, user, schema and more

create database Smartcity;

create table landparcel(LandparcelID serial PRIMARY KEY,
AssetArea real,
LandUse varchar);


create table owner(
gid serial PRIMARY KEY,
Title varchar,
FirstName varchar,
LastName varchar);

alter table owner
add column city Varchar;

alter table owner
RENAME COLUMN city TO region;

ALTER TABLE owner
DROP COLUMN city;

drop table owner;