Prepare the Logical Schema Script

Designing a logical schema for an Vertica database is no different from designing one for any other SQL database. Details are described more fully in Designing a Logical Schema.

To create your logical schema, prepare a SQL script (plain text file, typically with an extension of .sql) that:

  1. Creates additional schemas (as necessary). See Using Multiple Schemas.
  2. Creates the tables and column constraints in your database using the CREATE TABLE command.
  3. Defines the necessary table constraints using the ALTER TABLE command.
  4. Defines any views on the table using the CREATE VIEW command.

You can generate a script file using:

In your script file, make sure that:

Once you have created a database, you can test your schema script by executing it as described in Create the Logical Schema. If you encounter errors, drop all tables, correct the errors, and run the script again.