SQL CREATE ALTER DROP VIEW: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * SQL * SQL Data Types =Overview= =<tt>CREATE</tt>= <syntaxhighlight lang='sql'> CREATE TABLE person ( id smallint, name varchar(30) NOT NULL, CONSTRAINT pk_person PRIMARY KEY (id) ); </syntaxhighlight> :{| class="wikitable" style="text-align: left;" |- | PostgreSQL || MySQL |- |} =<tt>ALTER</tt>= <syntaxhighlight lang='sql'> ALT...") |
(→CREATE) |
||
Line 6: | Line 6: | ||
=<tt>CREATE</tt>= | =<tt>CREATE</tt>= | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
CREATE TABLE | CREATE TABLE cust_view AS | ||
SELECT id, name, address FROM customer; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
:{| class="wikitable" style="text-align: left;" | :{| class="wikitable" style="text-align: left;" | ||
|- | |- | ||
| [[PostgreSQL_DDL_Operations# | | [[PostgreSQL_DDL_Operations#Create_a_View|PostgreSQL]] || [[MySQL_DDL_Operations#Create_View|MySQL]] | ||
|- | |- | ||
|} | |} |
Revision as of 17:06, 23 May 2024
Internal
Overview
CREATE
CREATE TABLE cust_view AS
SELECT id, name, address FROM customer;
ALTER
ALTER TABLE person [...]
Add/Remove a Column
ALTER TABLE person ADD COLUMN birthday DATE;
DROP
DROP TABLE person [...]