Subscribe: Saki Blogs - Latest comments
http://blogs.sakienvirotech.com/index.php?tempskin=_rdf&disp=comments
Preview: Saki Blogs - Latest comments

Saki Blogs - Latest Comments





 



In response to: On badly behaved crawlers

2014-12-01T08:21:03Z

Just to mention that we are now 2014 and magpie still hasn’t improved. My advice: ban it from your site right away. I get about 3 - 5 hits a second from that piece of junk when they decide to index my site and I’m tired of paying for their incompetence.




In response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

2014-08-11T04:47:51Z

Hi David,

The JOIN statement creates a complex statement that builds on previous components. If you look at the first join (between author and book) you now have effectively a meta-table that includes fields from both. The next join needs only to reference fields from the meta-table, which in this case includes fields from book as well as author.

This is no to say that you couldn’t restructure the query to match your supposition, however you’d need to think carefully about the direction (LEFT/RIGHT) of the join as I’m using LEFT JOIN knowing that it will always provide me with a result provided there is a valid author, regardless of if that author has a book or publisher. If I structured the query such that book was before the FROM then I would need a valid book to list an author.

Note that I’m using the term meta-table as a convenience. The underlying database doesn’t need to create a separate structure.




In response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

2014-08-07T22:09:59Z

Hello,

in the previous episode to this, a SELECT query was made with 3 joins, namely:

SELECT `title`,
CONCAT_WS(’ ‘,`author`.`first_name`,`author`.`last_name`) AS `author`,
`publisher`.`name` AS `publisher`,
`format`.`name` as `format`,
`price`, `isbn` FROM `book`
JOIN `author` ON `book`.`author` = `author`.`id`
JOIN `publisher` ON `book`.`publisher` = `publisher`.`id`
JOIN `format` ON `book`.`format` = `format`.`id`;

As I understand it, the tables `author`, `publisher`, and `format` each have a separate link back to the book table. Is that correct? Now in this episode you have the query:

SELECT CONCAT_WS(’ ‘,`author`.`first_name`,`author`.`last_name`) AS `author`,
`book`.`title` FROM `author`
LEFT JOIN `book` ON `author`.`id` = `book`.`author`
LEFT JOIN `publisher` ON `publisher`.`id` = `book`.`publisher`
WHERE `publisher`.`name` = ‘Bantam’;

I can see in the first join that the `book` table is linked back to the `author` table. But the second join to `publisher` is a join to the `book` table. I the thought that with multiple joins all tables following JOIN statements had to link back to the initital table referred to in the FROM statement.




In response to: In memory of Eileen Mary Donnison (nee Cain)

2014-05-06T21:50:40Z

Adam, what a lovely tribute to your mother. She sounds like someone I’d like to have met. My condolences.

Boel




In response to: In memory of Eileen Mary Donnison (nee Cain)

2014-05-05T10:28:11Z

Thank you for sharing this, she was an amazing Gran and an inspiring woman.




In response to: MySQL 101 - Retrieving data: SELECT and JOIN

2014-02-26T07:33:25Z

Thanks, Jose, I’ve updated the links.




In response to: MySQL 101 - Retrieving data: SELECT and JOIN

2014-02-10T15:53:50Z

Hey,

Great guides for starters (like me) only comment so far is about the website. The link for your ‘last episode’ has an extra http// in it (so it doesn’t work unless you remove it). And on your last episode (creating the database) you don’t seem to have a hyperlink to the next episode - just text saying what will be covered. Thought I’d comment just so people who are looking for these in order will have an easier time (I googled for this page to find it when the hyperlink on the previous wasn’t working).

Thanks again!
Jose




In response to: MySQL 101 - Referential Integrity

2013-01-09T03:30:15Z

I have rarely seen programming taking advantage of Referential Integrity constraint e.g. CASCADE on UPDATE. It’s immensely useful specially in large application where data is subject to change by multiple people. Here is another good example of referential integrity in MySQL http://javarevisited.blogspot.com.ar/2012/12/what-is-referential-integrity-in-database-sql-mysql-example-tutorial.html which explains cascading.