Skip to content
Worked Examples · Example 9.16

Q.The following query selects names of all employees containing 'se' as a substring in name.

Tripura TbseTextbookSubjective· 2mImportance★★★★★
33% · 31/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Example 9.16, on the real EMPLOYEE table (Table 9.8): Ename LIKE '%se%' finds names containing 'se' anywhere — Joseph and Vergese.

The real EMPLOYEE table (Table 9.8)

EmpNoEnameSalaryBonusDeptId
101Aaliya10000234D02
102Kritika60000123D01
103Shabbir45000566D01
104Gurpreet19000565D04
105Joseph34000875D03
106Sanya48000695D02
107Vergese15000NULLD01
108Nachaobi29000NULLD05
109Daribha42000NULLD04
110Tanya50000467D05

To find a substring anywhere within a name, % is placed on both sides of the target text:

mysql> SELECT Ename FROM EMPLOYEE
    -> WHERE Ename like '%se%';
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.