SQL CREATE ALTER DROP VIEW: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:
=<tt>CREATE</tt>=
=<tt>CREATE</tt>=
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'>
CREATE TABLE cust_view AS  
CREATE VIEW cust_view AS SELECT id, name, address FROM customer;  
SELECT id, name, address FROM customer;  
</syntaxhighlight>
</syntaxhighlight>
:{| class="wikitable" style="text-align: left;"
:{| class="wikitable" style="text-align: left;"

Revision as of 17:06, 23 May 2024

Internal

Overview

CREATE

CREATE VIEW cust_view AS SELECT id, name, address FROM customer;
PostgreSQL MySQL

ALTER

ALTER TABLE person [...]

Add/Remove a Column

ALTER TABLE person ADD COLUMN birthday DATE;
PostgreSQL MySQL

DROP

DROP TABLE person [...]
PostgreSQL MySQL

Features

AUTO_INCREMENT

AUTO_INCREMENT