O'Reilly logo

Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython by Richard Hightower

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SQL Data Definition Language

SQL's Data Definition Language (DDL) is for working with tables and indexes. A table defines a set of columns for different fields of data and is similar to a class in Python. Columns are like class properties or variables; rows are like class instances.

DDL has five statements, which we'll look at in turn in the following sections.

Create Table

The CREATE TABLE statement defines the table. It has the following form:

CREATE TABLE table
(field_name sql_type [(size)] [NOT NULL] [index1] , ...)

where

  • field_name is the name of the field being defined

  • sql_type is a valid SQL type

  • size is the size of the field

  • NOT NULL specifies that the column can't be empty or equal to None

The brackets in the statement denote optional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required