54  DDL (data definition language)

Data definition language (DDL) statements are Create, drop, alter statements. Database objects are created using create object statements, then stored in data dictionary of database. We can drop these objects using drop object statements. We can also alter these objects using alter object statements. Alter statements typically do not allow every change. According to database engine, we may have to drop the object and create it from the scratch. But most if database engine allows it alter statements are always more preferable and more performant.

The objects we could create again change according to database engine. Sqlite allows following common database objects:

Sqlite also allows virtual tables but this virtual table is a bit different from the sql server and oracle versions.

In addition to above common objects, Sql Server and Oracle allows following common objects:

The sqlite does not need user object being a file-based database but oracle and sql server both require a user for database connection. Therefore, they have variety of commands to handle security, roles, and privileges for users.

These databases also allows creation of custom function and procedures.

For sqlite

You do not have to memorize their exact definition since most modern GUI tools help you to create these statements.

  1. DBeaver Demo Create Table

  2. DBeaver Demo Alter Table

  3. DBeaver Demo Drop Table

  4. DBeaver Demo Create View

  5. DBeaver Demo Alter View

  6. DBeaver Demo Drop View

Being an open source and free tool, DBeaver is not very powerful. But SQL Developer Oracle and Sql Server Management Studio allows creation, alteration and dropping of every object mentioned above using GUI tools.

54.1 Generated/Virtual Columns

Generated Columns in sqlite