MVC

  • Home
  • HTML
    • Overview
    • Formatting
  • Java Script
    • Overview
    • Validation
  • CSS
    • Overview
  • Sql
    • Overview
    • SQL Select
    • SQL Command
    • Advance Query
    • SQL Create
    • Function
    • Function vs StoreProcedure
    • Stored Procedures
  • MVC
    • OverView
    • Evolution of MVC
    • Install VisualStudio-2015
    • Create First Application
  • LINQ
    • Introduction
  • Privacy Policy

Sunday, 24 September 2017

INSERT INTO statement in SQL

  Unknown       08:57       AdvanceQuery       No comments    

INSERT INTO SELECT Statement


In this article describe about Insert data one table to existing table The INSERT INTO SELECT statement selects data from one table and inserts it into an existing table.
Example
In this article Firstly create 2 tables like - tbl_1,tbl_2 and insert some values in tbl_1 Using 'INSERT INTO' Statement data Insert into tbl_2 table , you will find all records in tbl_2 table
Create Table

Create table tbl_1
(
Id int,
name nvarchar(10)
)


Note -
Table tbl_1 created with two field and same for tbl_2 with same field and datatype, name may be different but datatype same

Above Example Created Table tbl_1 after that Use Insert into Statement


Syntex
Note -
INSERT INTO [TableName]
SELECT * FROM [TableName]

You also see example then you can better understand

Example
INSERT INTO tbl_2
SELECT * FROM tbl_1


Note -
In this example Tbl_2 inserted all record which are in tbl_1, You can see above using select statement
SELECT * FROM tbl_2

SELECT INTO STATEMENT


you can want to make replica of table then use select into
select * into tbl_2 from tbl_1 In this no need create table ,following example we can't create table tbl_2 only create tbl_1 and just make replica so table and data same copy in replica of table this is explain in my previous article
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+

Sql Like Operator

  Unknown       08:18       Select       No comments    

The SQL LIKE Operator


In this Article describe Like Operator. The SQL LIKE clause is used to compare a value to similar values using wildcard operators. The LIKE operator is used to search for a specified pattern 'start letter and end letter and Contain letter/words' in a column. There are two wildcards used in LIKE operator.
1.(%) Percent Sign.
2.(_) Under Score Sign.
Percent sign (%) - This sign represents zero, one or multiple characters. Under Score ( _ ) - This sign represents a single number or character And use in Combination.
Syntax
SELECT ColumnName FROM TableName WHERE ColumnName LIKE pattern

We use like operator many types in Sql query.-

1.Start with letter
SELECT * FROM Tbl_Employee WHERE name LIKE 'M%'


Note - In this example those name start with 'M' letter, You can get result using like Operator

2. End with letter
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE '%M'
Note - In this example those name End with 'M' letter, You can get All result those name end with 'M' letter using like Operator

3.Contain letter in word
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE '%M%'
in any position. Note - In this example those name contain 'M' letter in word at any position, You can get All result those name contain 'M' letter using like Operator

4.Contain in letter in word
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE '%M%'
Note - In this example those name End with 'M' letter, You can get All result thoses name end with 'M' letter using like Operator

SQL _ Wildcard

1. Start letter with ( _ )
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE '_e'
Note - In this example those name start with '_' means any charter but second place character is e , You can get All result those name have second position contain 'e' .

2. End letter with (_)
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE 'ra_'
Notes- In this example use like operator with _ Wildcard search result with start with ra and end with any letter.

3. Middle word have wildcard
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE 'J_c_'
Notes-In this example use like operator with _ Wildcard. The following SQL statement selects all Employee with a City starting with "J", followed by any character, followed by "c", followed by any character. You can get this type of result easily.

SQL [charlist] Wildcard


This type of pattern use where you want to fetch some records those name start with some specific character
Example-
SELECT * FROM Tbl_Employee WHERE name LIKE '[rjm]%';
Notes - In this example use like operator with charlist. The following SQL statement selects those Employee who's name starting with "r","j" & "m"apply this pattern you can find output easily.
The following SQL statement selects all employee's name start with "r", "j", or "m"
You can use different type of like see above example -
SELECT * FROM Tbl_Employee WHERE name LIKE '[a-z]%'; Note - In this example select all employee those name consist and start with 'a' to 'z' range you can get all record. if you want the you change rang also like you give '[a-m]%' use this pattern then only find within range all records.

You can use same pattern not start with character in this following example see above-
SELECT * FROM Tbl_Employee WHERE name LIKE '[!rjm]%'; Note - In this example select all employee those name not start with "r", "j", or "m" .Using this pattern you can get all records.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+

Thursday, 21 September 2017

Html Formatting

  Unknown       11:12       Formatting       No comments    

Text Editing

You can edit text easly in html using many predefine tags. HTML also defines special elements and tags for defining text with a special meaning. Using those type of Formatting elements like-
  •  <b> - Use this element to bold text
  • <strong> - This is also same bold tag but give Important text
  • <i> - Use this for Italic text 
  • <em> - This is use for Emphasized text
  • <mark> - This is use Marked text
  • <small> - This is use Small text
  • <del> - This is use Deleted text
  • <ins> - This is use Inserted text
  • <sub> - This is use Subscript text
  • <sup> - This is use Superscript text
