Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
use doag;
set autocommit=0;
drop table if exists quotes;
create table quotes
( id int unsigned auto_increment primary key
, author varchar(64) , quote varchar(4000)
, source varchar(64)
, fulltext(quote)
) engine=innodb;
insert into quotes (author, quote, source) values
('Abraham Lincoln', 'Fourscore and seven years ago...',
'Gettysburg Address')
, ('George Harrison', 'All those years ago...',
'Live In Japan')
, ('Arthur C. Clarke', 'Then 10 years ago the monolith was discovered.',
'2010: The Year We Make Contact')
, ('Benjamin Franklin',
'Early to bed and early to rise, makes a man healthy, wealthy, and wise.',
'Poor Richard''s Almanack')
, ('James Thurber',
'Early to rise and early to bed makes a male healthy and wealthy and dead.',
'The New Yorker')
, ('K', '1500 hundred years ago, everybody knew that the Earth was the center of the universe.',
'Men in Black')
select * from quotes
select author as "Monolith" from quotes
where match(quote) against ('monolith' in natural language mode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment