DDL is used to create a database schema and define constraints.The Cinchy DDL functions covered on this page are:
The following tables provide the data type(s) that a Cinchy Data Type translates to in the database:
The CREATE TABLE statement is used to create a new table in a database.
The column parameters specify the names of the columns of the table.The datatype parameter specifies the type of data the column can hold (e.g. varchar, char, int, date, etc.).
Syntax
Example
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
The ALTER TABLE statement is also used to add and drop various constraints on an existing table.
Syntax
Example
The DROP TABLE statement is used to drop an existing table in a database.
Syntax
Example
In SQL, a view is a virtual table based on the result-set of an SQL statement.
A view contains rows and columns, taken from fields of an original table and presents them with a different structure and organization. For example, this is useful when only some columns of a table may be relevant to a user, so they don't have to see information from other columns that may be irrelevant to them.
SQL functions and the WHERE statement can be added to a view to present the data as if the data was coming from one single table.
Syntax
Example
Modifies a previously created view. This includes an indexed view. ALTER VIEW does not affect dependent stored procedures or triggers and does not change permissions.
Syntax
Example
A view is deleted with the DROP VIEW command.
Syntax
Example
The CREATE INDEX statement is used to create indexes in tables.
Syntax
Example
The DROP INDEX statement is used to delete an index on a table.
Syntax
Example
Number
Text
Date
Int
NVarChar
DateTime
BigInt
VarChar
Date
Decimal
Char
Float
NChar
Money
NText
Numeric
Text
Real
SmallInt
SmallMoney
TinyInt
Binary
Yes/No
VarBinary
Bit