Wednesday, September 29, 2010

What is Interface, DIFFERENCE BETWEEN CLASS AND INTERFACE

INTERFACE
1.    Interface is a group of constant and method declaration. An interface may be created fro different classes
2.    Through interface polymorphism is supported by java.
DIFFERENCE BETWEEN INTERFACE AND ABSTRACT CLASS.
1.    interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance.
2.    Variables declared in a Java interface is by default final. A Java abstract class may contain non-final variables.
3.    Memebers of a Java interface are public by default. A Java abstract class can have the usual flavors of class members like private, protected, etc. or abstract class may contain non-public members.
4.    Java interface should be implemented using keyword “implements”; A Java abstract class should be extended using keyword “extends”.
5.    A Java class can implement multiple interfaces but it can extend only one abstract class.
6.    interface is more flexible than abstract class because one class can only "extends" one super class, but "implements" multiple interfaces.

DIFFERENCE BETWEEN CLASS AND INTERFACE

1.    Interface is little bit like a class... but interface is lack in instance variables....that's u can't create object for it.....
2. Interfaces r developed to support multiple inheritance...

3. The methods present in interfaces r pure abstract.

4. The access specifiers public,private,protected r possible with classes.but the interface uses only one spcifier public.

Database Management System (DBMS), Defination Of DBMS

 Collection of interrelated data
Set of programs to access the data
 DBMS contains information about a particular enterprise
 DBMS provides an environment that is both convenient and efficient to use.
 Database Applications:
H Banking: all transactions
H Airlines: reservations, schedules
H Universities:  registration, grades
H Sales: customers, products, purchases
H Manufacturing: production, inventory, orders, supply chain
H Human resources:  employee records, salaries, tax deductions
n Databases touch all aspects of our lives

complex query, Select query, Insert query, Delete Query, update query

60) select * from customer where rating>any (select rating from customer where city='rome');

 CNUM CNAME                CITY               RATING      SNUM
----- -------------------- --------------- --------- ---------
 2002 gita                 rome                  200      1003
 2003 laxit                surat                 200      1002
 2004 govind               bombay                300      1001
 2006 champak              surat                 300      1007
 2008 priyank              surat                 300      1004


-----------------------------------------------------------------------------------------------------------------------------

61) SELECT * FROM order2 WHERE AMOUNT > ANY(SELECT AMOUNT FROM orders WHERE ODATE='6-OCT-97');

no rows selected

-----------------------------------------------------------------------------------------------------------------------------

62)

-----------------------------------------------------------------------------------------------------------------------------

63) SELECT C.* FROM CUSTomer C WHERE C.RATING > ALL(SELECT RATING FROM CUSTomer WHERE CITY='ROME');


 CNUM CNAME                CITY               RATING      SNUM
----- -------------------- --------------- --------- ---------
 2001 hardik               london                100      1001
 2002 gita                 rome                  200      1003
 2003 laxit                surat                 200      1002
 2004 govind               bombay                300      1001
 2005 chandu               london                100      1001
 2006 champak              surat                 300      1007
 2007 pratik               rome                  100      1004
 2008 priyank              surat                 300      1004


-----------------------------------------------------------------------------------------------------------------------------

64) SELECT * FROM CUSTOMER WHERE NOT RATING = ANY(SELECT RATING FROM CUSTOMER WHERE CITY='SURAT');

 CNUM CNAME                CITY               RATING      SNUM
----- -------------------- --------------- --------- ---------
 2001 hardik               london                100      1001
 2002 gita                 rome                  200      1003
 2003 laxit                surat                 200      1002
 2004 govind               bombay                300      1001
 2005 chandu               london                100      1001
 2006 champak              surat                 300      1007
 2007 pratik               rome                  100      1004
 2008 priyank              surat                 300      1004

-----------------------------------------------------------------------------------------------------------------------------

complex query, Select query, Insert query, Delete Query, update query

SQL> select s.sname,c.cname,c.city from salesman s,customer c where s.sname='niraj' and s.snum=c.snu
m;

SNAME           CNAME           CITY
--------------- --------------- ---------------
niraj           laxit           surat
niraj           govind          bombat

-----------------------------------------------------------------------------------------------------------------------------

39)
SQL> select a.cname,b.cname,c.snum,c.sname from salesman c,customer b,customer a where a.snum=b.snum
 and b.snum=c.snum and a.snum=b.snum and a.cnum<b.cnum;

CNAME           CNAME                SNUM SNAME
--------------- --------------- --------- ---------------
hardik          chandu               1001 piyush
laxit           govind               1002 niraj


-----------------------------------------------------------------------------------------------------------------------------

40)
SQL> select distinct a.sname,b.sname from salesman a,salesman b where a.city=b.city and a.snum<b.snu
m;

SNAME           SNAME
--------------- ---------------
piyush          miti

-----------------------------------------------------------------------------------------------------------------------------

41)SQL> SELECT CNAME,CITY FROM CUSTOMER WHERE RATING IN(SELECT RATING FROM CUSTOMER WHERE CNAME='Hardik
');

no rows selected

-----------------------------------------------------------------------------------------------------------------------------

42)SQL> SELECT * FROM ORDER2 WHERE SNUM IN(SELECT SNUM FROM SALESMAN WHERE SNAME='MITI');

     ONUM     AMOUT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3006   1713.12 10-APR-99      2002      1003

-----------------------------------------------------------------------------------------------------------------------------

43)SQL> SELECT * FROM ORDER2 WHERE SNUM IN(SELECT SNUM FROM SALESMAN WHERE CITY='BARODA');

     ONUM     AMOUT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3003    1900.1 10-MAR-99      2007      1004

-----------------------------------------------------------------------------------------------------------------------------

44)44)SQL> select * from order2 where snum in(select snum from customer where cname='hardik');

     ONUM    AMOUNT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3002       767 03-OCT-99      2001      1001
     3008      4723 05-OCT-99      2006      1001
     3010      9899 06-OCT-99      2006      1001

-----------------------------------------------------------------------------------------------------------------------------

45)SQL> select onum,amount,odate from order2 where odate>'10-apr-99';

     ONUM    AMOUNT ODATE
--------- --------- ---------
     3007        76 10-MAY-99
     3008      4723 10-MAY-99
     3009      1310 10-MAY-99
     3010      9899 10-JUN-99

-----------------------------------------------------------------------------------------------------------------------------

46)SQL> select * from order2 where snum in(select snum from customer where city='london');

     ONUM    AMOUNT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3002       767 03-OCT-99      2001      1001
     3008      4723 05-OCT-99      2006      1001
     3010      9899 06-OCT-99      2006      1001

-----------------------------------------------------------------------------------------------------------------------------

47)SQL> select sname,commission from salesman where snum in(select snum from customer where city='londo
n');

SNAME                COMMISSION
-------------------- --------------------
piyush               12%

-----------------------------------------------------------------------------------------------------------------------------

48)SQL> select * from customer where snum in(select snum from salesman where sname='niraj' and cnum>snum+1000);

     CNUM CNAME      CITY          RATING      SNUM
--------- ---------- ---------- --------- ---------
     2003 laxit      surat            200      1002
     2004 govind     bombay           300      1002

-----------------------------------------------------------------------------------------------------------------------------

49)SQL> select count(cnum) from customer where rating>(select avg(rating) from customer where city='sur
at');

COUNT(CNUM)
-----------
          2

-----------------------------------------------------------------------------------------------------------------------------

50)SQL> select * from pratik where cnum in(select cnum from customer where cname='champak');

     ONUM    AMOUNT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3008      4723 05-OCT-99      2006      1001
     3010      9899 06-OCT-99      2006      1001

-----------------------------------------------------------------------------------------------------------------------------

51)SQL> select b.cnum,a.cname,a.rating from customer a,order2 b where a.cnum=b.cnum and b.amount>(select avg(amount)
 from order2);

     CNUM CNAME         RATING
--------- ---------- ---------
     2003 laxit            200
     2006 champak          300
     2006 champak          300

-----------------------------------------------------------------------------------------------------------------------------

52)SQL> select c.cname,o.odate,amount from customer c,order3 o where c.cnum=o.cnum and odate='10-mar-99';

CNAME           ODATE        AMOUNT
--------------- --------- ---------
pratik          10-MAR-99        19
hardik          10-MAR-99       767
pratik          10-MAR-99      1900
laxit           10-MAR-99      5160

-----------------------------------------------------------------------------------------------------------------------------

53)

-----------------------------------------------------------------------------------------------------------------------------

54)SQL> SELECT ODATE,SUM(AMOUNT),MAX(AMOUNT) FROM ORDER2 GROUP BY ODATE HAVING SUM(AMOUNT)>MAX(AMOUNT)+
2000;

ODATE     SUM(AMOUNT) MAX(AMOUNT)
--------- ----------- -----------
10-MAR-99        7846        5160

-----------------------------------------------------------------------------------------------------------------------------

55)SQL> SELECT CNUM,CNAME,RATING FROM CUSTOMER WHERE RATING IN(SELECT MAX(RATING) FROM CUSTOMER GROUP BY
 CITY);

     CNUM CNAME              RATING
--------- --------------- ---------
     2001 hardik                100
     2005 chandu                100
     2007 pratik                100
     2002 gita                  200
     2003 laxit                 200
     2004 govind                300
     2006 champak               300

7 rows selected.

-----------------------------------------------------------------------------------------------------------------------------

56)SQL> SELECT S.SNUM,S.SNAME,S.CITY,C.CNUM,C.CNAME,C.CITY FROM SALESMAN S,CUSTOMER C WHERE S.CITY=C.CI
TY AND S.SNUM=C.SNUM;

     SNUM SNAME           CITY                 CNUM CNAME           CITY
--------- --------------- --------------- --------- --------------- ---------------
     1001 piyush          london               2001 hardik          london
     1002 niraj           surat                2003 laxit           surat
     1001 piyush          london               2005 chandu          london

-----------------------------------------------------------------------------------------------------------------------------

57) select s.snum,s.sname,s.city,c.rating from salesman s,customer c where s.snum=c.snum and c.rating>500;

no rows selected

-----------------------------------------------------------------------------------------------------------------------------

58) select s.*,c.* from salesman s,customer c where s.snum=c.snum and s.city=c.city;

     SNUM SNAME                CITY            COMMISSION      CNUM CNAME
--------- -------------------- --------------- ---------- --------- --------------------
CITY               RATING      SNUM
--------------- --------- ---------
     1001 piyush               london                  12      2001 hardik
london                100      1001

     1002 niraj                surat                   13      2003 laxit
surat                 200      1002

     1001 piyush               london                  12      2005 chandu
london                100      1001


-----------------------------------------------------------------------------------------------------------------------------

59)

Select query, Insert query, Delete Query, update query

SQL> select TO_CHAR(odate,'dd/mm/yy'), count(odate) from order2 group by odate;

TO_CHAR( COUNT(ODATE)
-------- ------------
10/03/99            4
10/04/99            2
10/05/99            2
--------------------------------------------------------------------------------------------
(27)

SQL> select onum,snum,amount from order34 where snum in (select snum from salesman where commission=
12);

     ONUM      SNUM    AMOUNT
--------- --------- ---------
     3002      1001    767.19
     3008      1001      4723
     3010      1001   9898.87
----------------------------------------------------------------------------------------------
(28)

SQL> SELECT CITY,MAX(RATING) FROM CUSTomer GROUP BY CITY;

CITY                 MAX(RATING)
-------------------- -----------
bombay                       300
london                       100
rome                         200
surat                        300
-----------------------------------------------------------------------------------------------
(29)
SQL> SELECT *FROM CUSTomer  ORDER BY RATING DESC;

     CNUM CNAME                CITY                    RATING      SNUM
--------- -------------------- -------------------- --------- ---------
     2004 govind               bombay                     300      1002
     2006 champak              surat                      300      1007
     2008 priyank              surat                      300      1004
     2002 gita                 rome                       200      1003
     2003 laxit                surat                      200      1002
     2001 hardik               london                     100      1001
     2007 pratik               rome                       100      1004

7 rows selected.
---------------------------------------------------------------------------------------------------
(30)
SQL> SELECT ODATE,SUM(AMOUNT)FROM ORDER34 GROUP BY ODATE;

ODATE     SUM(AMOUNT)
--------- -----------
10-MAR-99     7846.43
10-APR-99     2811.37
10-MAY-99      6108.7
10-JUN-99     9898.87
------------------------------------------------------------------------------------------------------------
(31)

SQL> select c.cname,s.sname from customer c, salesman s where c.snum=s.snum;

CNAME                SNAME
-------------------- ---------------
hardik               piyush
gita                 miti
laxit                niraj
govind               niraj
champak              laxman
pratik               rajesh
priyank              rajesh

7 rows selected.
----------------------------------------------------------------------------------------------
(32)

SQL> SELECT C.CNAME,S.SNAME,c.city FROM CUSTomer C, SALESMAN S WHERE C.CITY=S.City;

CNAME                SNAME           CITY              
-------------------- --------------- --------
govind               laxman          bombay            
hardik               piyush          london             
hardik               miti            london             
chandu               piyush          londan              
chandu               miti            londan
laxit                niraj           surat              
champak              niraj           surat              

--------------------------------------------------------------------------------------------
(33)

SQL> SELECT O.ONUM,C.CNAME,S.SNAME FROM ORDER34 O,CUSTomer C,SALESMAN S
  2  WHERE O.CNUM=C.CNUM AND O.SNUM=S.SNUM
  3  ;

     ONUM CNAME                SNAME
--------- -------------------- ---------------
     3001 pratik               laxman
     3002 hardik               piyush
     3003 pratik               rajesh
     3004 laxit                niraj
     3005 priyank              laxman
     3006 gita                 miti
     3007 govind               niraj
     3008 champak              piyush
     3009 govind               niraj
     3010 champak              piyush

10 rows selected.
-----------------------------------------------------------------------------------------
(34)

SQL> SELECT O.ONUM,C.CNAME,S.SNAME,s.city,c.city FROM ORDER34 O,CUSTomer C,SALESMAN S WHERE O.CNUM=C
.CNUM AND O.SNUM=S.SNUM AND C.CITY!=S.City;

     ONUM CNAME                SNAME           CITY            CITY
--------- -------------------- --------------- --------------- --------------------
     3001 pratik               laxman          bombay          rome
     3003 pratik               rajesh          baroda          rome
     3005 priyank              laxman          bombay          surat
     3006 gita                 miti            london          rome
     3007 govind               niraj           surat           bombay
     3008 champak              piyush          london          surat
     3009 govind               niraj           surat           bombay
     3010 champak              piyush          london          surat

8 rows selected.

-----------------------------------------------------------------------------------------------
(35)
SQL> select c.* from customer c, salesman s where s.snum=c.snum and c.cnum >12;

     CNUM CNAME                CITY                    RATING      SNUM
--------- -------------------- -------------------- --------- ---------
     2001 hardik               london                     100      1001
     2002 gita                 rome                       200      1003
     2003 laxit                surat                      200      1002
     2004 govind               bombay                     300      1002
     2006 champak              surat                      300      1007
     2007 pratik               rome                       100      1004
     2008 priyank              surat                      300      1004

7 rows selected.
--------------------------------------------------------------------------------------------
36)

-----------------------------------------------------------------------------------------------------------------------------

37)
SQL> select distinct a.cname,b.rating from customer a,customer b where a.rating=b.rating;

CNAME         RATING
---------- ---------
chandu           100
hardik           100
pratik           100
gita             200
laxit            200
champak          300
govind           300

7 rows selected.

Select query, Insert query, Delete Query, update query

SQL> SELECT *FROM SALESMAN WHERE City='LONDON' AND COMmISSION>'10%';

     SNUM SNAME      CITY       COMMIS
--------- ---------- ---------- ------
     1001 PIYUSH     LONDON     12%
     1003 MITI       LONDON     11%

--------------------------------------------------------------------------------------------
8)

SQL> SELECT *FROM CUSTOMER WHERE RATING<=100 AND CITY='ROME';

     CNUM CNAME           CITY               RATING      SNUM
--------- --------------- --------------- --------- ---------
     2007 PRATIK          ROME                  100      1004
--------------------------------------------------------------------------------------------
9)

SQL>  select *from order2 where amount>1000 and not(snum = 1006 and odate='10/mar/99');

     ONUM    AMOUNT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3003    1900.1 10-MAR-99      2007      1004
     3004   5160.45 10-MAR-99      2003      1002
     3005   1098.25 10-APR-99      2008      1007
     3006   1713.12 10-APR-99      2002      1003
     3008      4723 10-MAY-99      2006      1001