Html <b> Element Example -
Example
<b> This is example of bold tag < /b>
Note -you can write any text within <b> tag
Result - This is example of bold tag
Html <strong> Element  Example-
Example
<strong> This is example of strong tag < /strong>
Note -you can write any text within <strong> tag
Result - This is example of strong tag
Html <i> Element Example
Example
<i> This is example of Italic tag < /i>
Note -you can write any text within <i> tag
Result - This is example of Italic tag
Html <em> Element Example
Example
<em> This is example of Italic tag < /em>
Note -The HTML <em> element defines emphasized text, with added semantic importance. <i> tag
Result - This is example of emphasized tag
Html <small> Element Example
Example
<small> This is example of small tag < /small>
Note -The HTML <small> element defines smaller text
Result - This is example of small element
Html <mark> Element Example
Example
<mark> This is example of mark tag < /mark>
Note -The HTML <mark> element defines marked or highlighted text
Result - This is example of mark element
Html <del> Element Example
Example
<del> This is example of del tag < /del>
Note -The HTML <del> element defines deleted (removed) text
Result -
This is example of del element
Html <ins>Element Example
Example
<ins> This is example of ins tag < /ins>
Note -The HTML <ins> element defines inserted (added) text.
Result -
This is example of ins element
Html <sub> Element Example
Example
<sub> This is example of sub tag < /sub>
Note -The HTML <sub> element represent subscripted text.
Result - This is example of sub element
Html <sup>Element Example
Example
<sup> This is example of sup tag < /sup>
Note -The HTML <sup> element represent superscripted text.
Result - This is example of superscripted text
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+

Wednesday, 20 September 2017

SQL Group By Clause

  Unknown       10:28       Select       No comments    

What is Group By clause ?

In this Article Group by clause use in Select query in Sql Server when you fetch data with collection on basis particular unique field then use Group by Clause. Group by clause with where condition and order by clause.
The GROUP BY statement is used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result-set by one or more columns.
Syntex
SELECT ColumnName FROM TableName WHERE condition GROUP BY ColumnName ORDER BY ColumnName
Example
SELECT COUNT(Id) as Counts,City FROM Tbl_Employee GROUP BY City
Create table Tbl_Employee with some field and group by city.
if you run query with GROUP BY Clause then you find group wise city records.
In case if you use Group By Clause then always use aggregate functions.If you not use aggregate function then face error.
You can see in example


Select All records in image- image
Group by clause on city -


The HAVING Clause


The HAVING clause use in SQL because the WHERE keyword could not be used with aggregate functions.
Syntex

SELECT ColumnName, Aggregate Function(ColumnName) FROM TableName WHERE ColumnName operator value GROUP BY ColumnName HAVING Aggregate Function(ColumnName) operator value
SELECT COUNT(Salary) AS Counts,Salary,City FROM Tbl_Employee GROUP BY City ,Salary HAVING Salary > 25000
Note - You should aware having condition apply then this field must be in aggregate function and group by clause


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Newer Posts Older Posts Home

learningmvctutorial

Popular Posts

  • Overview
      SQL (Structured Query Language)   SQL  is a language that interacts with the database on the server-side. This dynamite duo has changed ...
  • Overview of HTML
    What is HTML? First developed by Tim Berners-Lee in 1990 . HTML is used to create electronic documents (called pages) that are displ...
  • Difference Between function v/s store procedure
    Definition  of Store Procedure In a database management system (DBMS), a  stored procedure  is a set of Structured Query Language (SQL...
  • SQL Select
    The SQL SELECT Statement The SELECT statement is used to select data from a database. SQL SELECT Syntax SELECT column_name , column_n...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • What is Function in Sql Server
    A function is a block of code that has a name and it has a property that it is reusable. We use function in store Procedure and queries in...
  • Create Duplicate Table of existing table in SQL Server
    In This Tutorial we create table and want to same structure and same data then We create new table with data type after that  insert in ta...
  • About Javascript
    What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting langua...
  • Operator in JavaScript
    What is an operator? JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binar...
  • Open Application in MVC
    We want to create application in MVC first of how we create first application Show Steps   as below-     STEP 1 .  Start Computer and  I...

Blog Archive

  • ▼  2017 ( 35 )
    • ►  November ( 1 )
    • ►  October ( 2 )
    • ▼  September ( 4 )
      • INSERT INTO statement in SQL
      • Sql Like Operator
      • Html Formatting
      • SQL Group By Clause
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ►  May ( 3 )
    • ►  April ( 7 )
    • ►  March ( 13 )
    • ►  February ( 3 )
Powered by Blogger.

Categories

  • AdvanceQuery
  • CreateApplication
  • CreateDb
  • CssOverview
  • Evolution
  • Formatting
  • Function
  • FunctionVSSp
  • HtmlOverview
  • InstallVisualStudio
  • Introduction
  • javascriptOverview
  • JsValidation
  • Mvc-vs-Asp.Net
  • OverView
  • Select
  • SqlCommand
  • SQLOverview
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © MVC | Powered by Blogger
Design by Vibha Acharya