eurocec ebusiness innovations web services





  European Centre of e-Commerce & Publishing


29/12/20

SQL | MySQL Programming | Using MySQL with PHP | Authentication Login System | Content Management System | MySQL 5 Installation |


SQL /


Managing Tables



To create a table you must be based on its specifications as they are defined during the requirement analysis phase for the Entities (Objects) Data Model - EDM of the application.


That means you know the pieces of information (columns) that will structure each row of the table as well as the data types of the fields.

Moreover, you must take care to start the table and column names with a letter which could be followed by letters, numbers, or underscores.

These names can have a maximum total length of 30 characters.

Notice that SQL reserved keywords such as "SELECT", "CREATE", "INSERT", "DELETE", etc are not allowed to be used as names for tables or column names.

The data types define the type of data that each particular column can accept as content.

According to the aim that a column (attribute) serves its data type should be defined respectively.

Here are the most common data types:

  • char (size):
This data type defines a fixed-length character string. Its size is specified in parenthesis with a maximum number 255 bytes.
  • varchar (size):
The variable character defines the variable-length character string. Its maximum size is specified in parenthesis.
  •  number (size):
The number defines the number value. Its size is a max number of column digits specified in parenthesis.
  • date:
 Date value
  • number (size,d):
The number with decimal part defines the number value with a maximum number of total digits in "size", and with a maximum number of "d" digits to the right of the decimal.
On the one hand during the tables creation process we have the columns data types declarations and on the other hand the columns constraints. But, what are constraints?

A constraint is associated with a column as well as the data which is going to be put into that column to satisfy it.

For example, a very popular constraint is that a column can not have a null value "not null" and another also very popular constraint is the "primary key" constraint which demands a unique identification of each record (row) in a table.







Copyright © euRoCec.eu

The content and services of eurocec.eu are offered under the terms of use which the visitors have accepted.


Sectors: Publishing, e-Business Development, Financial and Investment Consulting, Web Services, WebSite Management, WebSite Optimization, Search Engines Optimization, Web Business Plans, Email Marketing.