This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
; | |
commit; | |
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