‘Teacher’ is a table in a database. Based on that information, explain what the following query is searching for in the table: Teacher.find(:all, :condition => { :grade => 9..12}) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Teacher.find(:all, :condition => { :grade => 9..12})This means getting all records from teacher table teachers where column grade has value between 9 & 12. select * from teachers where grade between 9 and 12 Sijo -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank You Sijo On Jun 5, 1:27 pm, Sijo k g <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > Teacher.find(:all, :condition => { :grade => 9..12}) > > This means getting all records from teacher table teachers where > column grade has value between 9 & 12. > > select * from teachers where grade between 9 and 12 > > Sijo > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
It would be a better practice to include all column names in the Select instead of * On Sat, Jun 5, 2010 at 3:29 PM, Srinivas Golyalla <golyalla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Thank You Sijo > > On Jun 5, 1:27 pm, Sijo k g <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Teacher.find(:all, :condition => { :grade => 9..12}) > > > > This means getting all records from teacher table teachers where > > column grade has value between 9 & 12. > > > > select * from teachers where grade between 9 and 12 > > > > Sijo > > > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Sanjay Sarachandrakumaran Follow me http://www.twitter.com/ssarachandra http://www.facebook.com/ssarachandra -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Srinivas Golyalla wrote:> �Teacher� is a table in a database. Based on that information, > explain what the following query is searching for in the table: > Teacher.find(:all, :condition => { :grade => 9..12})Do your own homework. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Srinivas Golyalla wrote:> �Teacher� is a table in a database. Based on that information, > explain what the following query is searching for in the table: > Teacher.find(:all, :condition => { :grade => 9..12})this query returns an uneducated student named srinivas -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ar Chron wrote:> Srinivas Golyalla wrote: >> �Teacher� is a table in a database. Based on that information, >> explain what the following query is searching for in the table: >> Teacher.find(:all, :condition => { :grade => 9..12}) > > this query returns an uneducated student named srinivasWell said! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.