Any Robots know SQL?
I would gift you a steam game for your trouble?
>>26672067
I did some in uni last year I could probably bullshit some for you
>>26672139
Steam?
No cyboring pls.
I've been doing it for awhile. What do you want to do?
if you can get me a gf ill do it
I'm a professional developer, have done SQL for years. Sup?
(don't want any games, v0v)
>>26672516
Alright it's HW questions but I'm trying to find the highest scored Harry Potter Movie by Critics in a data base.
[code]Select Title,CRITICS_SCORE
from Movie
Where left(Title,12) = 'Harry Potter' =(
Where CRITICS_SCORE = SELECT MAX(CRITICS_SCORE)
FROM Movie
);
[/code]
Obviously I get an error but my thought process was I check to the Max critic scores and than see if the movie is a harry potter film.
I CAN'T USE LIMIT 1 in my example and trying to avoid using TOP 1.
earlier code I had that works but it shows every move with the same critics_score as The deathly hollows.
[code]
select Title, CRITICS_SCORE
from Movie
Where CRITICS_SCORE = (SELECT MAX(CRITICS_SCORE)
FROM Movie
Where Title like 'Harry Potter%'
);
[/code]
>>26672902
Can't just use:
SELECT Title, MAX(CRITICS_SCORE) AS MAX_CRITICS_SCORE FROM Movie WHERE Title LIKE 'Harry Potter%'
? If there's multiple HP movies with the same (highest) critics score then there'll be >1 row returned, but I assume that's okay if you can't use LIMIT 1.
>>26673092
Yeah but the results should a table with one row.
The database is basically from RT.com and a HW assignment had us convert it into a SQL database and this assignment is having you do different queries on it.
>>26673161
Understood.
Have you learned about GROUP BY yet? I suppose that would be one way to do it. If CRITICS_SCORE is all the same values (i.e. your MAX) there'll just be one row returned when you use GROUP BY.
SELECT Title, CRITICS_SCORE
FROM Movie
WHERE Title LIKE 'Harry Potter%'
AND CRITICS_SCORE = (
SELECT MAX(CRITICS_SCORE) FROM Movie WHERE Title LIKE 'Harry Potter%'
)
GROUP BY CRITICS_SCORE;
I modified your second query a bit (not much though, just added the second WHERE TITLE). It seems to work fine on some test data.
If you can't use LIMIT, I can't see any other obvious ways to do it (other than possibly with joins)
>>26673346
Thanks alot Anon.
Got 3 Queries left to write, gonna take a break and tackle them. Hopefully I get this done by 12:00PM EST.