Powered By Blogger

Friday 23 March 2012

Multi table Insert



MULTIBLE INSERTS

We have table called DEPT with the following columns and data

DEPTNO         DNAME           LOC
--------            --------            ----
10                    accounting    new york
20                    research        dallas
30                    sales               Chicago
40                    operations    boston

a) CREATE STUDENT TABLE

     SQL> Create table student(no number(2),name varchar(2),marks number(3));

b) MULTI INSERT WITH ALL FIELDS

     SQL> Insert all
             Into student values(1,’a’,100)
             Into student values(2,’b’,200)
             Into student values(3,’c’,300)
             Select *from dept where deptno=10;

     -- This inserts 3 rows

c) MULTI INSERT WITH SPECIFIED FIELDS

     SQL> insert all
             Into student (no,name) values(4,’d’)
             Into student(name,marks) values(’e’,400)
             Into student values(3,’c’,300)
             Select *from dept where deptno=10;

     -- This inserts 3 rows

d) MULTI INSERT WITH DUPLICATE ROWS

     SQL> insert all
             Into student values(1,’a’,100)
             Into student values(2,’b’,200)
             Into student values(3,’c’,300)
             Select *from dept where deptno > 10;

     -- This inserts 9 rows because in the select statement retrieves 3 records (3 inserts for each   
        row retrieved)

e) MULTI INSERT WITH CONDITIONS BASED

     SQL> Insert all
             When deptno > 10 then
             Into student1 values(1,’a’,100)
             When dname = ‘SALES’ then
             Into student2 values(2,’b’,200)
             When loc = ‘NEW YORK’ then
             Into student3 values(3,’c’,300)
             Select *from dept where deptno>10;

     -- This  inserts 4 rows because the first condition satisfied 3 times, second condition 
         satisfied once and the last none.

f) MULTI INSERT WITH CONDITIONS BASED AND ELSE

    SQL> Insert all
            When deptno > 100 then
            Into student1 values(1,’a’,100)
            When dname = ‘S’ then
            Into student2 values(2,’b’,200)
            When loc = ‘NEW YORK’ then
            Into student3 values(3,’c’,300)
            Else
            Into student values(4,’d’,400)
            Select *from dept where deptno>10;

     -- This inserts 3 records because the else satisfied 3 times

g) MULTI INSERT WITH CONDITIONS BASED AND FIRST

     SQL> Insert first
             When deptno = 20 then
             Into student1 values(1,’a’,100)
             When dname = ‘RESEARCH’ then
             Into student2 values(2,’b’,200)
             When loc = ‘NEW YORK’ then
             Into student3 values(3,’c’,300)
             Select *from dept where deptno=20;
    
     -- This inserts 1 record because the first clause avoid to check the remaining conditions   
         once the condition is satisfied.

h) MULTI INSERT WITH CONDITIONS BASED, FIRST AND ELSE

     SQL> Insert first
             When deptno = 30 then
              Into student1 values(1,’a’,100)
              When dname = ‘R’ then
              Into student2 values(2,’b’,200)
              When loc = ‘NEW YORK’ then
              Into student3 values(3,’c’,300)
              Else
              Into student values(4,’d’,400)
              Select *from dept where deptno=20;

     -- This inserts 1 record because the else clause satisfied once




i) MULTI INSERT WITH MULTIBLE TABLES

    SQL> Insert all
            Into student1 values(1,’a’,100)
            Into student2 values(2,’b’,200)
            Into student3 values(3,’c’,300)
            Select *from dept where deptno=10;

    -- This inserts 3 rows

    ** You can use multi tables with specified fields, with duplicate rows, with conditions, with 
          first and else clauses.

Merge clause



MERGE

You can use merge command to perform insert and update in a single command.

Ex:

SQL> Merge into student1 s1
        Using (select *From student2) s2
        On(s1.no=s2.no)
        When matched then
        Update set marks = s2.marks
        When not matched then
        Insert (s1.no,s1.name,s1.marks)
        Values(s2.no,s2.name,s2.marks);

In the above the two tables are with the same structure but we can merge different structured    
tables also but the datatype of the columns should match.

Assume that student1 has columns like no,name,marks and student2 has columns like no,      
name, hno, city.

SQL> Merge into student1 s1
        Using (select *From student2) s2
        On(s1.no=s2.no)
        When matched then
        Update set marks = s2.hno
        When not matched then
        Insert (s1.no,s1.name,s1.marks)
        Values(s2.no,s2.name,s2.hno);

Query Village


Sunday 18 March 2012

INTRODUCE YOUR SELF IN Interview




