My Adsense

Wednesday, November 18, 2009

Implementing database concepts to develop an application in agile approach : Part 1.2 (Database Server)


Hello everyone. In my last post, i have showed how to create a table schema from real time problem domain, which is now we called as user story. But to work on a database, we need to create tables in a database server. Since i am working on .NET Platform, i am using Microsoft's SQL Server  2005.

Installing Microsoft SQL Server 2005:
This server is automatically installed when we install Visual Studio 2008. Or you can download the server file from http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx.

Installing Microsoft SQL Server 2005 Management Studio Express:
To working on the SQL Server, you need to install a management tool. You can download this from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en this location.

OK. Now we are ready to work on the SQL Server.
When you lunch the management studio express, the following window will appear.


Figure 1: SQL Server Management Studio Express

I am giving you the short description of the SQL Server Management Studio Express opening window. Please Google yourself if you want to know more on this topics.


Server name:
In your computer, you may have several instances on of sql server 2005, or different versions of sql server like as 2005, 2008 etc. you will give them a specific name to work with it.
In this case, MAGICBOX is the server name and SQLEXPRESS is the instance name of the sql server 2005 on which we are currently working on.


Authentication:
Sql server provides you couple of types of authentication. In Windows Authentication, server assumes since you logged into the machine, you are authenticated to access on the server. But if you use the other type (SQL Server Authentication), you have to enter the credentials of User name and the Password field of that server instance.

Now we will create the table in database.

Walkthrough 1: Creating ‘t_Student’ table using SQL Server Management Studio Express
Steps:
1. Go to: StartMicrosoft SQL Server 2005SQL Server Management Studio Express
2. The following window will appear


Figure 2: Opening Window of Management Studio

3. Click the ‘Connect’ button
4. There are several nodes you will find on which you can work with. Each of the nodes explains itself.


Figure 3: Explorer of Management Studio


5. Right click on the ‘Databases’ node
6. Click on ‘New Database’
7. Enter the database name meaningful. For our user requirement, we will enter ‘ABCUniversityDatabase’ as the name.
8. Click on the button given in the following figure to select the destination path of the database files


Figure 4: Select the Destination Path


9. Click ‘OK’
10. You will find the following figure on your screen


Figure 5: Newly Created Database

11. Check your HDD file location to check the database file


Figure 6: Files created in your hard disk

12. Now expand the ‘ABCUniversityDatabase’ on your management studio express
13. Right click on the ‘Tables’ node
14. Click on ‘New Table’ option
15. Enter the column names given in the following figure


Figure 7: Column Definition of student's table

16. Click on save option and enter the table name as ‘t_Student’
17. Now expand the ‘Tables’ node from Object Explorer window
18. You will find your just created table in here


Figure 8: Columns Viewed in Explorer

Thus you have created a table (t_Student) in your database (ABCUniversityDatabase) to store data (information of studetns). :)

In my next post i will show you how to create the application in C#, which will take the information from the user and store it in the table.
Happy coding.

No comments: