Wednesday, 31 December 2014

Pl/sql program to find factorial of given number

Program:
     
       Declare
       n number(4);
       f  number(4):=1;
       begin n:=&n;
       for i to 1...n
       loop
       f:=f*i;
       end loop;
       days output.put_line('the fact of a given no'='¦¦f) ;
       end;
       /
   
     How to create a website
Click http://lapcode.blogspot.com

Thursday, 18 December 2014

How to create a table using primary key?

Create table:

        create table client_master(client_no varchar2(6),name varchar2(20) not null,address1 varchar2(30) not null,address2 varchar2(30) not null,city varchar2(15) not null,pincode number(8) not null, state varchar2(15) not null,bal_due number(10,2),primary key(client_no), CHECK(client_no like 'c%'));


Saturday, 6 December 2014

Sql queries for create table and insert elements into table and display table

Create:

        Queries 

        SQL query 

           Create table smobile1(emino varchar2(20),name varchar2(20) not null,os varchar2(10) not null,ram varchar2 (20) not null,I memory varchar2(20) not null,coast number(30),primary key (emino) , CHECK (emino like 'e%'));

Table created.

Insert:


    Queries

             insert into smobile1 values('emi435','gs5','android','1gb','4gb',40000);

             insert into smobile1 values ('emi435','gs5','android','1gb','16gb',40000);

             insert into smobile1 values
                    ('emi436','gs4','android','4gb','16gb',40000);

             insert into smobile1 values
                    ('emi5431','gs4','android','2gb','16gb',30000);
         
             insert into smobile1 values
                   ('emi541','gs4','android','android','2gb','16gb',3000);
........,.......
..........

Display:

     Query

          Select *from smobile;




How to create a website
Click www.lapcode.blogspot.com
      http://www.YouTube.com/OurLifeStyle