What is SQL?
is a simple programming language designed for accessing and manipulating RDBMS
databases (MS-SQL server, Oracle, MySql
is ANSI (American national standards institute) standard language.
stands for Structured Query Language.
are 5 types of SQL statements
DRL (data retrieval language )
DDL(data definition language)
DML(data manipulation language)
DCL(data control language)
TCL(transaction control language)
Data in RDBS (Relational Database Management System) is stored in objects
table is a collection of related data entries and it consists of columns and
1. Using SQL you can create (ADD), DROP (Remove)
2. Using SQL you can create Database, Delete
3. Using SQL you can Insert,
Update, and Delete data (records) in table, and these
4. Operations also known as CRUD operation.
5. SQL can create stored procedures in a
6. SQL can create views in a database
7. SQL can set permissions on tables,
procedures, and views
SELECT TITLE,Employee,[Description] from
Bootstrap framework allows you to
display code using two different tags:
1. Using pre tag
If the code needs to be displayed as a
standalone block element or if it has multiple lines, then you should use the
2. Using code tag
If you are going to be displaying code inline,
you should use the <code> tag.
With below example I want to display
C# LINQ source code using bootstrap source and pre tag
<p>with <pre> tag code as:
<pre> var UserDetails = (from userData in DbContext.User where userData.ManagerId == 3
<p>using code tag.</p>
var UserDetails = (from userData in DbContext.User
where userData.ManagerId == 3
Having Clause with
My friend asked
me a question, “Can I use case statement in a HAVING clause in SQL server?”
confused but still answered I think this is possible.
After some tweaks
I crated t-sql query that uses case statement in having clause and that experience
I shared in this tutorial.
In this example
select statement returns employee with Searched CASE expression which satisfies
employee salary is more than “INR 150” per day and female employee salary is
more than “INR 180.”
CASE expression evaluates a set of Boolean expressions to determine the result.
Employee table Data:
EmployeeName ,Country,CompanyPlant,Gender, Total=MAX(PayScale)
GROUP BY EmployeeName ,Country,CompanyPlant,Gender
HAVING (MAX(CASE WHEN
Gender = 'Male'
ELSE NULL END) > 150.00
OR MAX(CASE WHEN Gender = 'Female'
ELSE NULL END) > 180.00)
Select Query returned Data: