11.1. The "Simple" CREATE TABLEYou have seen a "simple" CREATE TABLE statement in Chapter 3. To refresh your memory, here is an example: CREATE TABLE Test1 (name VARCHAR(20), ssn CHAR(9), dept_number INT, acct_balance SMALLMONEY) The following are the elements of this CREATE TABLE command:
Beyond choosing data types for columns in tables, you may need to make other choices to create an effective database. You can create indexes on tables, which then can be used to aid in the enforcement of certain validation rules. You also can use other "add-ons" called CONSTRAINTs, which make you enter good data (or, prevents you from entering invalid data into the database) and hence maintain the integrity of a database. In the following sections, we explore indexes and then CONSTRAINTs. |