How to Enable Remote Connection on SQL Server

Submitted by admin on

In this tutorial I will teach you on how to enable remote connection on SQL Server. I will use SQL Server 2005 Express Edition on this tutorial. However, this is also applicable to any version of SQL Server. The only difference is the GUI for different kinds of SQL Server version.

This tutorial is very useful if you want to access your SQL Server database from other computer and you want to connect two or more computers from your network.

SQL Joins

Submitted by admin on

SQL JOIN is used to combine two or more tables based on primary key and foreign keys.

We use Join in conjunction with the table we normalize during database design. Consider a Department table we have in our previous example. We create a Department table that serves as our master file to be called from other table.

SQL JOIN can be very time consuming on large table, e.g. one with millions of records, since it has to match each row of one table, and check it with each row of other tables mentioned in the JOIN keyword.

SQL Alias

Submitted by admin on

As in normal life we associate some nicknames with people, or call them with names that are not there actual names SQL also allows us to do the same with the table columns, since it is much easier to memorize, view as it is in real life. Now the point where SQL ALIAS becomes important is that whenever we have a table which has complex column names we can easily rename the column understand it easily.

NOTE that SQL Alias will not change the actual name of the column in the table.

SQL Wildcards

Submitted by admin on

The SQL WILDCARDS are used along with the SQL LIKE operator in the SELECT statement. The WILDCARDS are quite complex but are very useful in retrieving data. Consider if there’s no wildcards then we could not search in the database easily. You would have to enter each and every character to match the required result. So, for easier search, SQL WILIDCARDS comes to rescue.

Now what wildcards really are? They are set of characters which lets the DBMS to know that what and how to look for the query.

Some Important Wildcards

SQL TOP Clause

Submitted by admin on

The SQL provides us with the option to retrieve a specific set of data from the table, rather than fetching all the table or only some specific rows by mentioning the matching condition in the WHERE clause.

Now what if you want to get the top 10 rows or top 5 rows from the table, or you simply want to retrieve the last, middle number of rows. But the top clause is not supported by all DBMS, some have respective syntax. However the SQL Limit can also act in the same way. For Oracle equivalent is Rownum.

Syntax

SQL IN Operator

Submitted by admin on

The SQL IN operator is used with the WHERE clause in the SELECT statement, this can be used to look to the dataset matching the condition and looking in the supplied data, in easier words, the IN operator can make further selections in the selected data.

The SQL IN operator can also be used to write nested SQL queries, the nested query first fetches some data and then the wrapper query select or simply filters more from the selected data.

Now let's see the IN operator in Action.

SQL IN Syntax

SQL LIKE Operator

Submitted by admin on

The SQL provides us with the option to retrieve a specific set of data from the table, based on matching it with some sort of string with which we are unsure how it is stored in the database, e.g. if one does not know what is the actual spelling of certain thing, or he simply wants to search the database on the given values, the LIKE operator can be used in building a simple search bar on the website, which will get all the results from the database that matched the string given in the search Bar.