Need some ideas for MySQL stored procedures, functions and triggers
I have a school assignment to design a database and to include:
* 2 stored procedures
* 2 开发者_JS百科functions
* 2 triggers
While I know how to implement these, I haven't used them IRL and I have a hard time coming up with use-cases.
Any ideas? :-)
(if it helps, my DB design mimics an online bookstore -- e.g. Amazon)
Possible stored procedures:
- given author, retrieve list of books (or ISBNs).
- given ISBN, retrieve title and author.
Possible triggers: maintain separate column with lowercased title/author for faster searching. In other words, index those columns, so as to avoid performance killers like select blah from book where to_lower(author) = 'dan brown'
. One trigger for insert, another for update.
精彩评论