Subscribe: Saki Blogs - Latest comments
http://blogs.sakienvirotech.com/index.php?tempskin=_rss2&disp=comments
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
author author  author book  author join  author  book author  book  join  mysql  publisher  response mysql  response  visitor response 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Saki Blogs - Latest comments

Saki Blogs - Latest Comments





 



Steve [Visitor] in response to: On badly behaved crawlers

Mon, 01 Dec 2014 08:21:03 +0000

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.




aj [Member] in response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

Mon, 11 Aug 2014 04:47:51 +0000

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.




David [Visitor] in response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

Thu, 07 Aug 2014 22:09:59 +0000

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.




Boel [Visitor] in response to: In memory of Eileen Mary Donnison (nee Cain)

Tue, 06 May 2014 21:50:40 +0000

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

Boel




Sarah [Visitor] in response to: In memory of Eileen Mary Donnison (nee Cain)

Mon, 05 May 2014 10:28:11 +0000

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




aj [Member] in response to: MySQL 101 - Retrieving data: SELECT and JOIN

Wed, 26 Feb 2014 07:33:25 +0000

Thanks, Jose, I’ve updated the links.




Jose [Visitor] in response to: MySQL 101 - Retrieving data: SELECT and JOIN

Mon, 10 Feb 2014 15:53:50 +0000

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




SQL dev [Visitor] in response to: MySQL 101 - Referential Integrity

Wed, 09 Jan 2013 03:30:15 +0000

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.