[1]
Chapter 4:
DATABASE DESIGN
4.1 Overview of Database Design:
Database is an important part of the software as it contain all the necessary information to
run the hardware and website. Such as storing the schedule, storing the billing information,
log information and user data.
4.2 Selection of SQL Server Database:
There are a number of databases available but Microsoft's SQL Server is a popular
database software for database-driven web sites with high traffic.SQL Server is a very
powerful, robust and full featured SQL database system
4.2.1 Advantages of SQL over MYSQL:
SQL Server, Visual Studio, and the entire .NET ecosystem, are built to work
together. While one can use MySQL with .NET, but it doesn't integrate better with
.NET.
SQL Server has better replication support. If you ever need to scale your database
beyond a single-server or simple master-slave configuration, MySQL will produce
troubles.
SQL Server has more sophisticated per-row locking, and concurrency which means
even though some rows in a table are queried, other rows can still be inserted or
modified concurrently.
[2]
It has Native support for GUIDs as primary keys - if one prefer GUIDs for keys
One of the biggest and important advantage of using SQL Server with Visual
Studio is that it is totally integrated with the IDE.
Another advantage is that it is the common choice among the people, and so one
can get more help and information if problems are encountered.
SQL is designed for heavy traffic.
Automates time-consuming and error-prone tasks
SQL secures the stored data.
SQL supports user management and permissions
4.3 SQL Server Version:
The version used in the project is sql-server-2008
4.4 Description of Database:
To create a database this command should be entered:
CREATE DATABASE my_db;
This database will contain all the necessary information for Controlling, billing and graph.
Following are the description of the tables:
4.4.1 Table User:
It contains the user details such as ID and password who can access the site.
Table 4.1
[3]
4.4.2 Table Series1 and Series2:
There are 2 series for controlling the lights the voltages for intensity control are stored in
tables in the form of integers which are different for each month depending on the situation
Figure 4.2
[4]
Figure 4.3
Table Series1 and series2 contain all the information which is needed to control the lights
according to the schedule prepared. Here the numbers represents the voltages to be
provided to the lights
S.no Value/Volt Equivalent %
which are scaled down
1 2 25%
as follows
2 5 50%
3 7 75%
4 10 100%
Table 4.1
Table Log:
Table log presents the log values with time how that much voltages were provided to the
system at particular date and time.
[5]
Table 4.4
4.5.1 Database Connection to the Visual studio:
For connecting the database to the visual studio project. First open the database in SQL
server and connect the SQL server instance. After that open the web project in Visual
studio and follow the steps:
Open Server Explorer Right click on Data Connection
Add new connection Write the server name then enter the DataBase name
Test the Connection
If connection Succeeded then the database is successfully connected to the visual studio
now it is needed to correct the Connection String in the web.config file of the website for
the correct Server Name.