Searching for stock items

  1. Create a script which asks a user for a string to search for in a stock item's description (eg "dynamite").

  2. Allow the user to choose either "Full name", "Beginning of name" or "Part of name" as a search type.

  3. Create different SQL queries using LIKE to search the data depending on their choices

Advanced exercises

  1. Change the script so that people can use DOS/Unix style wildcards (* and ?) then use their wildcard expression in your SQL query - convert the wildcards to SQL-style wildcards by using regular expressions