In response to: Its a Total Fire Ban and I'm tense
Big respect to you Adam and thank you for giving your unique perspective.
Is over 45 years I have speaking publicly about this and I am stepping up efforts now
In response to: MySQL 101 - Creating your first database
Great tutorial, thank you for putting it together, its been really helpful!
How would I set this up if there were multiple authors or publishers to one book?
Thanks
In response to: On badly behaved crawlers
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
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
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)
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)
Thank you for sharing this, she was an amazing Gran and an inspiring woman.
In response to: MySQL 101 - Retrieving data: SELECT and JOIN
Thanks, Jose, I’ve updated the links.
In response to: MySQL 101 - Retrieving data: SELECT and JOIN
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
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.
In response to: Predictions of a Long Hot Summer
They don’t call the Redbank Nature Reserve the Bealiba Second Cemetery for nothing (mine shafts everywhere…)
In response to: Predictions of a Long Hot Summer
“I’ve got a plan for a spot of stress relief.”
Yes, but the ground will be too hard for grave digging…
In response to: Ducklings - Day 3
Alas these days, some of the excess boys do end up on the table.
Whilst I end up in the back room pretending they aren’t on the table…. others in the house are less conflicted…
In response to: Ducklings - Day 3
I guess they’re not destined for a yummy Duck L’orange when they grow up?
It’s ok - I’m slapping myself - bad Sally!
In response to: On badly behaved crawlers
Just an update…We applied the robots.txt fix and noticed a distinct drop in origin traffic and CPU usage.
Not all magpie-crawler connections have gone but most have. We will only block the IPs as the last resort but it may come to that if we can’t get rid of them all via robots.txt.
Seems magpie is (as stated above) simply overly aggressive.
In response to: Open for Business
I dare you to change the sign to say, “Fresh Eggs. Direct from a chooks bum to you.”
In response to: Dealing with pre-emptive grief
Hi Eli,
Unfortunately I ended up having to make the decision, as I knew I would. One thing you learn when owning pets is that you will outlive them, and that more often than not you are going to have to make some hard decisions. What you have to remember is that you have to act in the best interests of your pet. It is not betrayal to end suffering, although the point at which you decide that quality of life has gone will be different for different people and different situations. In fact, I see it as a duty, a responsibility of ownership.
I hope that your situation is easy on both of you, but please, don’t shy away from the hard decision if and when it becomes necessary. You will have doubts, that is only human - but if you love your dog the way it comes across from your words you will know when it is time to act.
In response to: Dealing with pre-emptive grief
I took my twelve yr old golden retriever for a checkup and although she had been put on a reduced calorie diet and lost some weight and her arthritis was starting she had some really good days. The shock was the blood test showed she has leukemia and will die in 30 to 60 days. She shows no signs except the blood counts, eats well, no stomach problems but has anemia which slows her down. I am hoping I will not have to make that choice unless she stops eating or drinking as I feel I would feel I am betraying the animal that loves me most and will do anythings to please me. I understand how you feel pray so that he goes before you have to make a choice and he does not suffer.