--------------------------------------------------------------------------------------------
10)

SQL> SELECT *FROM ORDER34 WHERE ODATE='10/mar/99' OR ODATE='10/apr/99'
  2  OR ODATE='10/jun/99';

     ONUM    AMOUNT ODATE          CNUM      SNUM ITEM_NAME
--------- --------- --------- --------- --------- --------------------
     3001     18.69 10-MAR-99      2007      1007
     3002    767.19 10-MAR-99      2001      1001
     3003    1900.1 10-MAR-99      2007      1004
     3004   5160.45 10-MAR-99      2003      1002
     3005   1098.25 10-APR-99      2008      1007
     3006   1713.12 10-APR-99      2002      1003
     3010   9898.87 10-JUN-99      2006      1001

7 rows selected.
--------------------------------------------------------------------------------------------
11)

SQL> SELECT *FROM CUSTOMER WHERE CNAME LIKE 'C%';

     CNUM CNAME           CITY               RATING      SNUM
--------- --------------- --------------- --------- ---------
     2005 CHAND           LONDON                100      1001
     2006 CHAMPAK         SURAT                 300      1007
--------------------------------------------------------------------------------------------
12)

SQL> SELECT *FROM CUSTOMER WHERE CNAME BETWEEN 'A'AND 'G';

     CNUM CNAME           CITY               RATING      SNUM
--------- --------------- --------------- --------- ---------
     2005 CHAND           LONDON                100      1001
     2006 CHAMPAK         SURAT                 300      1007
--------------------------------------------------------------------------------------------
13)

SQL>  SELECT *FROM ORDER2 WHERE AMOUNT=NULL OR AMOUNT=0;

no rows selected
--------------------------------------------------------------------------------------------
14)

SQL> SELECT SNUM,MAX(AMOUNT) FROM ORDER2 GROUP BY SNUM HAVING SNUM=1002 OR SNUM=1007;

     SNUM MAX(AMOUNT)
--------- -----------
     1002     5160.45
     1007     1098.25
--------------------------------------------------------------------------------------------
15)

SQL> SELECT COUNT(ODATE) FROM ORDER2 WHERE ODATE='10/MAR/99';

COUNT(ODATE)
------------
           4
--------------------------------------------------------------------------------------------
16)

SQL> SELECT SUM(AMOUNT) FROM ORDER2;

SUM(AMOUNT)
-----------
   15456.55
--------------------------------------------------------------------------------------------
17)

SQL> SELECT AVG(AMOUNT) FROM ORDER2;

AVG(AMOUNT)
-----------
  1932.0688
--------------------------------------------------------------------------------------------
18)

SQL> select count(distinct snum) from order2;

COUNT(DISTINCTSNUM)
-------------------
                  5
--------------------------------------------------------------------------------------------
19)

SQL>  SELECT ODATE,MAX(AMOUNT) FROM ORDER2 GROUP BY ODATE;

ODATE     MAX(AMOUNT)
--------- -----------
10-MAR-99     5160.45
10-APR-99     1713.12
10-MAY-99        4723
--------------------------------------------------------------------------------------------
20)

SQL> SELECT ODATE,MAX(AMOUNT) FROM ORDER2 GROUP BY ODATE HAVING ODATE='10/MAR/99';

ODATE     MAX(AMOUNT)
--------- -----------
10-MAR-99     5160.45
--------------------------------------------------------------------------------------------
21)

SQL> SELECT COUNT(CITY) FROM CUSTOMER WHERE CITY=NULL;

COUNT(CITY)
-----------
          0
--------------------------------------------------------------------------------------------
22)

SQL> SELECT CNUM,MIN(AMOUNT) FROM ORDER2 GROUP BY CNUM;

     CNUM MIN(AMOUNT)
--------- -----------
     2001      767.19
     2002     1713.12
     2003     5160.45
     2004       75.75
     2006        4723
     2007      1900.1
     2008       18.69

7 rows selected.
--------------------------------------------------------------------------------------------
23)

SQL> SELECT * FROM CUSTOMER WHERE CNAME LIKE 'G%' ORDER BY CNAME;

     CNUM CNAME           CITY               RATING      SNUM
--------- --------------- --------------- --------- ---------
     2002 GITA            ROME                  200      1003
     2004 GOVIND          BOMBAY                300      1002
