1

Hi there guys basically I have a query asking me to do this...

What is the lowest rated review in the database? List the review title, date of post, author username, category name, and rating.

I've written this..

SELECT * from reviews where rating like '%1%'

Is that right? As in it's not showing anything but I am unsure why. Please excuse me as I'm trying to learn to SQL

My reviews table..

http://gyazo.com/e48a0be08782af79b4fbf0fec5481eba

THANKS!!

Taryn
  • 242,637
  • 56
  • 362
  • 405
Ellie
  • 27
  • 4

3 Answers3

3
SELECT * from reviews where rating = (SELECT  MIN(rating) from reviews )
Domain
  • 11,562
  • 3
  • 23
  • 44
2

SELECT * from reviews where rating = (select min(rating ) from reviews )

here you go !!!

Dhiraj Wakchaure
  • 2,596
  • 6
  • 21
  • 37
  • ddw147 Thanks a lot and to everyone who answers :)! Can't pick an answer yet have to wait a couple of minutes! – Ellie Aug 04 '14 at 05:39
1

Below query also provides similar results.

SELECT * FROM REVIEWS 
ORDER BY RATING 
LIMIT 1
ngrashia
  • 9,869
  • 5
  • 43
  • 58