MSBi Training

SQL LIKE Operator

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
FROM student_details
WHERE first_name LIKE ‘S%’;

The output would be similar to:

first_name          last_name
————-          ————-
Stephen                 Fleming
Shekar                   Gowda

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.

How to Connect to SQL Server after Installation

This video explains on “How to Connect to SQL Server after Installation”

Applicable for SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014 and SQL Server 2016

T0 resolve possible connection issues at basic level, ensure the following:

1. Verify and ensure correct server name is provided

2. Go to Run then services.msc then ensure SQL Server service for the respective instance is started.

Any clarifications: Please email to contact@sqlschool.com

For Real-time Trainings and Projects, Placements on SQL Server, please visit http://www.sqlschool.com

Or call us on +91 9666440801 (INDIA) or +1 510-400-4845 (USA/CANADA)

Using of And, OR and NOT in SQL Server

AND: The AND operator displays a record if all the conditions separated by AND is TRUE.

Syntax:

SELECT column1, column2, …
FROM table_name
WHERE condition1 AND condition2 AND condition3 …;

Example:

SELECT * FROM Customers
WHERE Country=’India’ AND City=’Hyderabad’;

The above SQL statement selects all fields from “Customers” where country is “India” AND city is “Hyderabad”

OR:The OR operator displays a record if any of the conditions separated by OR is TRUE.

Syntax:

SELECT column1, column2, …
FROM table_name
WHERE condition1 OR condition2 OR condition3 …;

Example:

SELECT * FROM Customers
WHERE City=’Hyderabad’ OR City=’Pune’;

The following SQL statement selects all fields from “Customers” where city is “Hyderabad” OR “Pune”

NOT:The NOT operator displays a record if the condition(s) is NOT TRUE.

Syntax:

SELECT column1, column2, …
FROM table_name
WHERE NOT condition;

Example:

SELECT * FROM Customers
WHERE NOT Country=’India’;

Using of Where Clause in SQL Server

Using of Where Clause in SQL Server

This SQL Server tutorial explains how to use the WHERE clause in SQL Server (Transact-SQL) with syntax and examples.

Description

The SQL Server (Transact-SQL) WHERE clause is used to filter the results from a SELECT, INSERT, UPDATE, or DELETE statement.

Syntax

WHERE conditions;

Parameters or Arguments

conditions : The conditions that must be met for records to be selected.

For example:

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.

SSIS School of Training

Date data types

DATE() A date. Format: YYYY-MM-DD

Note: The supported range is from ‘1000-01-01’ to ‘9999-12-31’

DATETIME() A date and time combination. Format: YYYY-MM-DD HH:MI:SS

Note: The supported range is from ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’

TIMESTAMP() A timestamp. TIMESTAMP values are stored as the number of seconds since the Unix epoch (‘1970-01-01 00:00:00’ UTC). Format: YYYY-MM-DD HH:MI:SS

Note: The supported range is from ‘1970-01-01 00:00:01’ UTC to ‘2038-01-09 03:14:07’

TIME() A time. Format: HH:MI:SS

Note: The supported range is from ‘-838:59:59’ to ‘838:59:59’

YEAR() A year in two-digit or four-digit format.

Note: Values allowed in four-digit format: 1901 to 2155. Values allowed in two-digit format: 70 to 69, representing years from 1970 to 2069

How to delete a record in a table using SQL?

The SQL DELETE Query is used to delete the existing records from a table.

You can use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted.

Syntax:
The basic syntax of DELETE query with WHERE clause is as follows:

DELETE FROM table_name
WHERE [condition];

Example:
Consider the CUSTOMERS table having the following records:
+—-+———-+—–+———–+———-+
| ID | NAME | AGE | ADDRESS | SALARY |
+—-+———-+—–+———–+———-+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

Following is an example, which would DELETE a customer, whose ID is 6:

DELETE FROM CUSTOMERS
WHERE ID = 6;

If you want to DELETE all the records from CUSTOMERS table, you do not need to use WHERE clause and DELETE query would be as follows:

DELETE FROM CUSTOMERS;

SQL School: Best Trainers for Microsoft SQL Server Technologies

SQL School: Best Trainers for Microsoft SQL Server Technologies

Choose SQL School (http://www.sqlschool.com) for LIVE Online, Classroom and Video Trainings.

SQL School: Best Trainers for Microsoft SQL Server Technologies

Best Trainers for Microsoft SQL Server Technologies

 

SQL School: Best Trainers for Microsoft SQL Server Technologies 

 

About SQL School Training Institute

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.

 

Training Highlights:

  • Highly Interactive, Practical
  • Certifications & Resumes
  • Placements & Job Support
  • THREE Realtime Case Studies
  • One Real-time Project
  • 24×7 LIVE Server with Lab

 

 

Continue reading

MSBI / SQL BI LIVE Online Training with Realtime Project

www.sqlschool.com

www.sqlschool.com

 

Please register for MSBI (SSIS, SSAS, SSRS) LIVE Online Training – Free Demo on Apr 3, 2015 8:00 AM IST at:

https://attendee.gotowebinar.com/register/1523739862997573633

Completely Real-time and Practical.
Theory Material in Advance.
Trainer Profile @ https://www.linkedin.com/in/saiphanindra

After registering, you will receive a confirmation email containing information about joining the webinar.

For course details, please visit : http://sqlschool.com/MSBI-Online-Training.html