Jul 26, 2024
CREATE
, ALTER
, DROP
, TRUNCATE
, COMMENT
.CREATE <object type> <object name> (column definitions)
.CREATE DATABASE testdb;
CREATE TABLE test_table (id INT);
ALTER TABLE <table name> <alteration>
.ALTER TABLE test_table ADD address NVARCHAR(500);
DROP <object type> <object name>
.DROP TABLE test_table;
TRUNCATE TABLE <table name>
.TRUNCATE TABLE test_table;
--
and do not execute.-- Comment text
-- This is a single-line comment.
SELECT * FROM test_table;
/*
and end with */
./* Comment text */
/* This is a
multi-line comment. */
SELECT * FROM test_table;
/* Comment text */ within a statement
SELECT /* inline comment */ * FROM test_table;
CREATE
, ALTER
, DROP
, TRUNCATE
, and COMMENT
.Next session: Discussing Data Query Language (DQL) and the SELECT
statement.