MySQL Forums
Forum List  »  MySQL Workbench

Re: Foreign keys and queries
Posted by: Mike Lischke
Date: November 28, 2014 01:39AM

Hey Nick,

> I have set up a model in workbench and
> successfully exported this to a new connection I
> created.
>
> However I had to remove those foreign keys before
> I could forward engineer. Why is that?

What made you think you have to remove the foreign keys? You can leave in the FKs even if you use table engines that don't support them (the MySQL server will then silently ignore their definition).

>
> Now I have the three tables in the DB and have
> created some records in each I want to show the
> activities that each user has signed up for. So it
> is some sort of union/join statement I think, but
> how do I build this through drag and drop of the
> relevant columns from the different tables?

MySQL Workbench doesn't have a visual query builder. Instead you would write your query in the standard way. Start with a select on the user table, add the user activity table with a join (probabl on a userID field) and finally do the same for the activity table.

Mike

Mike Lischke, MySQL Developer Tools
Oracle Corporation

MySQL Workbench on Github: https://github.com/mysql/mysql-workbench
On Twitter: https://twitter.com/MySQLWorkbench
On Slack: mysqlcommunity.slack.com (#workbench)
Report bugs to http://bugs.mysql.com
MySQL documentation can be found here: http://dev.mysql.com/doc/refman/8.0/en/

Options: ReplyQuote


Subject
Views
Written By
Posted
1025
November 27, 2014 10:39AM
Re: Foreign keys and queries
586
November 28, 2014 01:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.