April 13th, 2009

Table Creation, Introduction (Part 1 of 2)

Posted by admin in P. Table Creation

Many people use SQL to retrieve and update data in an existing database for their company. When you start doing database design, you find that a lot of time is spent laying out and normalizing the tables as well as defining indices, relationships, and constraints. This is normally done on paper and goes through a number of revisions before the SQL code is written. The study of database design is extensive and goes beyond the content of this course.Object maintenance is done using the SQL subset called Data Definition Language, or DDL, which includes the commands CREATE, ALTER, and DROP. See SQL is DML, DDL, & DCL.

For now we will concentrate on table creation. When we create a table, we need to define the:

The table and column names must conform to the naming standards of your company and SQL.
The data types are for specifying the type (character, numeric, etc.) and the length of the data.
The default value is for what values will be used if no value is given.
The constraints give limits to the values, such as “Is this a key?,” “Can it be null?,” ” Must this value exist in another table?,” etc.

Comments are closed.

Sorry, the comment form is closed at this time.