sql:ddl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sql:ddl [2021/02/16 11:47] – created jmerarisql:ddl [2021/05/04 17:56] (current) – [PostgreSQL] jmerari
Line 1: Line 1:
 ====== SQL Cheat Sheet :: Data Definition Language ====== ====== SQL Cheat Sheet :: Data Definition Language ======
-===== Create Table Structure =====+===== Create New Table Structure =====
 ==== MySQL ==== ==== MySQL ====
 ==== PostgreSQL ==== ==== PostgreSQL ====
 ==== MSSQL ==== ==== MSSQL ====
 ==== Oracle ==== ==== Oracle ====
-===== Modify Table Structure =====+ 
 +===== Add New Column to Existing Table ===== 
 ==== MySQL ==== ==== MySQL ====
 ==== PostgreSQL ==== ==== PostgreSQL ====
 +==== MSSQL ====
 +<code>
 +ALTER TABLE table-name ADD column-name
 +    { type_name [ ( prec [, scale] ) ] [COLLATE <collation name> ]
 +    [ NULL | NOT NULL ] }
 +</code>
 +
 +==== Oracle ====
 +
 +===== Modify Existing Column in Existing Table =====
 +==== MySQL ====
 +==== PostgreSQL ====
 +<code>
 +alter table t_friend_relation rename column friend_ui to friend_uid;
 +</code>
 ==== MSSQL ==== ==== MSSQL ====
 <code> <code>
  • sql/ddl.1613450874.txt.gz
  • Last modified: 2021/02/16 11:47
  • by jmerari