Print This Post Print This Post

MySQL Workbench v5.2.34 – 2nd meeting

Early experiences with the MySQL Workbench IDE version 5.2.34, revision 7780 – part 2.

I refined the data model a little.

Export of ER diagram V2  from Story Schema

Export of ER diagram V2 from Story Schema

I edited in a minimal set of data for test purposes, this included entry of two characters from Book, and a (limited) selection of page references taken from the Book index generated with OpenOffice.org Writer.

Finally, I set about cobbling together a couple of queries. At this point, I was experiencing no difficulties in remembering how the various facilities on Workbench functioned, so if an old fart like me can achieve familiarity and productivity in a short time, then I believe anyone can.
Below I’ve given screenshots of both the SQL and resultsets for/from the queries. One comment here – the resultset can be exported as HTML, CSV, TAB etc., but not as a printable graphic, which is a shame.

First a report on the pages featuring Joe and Zena. (NOTE minimal population of tables!)

SQL querying pages in book featuring Joe and Zena

SQL querying pages in book featuring Joe and Zena


Note in the above, I deliberately tested variation of the syntax for table names and fields. MySQL seems happy with both forms I used.

and the resultset:

Resultset of querying pages in book featuring Joe and Zena

Resultset of querying pages in book featuring Joe and Zena

Now a report on the complex (and rather confused) relationship Joe has with Zee. (Only Joe->Zeena relationship, and only these two characters in database)

SQL querying relationship in book between Joe and Zena

SQL querying relationship in book between Joe and Zena

and the resultset:

Resultset of querying relationships in book

Resultset of querying relationships in book

After doing the query, and completing the screendumps etc., I noted that Joe had been having ‘streesful times’ ! Just shows how conflicted he really is!
I also need to clean up the spelling differentiation for Zena/Zeena/Zee in my data.

Downloads

The Story MySQL Workbench file (V2) is here: http://joebrown.org.uk/images/MySQL Workbench/StoryV2.mwb
The above SQL queries are here: http://joebrown.org.uk/images/MySQL Workbench/StoryQueryPages.sql
and here: http://joebrown.org.uk/images/MySQL Workbench/StoryQueryRelationships.sql

Copy the code below to your web site.
x 
  • Share/Bookmark
PDF Creator    Send article as PDF   

You must be logged in to post a comment.