Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> SQL Queries Plz execute the query and send the results

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: SQL Queries Plz execute the query and send the results
 jeeva  Posted: Oct 31, 2007 04:26:31 AM

 Total Post: 11
 Joined: Oct, 2007






 create table table1(A number(5),B number(5));
insert into table1(A,B) values(3,7);
insert into table1(A,B) values(1,5);
insert into table1(A,B) values(null,4);
insert into table1(A,B) values(2,6);


1> select * from table1 orderby null;
2> select "*" from table1;
3> select a,count(a) from table1 groupby(a);
4> select 'a'+'b' from table1;
5> select "a"+"b" from table1;
6> select sum(0) from table1;
7> select sum(1) from table1;
8> select sum(null) from table1;
9> select all rows from the table1 using "join" clause
10> select 'b' 'a','a' 'b' from table1 orderby 1;
11> select sum(a+b) from table1;
12> select avg(0) from table1;

i don't have computer to run these queries
Plz execute these queries and send the results

 Bala
Posted: Oct 31, 2007 04:56:55 PM  

 Total Post: 3
 Joined: Oct, 2007






 
See the answers below:

select * from table1 order by null;
A,B
1,5
,4
2,6
3,7

select "*" from table1;
== ORA-00904: "*": invalid identifier

select a,count(a) from table1 group by(a);
A,COUNT(A)
1,1
2,1
3,1
,0

select 'a'+'b' from table1;
== ORA-01722: invalid number

select "a"+"b" from table1;
== ORA-00904: "b": invalid identifier

select sum(0) from table1;
== 0

select sum(1) from table1;
== 4

select sum(null) from table1;
== NULL

select all rows from the table1 using "join" clause
== ORA-00936: missing expression

select 'b' 'a','a' 'b' from table1 orderby 1;
== ORA-00923: FROM keyword not found where expected

select sum(a+b) from table1;
== 24

select avg(0) from table1;
== 0

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software