Database Design
While the word database can have many different definitions, depending on the context, the context we will be using it here will be defining storage of an organized collection of data.
What is Database Design?
Database design can be generally defined as a collection of tasks or processes that enhance the designing, development, implementation, and maintenance of enterprise data management system. Proper database design reduces the maintenance cost thereby improving data consistency and the cost-effective measures are greatly influenced in terms of disk storage space. Therefore, there has to be a brilliant concept of designing a database. The designer should follow the constraints and decide how the elements correlate and what kind of data must be stored. The designer also needs to weigh the performance impacts of access (read) performance vs. storage (write) performance.
Why is Database Design important?
The important consideration that can be taken into account while emphasizing the importance of database design can be explained in terms of the following points given below.
- Database designs provide the blueprints of how the data is going to be stored in a system. A proper design of a database highly affects the overall performance of any application.
- The designing principles defined for a database give a clear idea of the behavior of any application and how the requests are processed.
- Another instance to emphasize the database design is that a proper database design meets all the requirements of users.
- Lastly, the processing time of an application is greatly reduced if the constraints of designing a highly efficient database are properly implemented.
This documentation will not cover all of the intricacies of good database design. There are plenty of publications and other educational materials that
HelloWorld Database Schema
The requirements for the data storage stated above in the Requirements section describe only a need to store one text item for every row entered in to the database. The reading requirements describe reading all the rows but there is no requirement for finding a specific row or for ordering the rows in a specific order based on value. With this information, we will create a database schema that will have a container (table) to store all the rows of data. And each row will contain only one item (or column) in it.
create table world ( hello char(20) not null );
The schema above accomplishes everything we need to fulfill the data persistence of our HelloWorld application.
The statements above will create a table named "world" and this table will contain one column named "hello" which is defined as a character field that can hold 20 UTF-8 characters. The "hello" column is also defined as being "NOT NULL". If you are not familiar with the concept of NULL in the SQL language, the short description is that this column constraint has nothing to do with the C/C++ definition of a NULL or "empty string". The ability for a column to be NULL is SQL column property that is covered in the NULL Values section of the documentation later.
NULL column constraints can be used in C/C++ core level API programming. RaimaDB allows the constraint to be turned off to simplify application programming where the ability to determine if a column is NULL or NOT NULL is not needed.
To build our example application, create a text file, helloworld.sdl
, which contains the schema contents we designated as the schema above.