OneCompiler

p5

107

Display all customers whose name start with ‘M’
➢ SELECT * FROM customers WHERE customer_name LIKE 'M%';

  1. Display all the customers whose name ends with ‘L’
    ➢ SELECT * FROM customers WHERE customer_name LIKE '%L';

  2. Display all loan details whose branch starts with ‘A’
    ➢ SELECT * FROM loans WHERE branch LIKE 'A%';

  3. Display the details of sailors whose name is minimum 6 characters long.
    ➢ SELECT * FROM sailors WHERE sailor_name LIKE '_ _ _ _ _ _%';

  4. Display the details of Employees whose address starts with ‘S’
    ➢ SELECT * FROM employees WHERE address LIKE 'S%';

  5. List the details of the boat ending with ‘e’
    ➢ SELECT * FROM boats WHERE boat_name LIKE '%e';

  6. List the details of clients having ‘h’ as a 3rd character in his/her name.
    ➢ SELECT * FROM clients WHERE client_name LIKE '_ _h%';

  7. List Client Name, due balance and city whose pin code starts with 4.
    ➢ SELECT client_name, due_balance, city FROM clients WHERE pin_code LIKE '4%';

  8. List all customers whose city contains ‘a’ as second character.
    ➢ SELECT * FROM customers WHERE city LIKE '_a%';

  9. List client names and city whose state has ‘a’ as fourth or fifth character.
    ➢ SELECT client_name, city FROM clients WHERE state LIKE '_ _ a%' OR state LIKE ' _ _
    _a%';