Microsoft SQL Server is a relational database management system (RDBMS). If you want to learn how to work with it, you can install Microsoft SQL Server Express on your computer. SQL Server Express is the free version of SQL Server.
Download the right executable:
Go to the right download page:
Execute the following steps:
- go to Microsoft website’s download center page: www.microsoft.com/download/.
- on the top right hand side of the page, there is an edit box and a search button (magnifier icon). In the edit box, type “sql server express”.
- in the dropdown appearing under the edit box, click on “sql server express 2014”.
- a new page appears, with a list of software applications. Under “Downloads”, click on “Microsoft® SQL Server® 2014 Express”.
- click on the red download button.
Choose the right download file:
You now need to find out which installation file to download. This depends on your operating system: is it a 32-bit or 64-bit operating system.
To find out, execute the following steps:
- Open the command prompt(cmd). To do that on Windows 7: click on the Start button (windows icon). In the search box (appearing just over the Start button), type the following: cmd. Click on cmd in the search results listing (if it does not work, try typing "command" instead of "cmd"). Alternatively, click on the Start button, then on “All Programs”, then on “Accessories”, and finally on “Command Prompt”. On Windows 8: hold the windows button on your keyboard and press X. On the menu appearing on the bottom left hand side of the screen, click on “start”.
- A window with a black background appears. In this window, type the following and then press Enter:
You will see either “osarchitecture 64-bit” or “osarchitecture 32-bit”.
Click on the check box on the left hand side of the chosen installation file, and then click on the blue “next” button appearing on the bottom left hand side of your screen. The download then starts automatically.
Launch the installation
Once the download is complete, double-click on the downloaded installation file. The installation file name is SQLEXPRWT_x64_ENU.exe or SQLEXPRWT_x32_ENU.exe. If you cannot find the file in the download folder on Windows explorer, look for the file. To look for the file on Windows 7 or Windows 8:
- click on the Windows (start) button on the bottom left of your screen.
- type the filename. A list of suggestions appears.
- click on SQLEXPRWT_x64_ENU.exe or SQLEXPRWT_x32_ENU.exe (depending on which file you downloaded).
When clicking on the installation file, you have started the installation process. You need to wait before something happens on the screen. During the entire process you will need a lot of patience. Do not try to kill any process or restart the process even if you think nothing is processing, or something is proceeding too slowly.
If there is any warning asking you to confirm you want to run this installation file, click on OK.
If a window appears asking you to choose the directory for extracted files:
check that in the edit box under “Choose Directory for Extracted Files”, you have the right installation file name (SQLEXPRWT_x64_ENU.exe or SQLEXPRWT_x32_ENU.exe).
If it is the right name, click on OK. If not, click on “browse” to find the file (you should have found the file path in the previous step, when you looked for the file).
Choose “New installation”:
When the SQL Server Installation Center window appears, on the right hand side of the window, click on “New SQL Server stand-alone installation”.
An SQL Server 2014 setup window appears displaying the license terms. On the left hand side, you can see a list of steps. The current step, “License terms”, appears in bold. On the right hand side, read the licence terms and click on “I accept the licence terms” if you agree with what you read. Then click on “Next”.
Global rules, product updates, setup files installation:
During the step “global rules” (when “global rule” is in bold on the left hand side), you do not need to do anything. Same thing for the steps “Product Updates” and “Install setup Files”. During the step “install rules”, wait that features are checked automatically and click on Next (you just have to wait and click on Next).
Instance Configuration: note the instance name
During the step “Instance Configuration”, note down the name of the instance that appears on the right hand side of “Named instance”. This is the name of the SQL server instance you are creating. It is the name of the process that you will run to manage your database.
Then click on Next.
During the step “Server Configuration”: just click on Next.
Database Engine Configuration: be very careful to note down the username and password
Step “Database Engine Configuration”: you need to be very careful here. Under “Authentication Mode”, choose “Mixed Mode”. This will enable you to choose between two methods to login to the database server:
- method 1: windows logs you in automatically.
- method 2: you enter a user and password.
Then click on Next.
Installation Progress: takes a very long time.
Step “Installation Progress”: do nothing, just wait. This process may take up to 30 minutes. At some points it even looks like nothing is happening. This is normal, just wait.
Once this process is complete, you get a warning window (computer: restart required). This is normal, just click on OK. Then click on the close button to close the “SQL Server 2014 setup window”. You can then close the “SQL Server Installation Center” Window.
Now restart your computer.
Launch the right tool:
Once you have restarted your computer, click on the windows button (start button). Type the following:
Windows displays a list of programs. Click on: “SQL Server 2014 Management Studio”.
Login to the server:
Wait that the tool starts (again, patience). A login window (Connect to Server) appears. In the combo box near “Authentication”, choose “SQL Server Authentication”. Then in login type the username (sa) and the password you noted down in the previous step. Then click on Connect.
Create a database
The management studio appears. On the left hand side, you have a window called “Object Explorer”. Inside this window, right click on the folder called “Databases”, then click on “New Database”.
A “New database” window appears. In front of “Database name:”, enter any database name (for example “companyInformation”). Then click on OK.
Enter your two first SQL statements:
On the Management Studio horizontal menu, click on “File”, then “New”, then “Query with Current Connection”. A new tab appears on the central window. The tab name starts with “SQLQuery..”.
Inside this window, type the following:
The database you created should be highlighted on the left hand side window, under the folder Databases. If not, double-click on your database name. If you cannot see any database name under the folder “Databases”, then click on the “+” sign on the left hand side of “Databases”.
On top of the tab name, click on the button “Execute” (red exclamation mark). This creates a very simple table called “testtable”.
Type the following:
Highlight what you just typed (insert into testtable values (1,’testvalue’)) and click on the “Execute” button. When you highlight an SQL statement and click on “Execute”, it executes only the statement you highlighted, even if there are other statements on the page.
You are now ready to write any statement you like.