Friday, 23 January 2015

Types of Join in SQL Server||Different Types of SQL Joins||Join in SQL - Inner, Outer, Left, Right Join


Joins in Sql Server

Table 1:











 Table 2













Inner Join :-

The INNER JOIN keyword selects all rows from both tables as long as there is a match between the columns in both tables.

select * from emp1
JOIN
emp2
on emp1.eid=emp2.eid






Left Outer Join:-
The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match.

Query for Left Outer Join:-
select * from emp1
left outer join
emp2
on emp1.eid=emp2.eid








Right Outer Join:-
The RIGHT JOIN keyword returns all rows from the right table (table2), with the matching rows in the left table (table1). The result is NULL in the left side when there is no match.

Query for Right Outer Join:-













SQL FULL OUTER JOIN
The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2).
The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.

Query for FULL OUTER JOIN :-

select * from emp1
FULL OUTER JOIN
emp2
on emp1.eid=emp2.eid




Cross join:-
SQL CROSS JOIN will return all records where each row from the first table is combined with each row from the second table. Which also mean CROSS JOIN returns the Cartesian product of the sets of rows from the joined tables.


SELECT * FROM emp1 CROSS JOIN emp2





Write a query to display from table1 and table2 records?
Table 1



Table2



Sql query to join two tables are:-
select emp1.eid,emp1.ename,emp1.esal,emp2.eadd,emp2.ephone from emp1 join emp2 on

emp1.eid=emp2.eid
























Tuesday, 23 December 2014

Display Html Control using Datepicker control of jQuery,Jquery Ui Widgets Date Picker Control



Jquery Ui Widgets Date Picker Control:
Task 1:Display Html Control using Datepicker control of jQuery?
DatePicker:
Jquery Ui provides a method i.e datepicker() to be applied to an input element type of text to be appear as datepicker ,calendar based control to pick the date for certain fields such as date of birth,eventdate
Syn:$(selector).date               
UI  design:
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="themes/jquery-ui-1.11.2/jquery-ui.theme.css" />
    <script type="text/javascript" src="Scripts/jquery-2.1.1.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui-1.11.2.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
       
        $("#txt1").datepicker();
        });
    </script>
<div align="center">
    <b>Enter Date of Birth</b>
    <input type="text" id="txt1" />
   
    </div>

Task 2:Display Date Of birth Field With Following Options?

<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="themes/jquery-ui-1.11.2/jquery-ui.theme.css" />
    <script type="text/javascript" src="Scripts/jquery-2.1.1.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui-1.11.2.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
       
        $("#txt1").datepicker();
        });
    </script>
<div align="center">
    <b>Enter Date of Birth</b>
    <input type="text" id="txt1" />
   
    </div>

Monday, 22 December 2014