--------------------------------------------------------------------------------------------
24)

SQL> SELECT COUNT(SNUM) FROM ORDER2 GROUP BY odate;

COUNT(SNUM)
-----------
          4
          2
          2
--------------------------------------------------------------------------------------------
25)

SQL> select snum, commission from salesman;

     SNUM COMMISSION
--------- ----------
     1001         12
     1002         13
     1003         11
     1004         15
     1005         10
     1006         10
     1007          9

7 rows selected.

Simple PL Sql Query Example , Select query, Insert query, Delete Query, update query

SQL> select * from salesman;

     SNUM SNAME      CITY       COMMIS
--------- ---------- ---------- ------
     1001 PIYUSH     LONDON     12%
     1002 NIRAJ      SURAT      13%
     1003 MITI       LONDON     11%
     1004 RAJESH     BARODA     15%
     1005 ANAND      NEW DELHI  10%
     1006 RAM        PATAN      10%
     1007 LAXMAN     BOMBAY     09%

7 rows selected.
--------------------------------------------------------------------------------------------
SQL> select * from customer;

     CNUM CNAME      CITY          RATING      SNUM
--------- ---------- ---------- --------- ---------
     2001 hardik     london           100      1001
     2002 gita       rome             200      1003
     2003 laxit      surat            200      1002
     2004 govind     bombay           300      1002
     2005 chandu     london           100      1001
     2006 champak    surat            300      1007
     2007 pratik     rome             100      1004

7 rows selected.
----------------------------------------------------------------------------------------------
SQL> select * from aorder;

     ONUM    AMOUNT ODATE          CNUM      SNUM
--------- --------- --------- --------- ---------
     3001     18.69 10-MAR-99      2007      1007
     3002    767.19 10-MAR-99      2001      1001
     3003    1900.1 10-MAR-99      2007      1004
     3004   5160.45 10-MAR-99      2003      1002
     3005   1098.25 10-APR-99      2007      1007
     3006   1713.12 10-APR-99      2002      1003
     3007     75.75 10-MAY-99      2004      1002
     3008      4723 10-MAY-99      2006      1001
     3009   1309.95 10-MAY-99      2004      1002
     3010   9898.87 10-JUN-99      2006      1001

---------------------------------------------------------------------------------------------

 (1)

sQL> select onum, amount,odate from aorder;

     ONUM    AMOUNT ODATE
--------- --------- ---------
     3001     18.69 10-MAR-99
     3002    767.19 10-MAR-99
     3003    1900.1 10-MAR-99
     3004   5160.45 10-MAR-99
     3005   1098.25 10-APR-99
     3006   1713.12 10-APR-99
     3007     75.75 10-MAY-99
     3008      4723 10-MAY-99
     3009   1309.95 10-MAY-99
     3010   9898.87 10-JUN-99

10 rows selected.
--------------------------------------------------------------------------------------------
(2)

SQL> select * from customer where snum=1001;

     CNUM CNAME      CITY          RATING      SNUM
--------- ---------- ---------- --------- ---------
     2001 hardik     london           100      1001
     2005 chandu     london           100      1001
--------------------------------------------------------------------------------------------

(3)

SQL> select city,sname,snum ,commission from salesman;

CITY       SNAME           SNUM COMMIS
---------- ---------- --------- ------
LONDON     PIYUSH          1001 12%
SURAT      NIRAJ           1002 13%
LONDON     MITI            1003 11%
BARODA     RAJESH          1004 15%
NEW DELHI  ANAND           1005 10%
PATAN      RAM             1006 10%
BOMBAY     LAXMAN          1007 09%

7 rows selected.
--------------------------------------------------------------------------------------------
(4)

SQL> SELECT RATING,CNAME FROM customer where city='surat';

   RATING CNAME
--------- ----------
      200 laxit
      300 champak
--------------------------------------------------------------------------------------------
(5)

SQL> select distinct snum from aorder;

     SNUM
---------
     1001
     1002
     1003
     1004
     1007
---------------------------------------------------------------------------------------------
(6)

