In database, the fundamental structure is the table which is used for saving the data. Database can not tell you about your requirements. You have to declare your requirements while creating the table. Most of the time, there is no need of writing the syntax of SQL. You can use different tools for this function. The important thing is to use CREATE TABLE as the basic structure of the table.
Table has columns and rows. Every row has a chunk of data whereas the column shows the constituent of that chunk of data. In a table, we have to declare the headers of a column as well as type of data for specific column.
There are different types of data. Data can be real number like ‘0.23’, integer like ‘23’, or a string like ‘abl’ etc. whenever we make a table, we have to declare the kind of data for all column. It is significant to know that there are diverse data types in databases.
The basic structure for creating a table is given below;
("column 1" "data_type_for_column_1",
"column 2" "data_type_for_column_2",
In order make a table for Purchaser, then it will be like this;
In case, the entries of a column are not mentioned then by default value will be used for that column. If you want to give a column a default entry then you have to write Default subsequent to the declaration of data type.
Here is an example for explanation;
Address char(51) default 'Unknown',
City char(51) default 'Los Angeles',
If you want to make perimeters of the information, then it is better to use constraints.