Question

MySQL Query Language Please help!

For PHLogger users who are interested in the “alcoholism” topic and have “wasted” thoughts about that topic, list their ids, their names, and the start time of their most recent event. A thought is defined as being “wasted” if its text contains the term “wasted”, and an event is considered to be “recent” based on its start time. Note that publishing thoughts into an interest group doesn’t mean a user is interested in this group. A user has to become a member of a certain interest group to be able to receive the information he/she is interested in. Order your results by user id.

Here are the attributes:
tnum number observation_id PHLG obs observationid PHLogger address street address_state diastolic number tnum number User man

0 0
Add a comment Improve this question Transcribed image text
Answer #1

select User.phlid as Id, PHLogger.name as Name, max(Event.start)
from User, About, Interest, Thought, PHLogger, Event
where
User.phlid = About.phlid and
About.iname = Interest.iname and
Interest.topic = 'alcoholism' and
User.phlid = Thought.phlid and
Thought.text = "wasted" and
User.phlid = PHLogger.phlid and
User.phlid = Event.phlid
order by Id;

Add a comment
Know the answer?
Add Answer to:
MySQL Query Language Please help! For PHLogger users who are interested in the “alcoholism” topic and have “wasted” thoughts about that topic, list their ids, their names, and the start time of their...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT