Your company has a program that sends invitations to special
Your company has a program that sends invitations to special guests in the contacts dictionary. The program generates letters driven by embedded SQL statment that select the contact.
There is a contact that goes by the name that most remember something like mcGavil or Mc Gavin or mcgavim. No one else is certain. You are not sure how the \"Mc part is stored, but it looks like everyone is very confident that \"gav\" is part of the last name.
Your job is to write the SQL code that will select the right contact. Your result should be the first name followed by space and then last name (i.e. Joe Smith). This result of first and last name will be held in a new derived field you interduce called special_guest that can then pass the value to the program that generates the letter.
You are only working on the SQL part that gets the right name stored in special_guest. Don\'t worry about the program that sends out the letter since that already exists and the program just needs to know what special_guest to place in standard letter heading.
Solution
here you are try to get the names like mcgavin,mcgavil then you have to use the sql function \"SOUNDEX()\"
the soundex function which is used to get the records that is sounds like the soundex variable...
an you need to get the name from two columns and send the two fields data as one field for that we use the other two table names
table names:
contacts : containes contacts
column names:
first name,last name
special_guest is the field that you need to put the names in
select to_char(firstname ||\' \'|| lastname) as special_guest from contacts where soundex(lastname)=\'gav\' and firstname like \'MC%\' or firstname like \'mc%\'
