Page 1 of 1

MariaDB MySQL Questions

PostPosted: 10. October 2016 19:52
by InuKik
Hi, I am struggling with some questions and hoping if someone could help me out by solving them. I added the link for the ER Diagram and tables below with the question. Thanks in advance.

Coincidence. Have two guests with the same surname ever stayed in the hotel on the evening? Show both last and first name. No duplicates.

http://imgur.com/a/eIO50

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 11:40
by Altrea
Hi,

I cannot see any questions.

best wishes,
Altrea

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 12:38
by InuKik
"Coincidence. Have two guests with the same surname ever stayed in the hotel on the evening? Show both last and first name. No duplicates."

That's the question. Thank you.

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 13:01
by InuKik
And also it's SELECT statement. So it might be something like, SELECT DISTINCT first_name, last_name FROM guest

But I don't know how to continue from there with the answer.

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 14:39
by studio_two
Maybe something similar to:
select last_name as AA, check_in_date as BB
from guest
group by last_name, check_in_date
having COUNT(slcust_no) >2
order by last_name;

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 15:35
by Altrea
I cannot see how this can be a XAMPP for Windows issue.
Seems to me like homework help.

Re: MariaDB MySQL Questions

PostPosted: 11. October 2016 15:45
by studio_two
Altrea wrote:I cannot see how this can be a XAMPP for Windows issue.
Seems to me like homework help.


Probably. :)