SQL  database can be used for managing data generated by the automation system. Generated data can be stored in a local database or in the cloud by using different methods. In our fictitious home automation system, we shall use the MS SQL server. We shall learn how to install the SQL server to the local machine or on any other devices. There are two parts to this tutorial, installing the SQL server  and using the SQL server for our home automation project

We need to install a database on our machine so that data generated by different sensors can be stored in the database. We need to install a database on our computer. Follow these simple steps to install it and learn how we can make a sample application that fits our automation project. Continue reading.

We need to model our system so that we can read and write data to the system or we can update the system based on the event. First, we need to find relations among different entities in the system. We shall use the fluent-NHibernate module. If we use this module then we don’t need to write all the SQL command by ourselves. We shall provide 3 examples that will help us to understand the data modeling. Continue reading.