Author writes as…."eg of For example, if we want to find the name of the course Admin of the course “Oracle”, then the following subquery will be used:-
select Firstname+' '+Lastname from student where studentid in (select courseadminid from course where coursename ='Oracle') "
But i say in the above query he is retrieving the name of the student first name + last name and not the coureadmin name.
100's of ppl will browse and try to learn something new. So please before posting something on ur blogs pls correct it, veryify it.As already someone pointed out ur insert statement too. What if a newbie trying to learn something out of this blog. Please Ensure before posting anything.
Hi Anonymous, First of all thanks for visiting my blog and spent time in writing the comments as comments motivate me to do more better. Second if you read my article carefully u got to know that, in my article, I store the course admin details also in the student table. So by the query which u mention as select Firstname+' '+Lastname from student where studentid in (select courseadminid from course where coursename ='Oracle') gives me the name of the COURSE ADMIN NOT ANY STUDENT. if you run that query and article carefully u will know that very well.
So next time read blog carefully before writing such comments. Keep visiting my blog.:-)
Hi Anonymous again, Yes, you are right hundreds of people visits my blogs daily and give me valuable comments which motivate me to improve my articles quality better. So before giving wrong comments, reading the articles carefully on not just on my blog but on any blog as UR WRONG COMMENTS WILL GOING TO CONFUSE THE OTHER READERS sO Please Ensure before posting ANY COMMENTS THAT YOU READ THE FULL ARTICLES .
Keep visiting my blog and giving me your valuable comments.
hi thanks for responding You still did not catch my point… your firstname + lastname gives you the name same as courseadminname but the value is from the studenttable not from the courseadmindetails.. since both are same u are thinking that it is courseadmin name… your courseadmin table is only in your condition and u r not retrieving anything from. please check once again. if possible remove the firstrow in the courseadmindetails and check
Hi Sumeet, Many thanks for your post. This article is written for SQL Server and in SQL Server, this code work fine.:-). However ur suggestion is good, from now on wards, I will try to mention the alternate command for Oracle too.:-)
After completing so many certifications if your explanation stuff is so weak like you have provided. I doubt your dedication to the technology & authentication of the certification candidate. Very poor it shows improper professional development with years of experience
Thanks Anonymous for your comments as its motivate me to improve my article quality. But it is better if you give comments based on my articles not on my certificates as it like that you are more concern about my certificate than my article. Also some time it is hard to understand why people hide their identity while criticizing someone as sometimes it put a question mark on the person intention.
Hello Vivek, juz wondering if the below query can be alternate query for correlated query example. select A.Coursename , B.Firstname+' '+B.Lastname as CourseAdminName from A.course AND B.STUDENT where b.studentid=a.courseadminid
In one Of Interview I hve been asked , What is Co-related Query and how it works internally in oracle. Also it has been extended wht is diffrenece between co related query and temp table in SQL query.
Hello Sir, you have explained the above aricle very well. Based on the above article I want to ask you that, I want to create a query in which I am comparing a field in two different tables and I want to get the record from the table which is having the higher value after that earlier comparision. I am not able to do this. Waiting for your response.
Does this come under nested query?? SELECT Name FROM AdventureWorks2008R2.Production.Product WHERE ListPrice = (SELECT ListPrice FROM AdventureWorks2008R2.Production.Product WHERE Name = 'Chainring Bolts' );
Good one Bro.. U made it simple to understand
Keep Going
-Winkey
Author writes as…."eg of For example, if we want to find the name of the course Admin of the course “Oracle”, then the following subquery will be used:-
select Firstname+' '+Lastname from student where studentid in (select courseadminid from course where coursename ='Oracle')
"
But i say in the above query he is retrieving the name of the student first name + last name and not the coureadmin name.
100's of ppl will browse and try to learn something new. So please before posting something on ur blogs pls correct it, veryify it.As already someone pointed out ur insert statement too. What if a newbie trying to learn something out of this blog. Please Ensure before posting anything.
Hi Anonymous,
First of all thanks for visiting my blog and spent time in writing the comments as comments motivate me to do more better. Second if you read my article carefully u got to know that, in my article, I store the course admin details also in the student table. So by the query which u mention as
select Firstname+' '+Lastname from student where studentid in (select courseadminid from course where coursename ='Oracle')
gives me the name of the COURSE ADMIN NOT ANY STUDENT. if you run that query and article carefully u will know that very well.
So next time read blog carefully before writing such comments.
Keep visiting my blog.:-)
Hi Anonymous again,
Yes, you are right hundreds of people visits my blogs daily and give me valuable comments which motivate me to improve my articles quality better. So before giving wrong comments, reading the articles carefully on not just on my blog but on any blog as UR WRONG COMMENTS WILL GOING TO CONFUSE THE OTHER READERS
sO Please Ensure before posting ANY COMMENTS THAT YOU READ THE FULL ARTICLES .
Keep visiting my blog and giving me your valuable comments.
hi thanks for responding
You still did not catch my point… your firstname + lastname gives you the name same as courseadminname but the value is from the studenttable not from the courseadmindetails.. since both are same u are thinking that it is courseadmin name… your courseadmin table is only in your condition and u r not retrieving anything from. please check once again. if possible remove the firstrow in the courseadmindetails and check
Thanks Winkey
Thanks mate
hey thanks it was helpful. if u could add certain exapmles for al kind of joins,it would b great…!!
thanks and cheers…!!
Thanks for your response. You can find joins with example on one of my article "Sql Joins- Inner Joins, Self Joins, Outer Joins, Cross Joins"
http://vivekjohari.blogspot.com/2010/01/sql-joins-inner-joins-self-joins-outer.html
well done dude ..its easy to understand ……..
Thanks Ajeet for your response…:-)
Really a good article.
Thanks Puja for your valuable comments 🙂
well donee tute
superb sir.The explanation is very easy to understand.
Thanks:-)
Hi Sir,
Could you explain me what is generally top n query in oracle.
Select e1.emp_id from emp e1 where 2 = ( select count(distinct e2.emp_id) from emp_1 e2 where e1.emp_id = e2.emp_id);
what does here 2 = stands for, i tried with few examples.When 1= given instead of 2 answer changes..could you please explain me..
Hi
Thanks for your valuable comments.
Can you please gives more details of your problem as it will help me in explaining.
thank you sir for the wonderful and easy examples. It was very well explained. Thank you once again.
Thanks 🙂
nice explanation. Thanks
Thanks 🙂
Hey Vivek…. Please correct you Insert query.. 🙁
this your table structure.
create table Student (Studentid int identity(1,1), Firstname nvarchar(200), Lastname nvarchar(200),Email nvarchar(100))
And this your insert query..
insert into Student values ('Atul','Bajaj', 'atul@abc.com' )
IF you insert like that … Oracle through the error. bcoz you try to insert the varchar value in INT variable. That not right..
your insert query should like that..
INSERT INTO Student
(Firstname, Lastname,Email)
VALUES
('Atul','Bajaj', 'atul@abc.com');
In that case Oracle insert the value in exact column. 🙂
Hi Sumeet,
Many thanks for your post. This article is written for SQL Server and in SQL Server, this code work fine.:-). However ur suggestion is good, from now on wards, I will try to mention the alternate command for Oracle too.:-)
Thanks…….,the examples has gave me a clear idea..
Thanks Reddy for your valuable comments…..
nice explanation..
Thanks..:-)
nice
Thanks Sudharshan….:-)
could plz explain about indexed views
Thanks Vivek for making it so simple to understand
Thanks Siddharth for your valuable comments
nice and goood
kindly put datawarehousing questions and answers and put sql quiz and puzzles it will look more precious to see for SQL lovers
Hi Ashok,
Thanks for your invaluable comments. I will looking forward to add more sql tips puzzles and Example in near future.
Thanking you. am also expect more SQL test quiz from your side……..thankxxxxxxxxxx
now i understand wt actualy d difference izzz…………. thnkzzz
Its Perfect…:)
simply superb… gr8 article.
how do i improve my sql skills? any thoughts ? thanks.
Nice post very helpful
dbakings
It could have been more elaborate. This just a very basic type of explaination. Examples also are not upto the standard.
After completing so many certifications if your explanation stuff is so weak like you have provided. I doubt your dedication to the technology & authentication of the certification candidate. Very poor it shows improper professional development with years of experience
Thanks Anonymous for your comments as its motivate me to improve my article quality. But it is better if you give comments based on my articles not on my certificates as it like that you are more concern about my certificate than my article.
Also some time it is hard to understand why people hide their identity while criticizing someone as sometimes it put a question mark on the person intention.
Thanks again
Vivek
Very useful Vivek ji…. Helped me a lot…..
Hello Vivek, juz wondering if the below query can be alternate query for correlated query example.
select A.Coursename , B.Firstname+' '+B.Lastname as CourseAdminName from A.course AND B.STUDENT where b.studentid=a.courseadminid
Ajay.
Good One Vivek..
GOOD Atricle , Thanks for your effort.
Thanks for your Valuable comments
In one Of Interview I hve been asked , What is Co-related Query and how it works internally in oracle.
Also it has been extended wht is diffrenece between co related query and temp table in SQL query.
an excellent example and I really cleared my doubts very clearly…Keep it Guru..
Easily understandable, very good article
Hello Sir, you have explained the above aricle very well. Based on the above article I want to ask you that, I want to create a query in which I am comparing a field in two different tables and I want to get the record from the table which is having the higher value after that earlier comparision. I am not able to do this. Waiting for your response.
You made it very simple…
Thanks..
Hey , Can you please tell me what is difference between sub-query and inline view?
Nice explanations..
Thanks
Does this come under nested query??
SELECT Name
FROM AdventureWorks2008R2.Production.Product
WHERE ListPrice =
(SELECT ListPrice
FROM AdventureWorks2008R2.Production.Product
WHERE Name = 'Chainring Bolts' );