JOIN

Fulltext Indexes

Fulltext Indexes were a new feature in MySQL 5.0, and they're meant to be a wonderful way of searching through large tables with Text column types (or Varchar, for that matter).

I was curious to see how a Fulltext search differed from a regular pattern match search. So I set up Fulltext Indexes on the line column (i.e. the bit with the text in). The syntax for searching through Fulltext Indexes involves the keywords MATCH and AGAINST. Let's find out how times Abraham is mentioned in the bible, first using the Fulltext Index:

 

Procedures: One Chapter at a Time

Stored Procedures and Functions are a biggy on the MySQL Developer exam. They account for 20% of the marks of the second paper. And no wonder, there's a lot of new functionality (and syntax) to keep in mind. So with that in mind, let's put a procedure together.

Suppose you want to see the all of Genesis Cap 1 together. We can use group_concat() to squidge all the verses in Genesis 1 together on one line.

SELECT GROUP_CONCAT(line  ORDER BY verse SEPARATOR ' ')  as genesis
  FROM bible
 WHERE book = 'Ge'
   AND cap = 1 \G
Syndicate content