SQL stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. It is used to perform operations on the data present in database.
SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database.
Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system.
However, the standard SQL commands such as “Select”, “Insert”, “Update”, “Delete”, “Create”, and “Drop” can be used to accomplish almost everything that one needs to do with a database.
SQL commands are divided into several different types, among them data manipulation language (DML) and data definition language (DDL) statements, transaction controls and security measures.
Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc.
The LIKE operator is used to list all rows in a table whose column values match a specified pattern. It is useful when you want to search rows to match a specific pattern, or when you do not know the entire value. For this purpose we use a wildcard character ‘%’.
For example: To select all the students whose name begins with ‘S’
SELECT first_name, last_name
WHERE first_name LIKE ‘S%’;
The output would be similar to:
The above select statement searches for all the rows where the first letter of the column first_name is ‘S’ and rest of the letters in the name can be any character.
This SQL Server tutorial explains how to use the WHERE clause in SQL Server (Transact-SQL) with syntax and examples.
The SQL Server (Transact-SQL) WHERE clause is used to filter the results from a SELECT, INSERT, UPDATE, or DELETE statement.
Parameters or Arguments
conditions : The conditions that must be met for records to be selected.
SELECT * FROM employees WHERE first_name = ‘Jane’;
In this SQL Server WHERE clause example, we’ve used the WHERE clause to filter our results from the employees table. The SELECT statement above would return all rows from the employees table where the first_name is ‘Jane’. Because the * is used in the SELECT, all fields from the employees table would appear in the result set.
SQL School (Regd: SequelGate Innovative Technologies Pvt. Ltd.) is strongly committed to provide complete real-time and practical training exclusively on Microsoft SQL Server and Datawarehousing technologies. SQL School Training Institute established in February, 2008 is now one of the best training institute offering SQL Server and T-SQL (SQL Server) Training, SQL Database Administration (SQL DBA) Training and Business Intelligence (MSBI / SQL BI) Training.