Your self-introduction in an interview is an extremely important part of the entire time, especially if the job will be in IT, management or sales.

You typically have about 20 or 30 seconds to introduce yourself. We call this 'the elevator speech'.

Eye contact is very important. You should engage, make eye contact, but not stare down or threaten the other person. The handshake is important, somewhat firm but not crushing. Posture is important. Remaining somewhat close, leaning slightly forward if distances permit head up, shoulders balanced.

  @ You should clearly say your name.
  @ What you do
  @ What you would like to do
  @ Something that shows you know something about the business
  @ How you think you can help the person on the other side of the desk.

'My name is Surya Prakash Singh and I am an experienced In Software department. I know that you have an opening here in your Organization. I have worked on several successful IT company and have had some great results in improving positioning. I know that I could step into this role and show you some progress from day one. Could I tell you more about what I have done?'

The elevator speech needs to be practiced and ready. You should be able to modify for circumstances. It should elicit interest in your portfolio, recommendations, CV or resume. It should not conflict with anything in your cover letter, application, or resume. It should not sound 'canned'; you have to be alive.

Some people suggest a point of humor or something more personal. Others suggest really emphasizing past success or business knowledge. You have to adapt the speech to your industry ... you can't make the same speech when interviewing for a counter job at Starbucks as you would be regional marketing manager for Ford.

----

good afternoon to every bobby. I am Surya Singh IT engineer i have finished my be degree in RSMT college of engg and tech in Varanasi, i had done my hsc in mmhss in Varanasi  my father name K.N Singh  he is working in DLW, my mother name is Gayatri singh she is house keeper
1)Good Morning all/ Sir/mam, My name is Ashwini Desai, I have born and bought up in Belgaum.

2)I completed my MBA from IMER bgm, graduation from Lingraj college BGM, completed my intermideate from KLE'S Lingraj college and Matriculation from Vanita vidyalaya high school Bgm .

3)I am good thinker and quick learner, I am an Optimistic person, have an ability to complete the assignment in the given interval of time, can work for longer hours without any break.

4)I like playing chess, listening to the music and reading to novels.

5) And my family consists of Father , mother and me, Father is an Govt employee, and mother is house maid.

And THATS ALL ABOUT ME.
oh...well that would depend on what job your going for. but usually you would start with your name and why your there. i hope ive answered your question well.




Well iam ...............
basically i hail from ...........
i was born /n /bought up from .....
i hold my bachlors/masters in........
i am the....... (studnt or employee fill in blank)
prior to that i did my intermediate from........
and i did my s.s.c from.......
i am persuing my ...............

ABOUT MY FAMILY BACKROUND

My father Mr..............
He is a..........
My mother she is a........
I have ... sublings.
I have 2 brother n 2 sister.

I WOULD LIKE TO TELL U MY STRENGTH.

I am result oridented
i am dedicated.
i am optimist.

I WOULD ALSO LIKE TO TELL U ABOUT MY HOBBIES

I play cricket snnoker
I listen to music.
........
........

My short term goal is ...............(ex= to complete my
communication skill class with confident)

my long term goal is..........(ex= To work for reliance or
i want to do ms mba or mtec from ....)

My favorite palce is ............(ex= hyderabad, dubai,or
london.)

and then at the end..
Thank u sir for giving me a wonderful opportunity to
introduce my self thank you


1.greeting like goodmorning/aftn/evng
2.iam ------------- (ur name)
3.ur age
4.present residng address
5.ur family back ground dnt describe ur brother n sister
only describe ur father and ur mother
6.ur qualification
7.technical qualification
8.hobbies
9.workexperience
10.u have to tell finally this sentence"THATS ALL ABOUT ME"


1)Good Morning all/ Sir/mam,
My name is R.Sandeep Kumar, I have born and bought up in
Hyderabad.

2)I am graduate from Pragathi mahavidayala, completed my
intermideate from Ideal junior college and Matriculation
from Hyderbad sainik school.

3)I am good thinker and quick learner, I am an Optimistic
person, flexible to work in any shift, have an ability to
complete the assignment in the given interval of time, can
work for longer hours without any break.

4)I like playing cricket, listening to the music and hang
out for parties in the lesuire time.

5)I have work experience more than 2 years. right now i am
working with TATA Businees support services since sept 9th
2007. as a Technical agent for an ISP process where resolve
the issues of the customer on the call by providing the T-
shooting steps.

6) And my family consists of Father , mother and me, FAther
is an Govt employee who is TC in south central railway, and
mother is house maid.

And THATS ALL ABOUT ME