SQL> select *from aorder where amount>1000;

     ONUM    AMOUNT ODATE          CNUM      SNUM
     --------- --------- --------- --------- ---------
     3003    1900.1 10-MAR-99      2007      1004
     3004   5160.45 10-MAR-99      2003      1002
     3005   1098.25 10-APR-99      2007      1007
     3006   1713.12 10-APR-99      2002      1003
     3008      4723 10-MAY-99      2006      1001
     3009   1309.95 10-MAY-99      2004      1002
     3010   9898.87 10-JUN-99      2006      1001

7 rows selected.

Thursday, September 16, 2010

Writing Your Own GPS Applications

Introduction

What is it that GPS applications need to be good enough to use in a commercial environment, such as in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application that works with a majority of GPS devices in the industry today.


One Powerful Sentence

This first part in the series will explore the task of interpreting raw GPS data. Fortunately, the task is simplified thanks to the National Marine Electronics Association which introduced a standard for the industry, now in use by a vast majority of GPS devices. To give developers a head start, I chose to use some Visual Studio .NET source code from my "GPS.NET Global Positioning SDK" component. (The code is stripped of features like multithreading and error handling for brevity.)
NMEA data is sent as comma-delimited "sentences" which contain information based on the first word of the sentence. There are over fifty kinds of sentences, yet an interpreter really only needs to handle a few to get the job done. The most common NMEA sentence of all is the "Recommended Minimum" sentence, which begins with "$GPRMC". Here is an example:
$GPRMC,040302.663,A,3939.7,N,10506.6,W,0.27,358.86,200804,,*1A
This one sentence contains nearly everything a GPS application needs: latitude, longitude, speed, bearing, satellite-derived time, fix status and magnetic variation.


View post :  http://www.c-sharpcorner.com/UploadFile/jperson2000/gps_net08152008190750PM/gps_net.aspx

Wednesday, September 15, 2010

Maintain Scroll Position after Asynchronous Postback

<script type="text/javascript">
    var xPos, yPos;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);
    function BeginRequestHandler(sender, args) {
        xPos = $get('scrollDiv').scrollLeft;
        yPos = $get('scrollDiv').scrollTop;
    }
    function EndRequestHandler(sender, args) {
        $get('scrollDiv').scrollLeft = xPos;
        $get('scrollDiv').scrollTop = yPos;
    }
</script>

Tuesday, September 14, 2010

Export to Excel in ASP.Net 2.0 – Gridview to Excel, DataTable to Excel

Exporting contents to excel or preparing a excel report of the data displayed on a webpage is one of the most common tasks in real world web applications. Most frequently, we will export the contents of GridView control to excel. In this article, i will implement some of the common ways of exporting a table of data displayed on a web page to a excel file.

Export to Excel
Ø       Rendering the Gridview Control to Excel
Ø       Rendering the underlying DataTable to Excel

Rendering the Gridview Control to Excel
This is one of the most commonly done approach where we set MIME type and use Gridview’s RenderControl() method, similar to we do for a Datagrid control.
        string attachment = "attachment; filename=Employee.xls";
        Response.ClearContent();
        Response.AddHeader("content-disposition", attachment);
        Response.ContentType = "application/ms-excel";
        StringWriter stw = new StringWriter();
        HtmlTextWriter htextw = new HtmlTextWriter(stw);
        gvEmployee.RenderControl(htextw);
        Response.Write(stw.ToString());
        Response.End();

When we execute the above code, it will give the following error.


view more : http://www.codedigest.com/Articles/ASPNET/130_Export_to_Excel_in_ASPNet_20_%E2%80%93Gridview_to_Excel_DataTable_to_Excel.aspx

Monday, September 13, 2010

Streaming Media Using Silverlight

Integrating Multimedia

One of the primary marketing hooks for Silverlight is its ability to stream media over the Web. Silverlight is able to do so using an embedded media player so that the client system does not need to have a player installed. This is a different approach from other media technologies. Most media technologies require that the client has a particular media player installed. With Silverlight, once the Silverlight plug-in is installed all Silverlight features are accessible, including media playback.
In an earlier module, we reviewed how to integrate multimedia into an ASP.NET AJAX application through the use of the ASP.NET Futures asp:Media control. The asp:Media control is an implementation of the Silverlight <MediaElement> element. 

http://www.learn-silverlight-tutorial.com/StreamingMediaUsingSilverlight.cfm

Audio and Video in Silverlight pages