Customer Table Query
Customer Table Query
Write a query to display EName and Sal of employees whose salary is greater than or
equal to 2200 from table Empl.
Ans: SELECT EName, Sal FROM Empl WHERE sal >= 2200;
Q2. Write a query to display details of employees who are not getting commission from table
Empl.
Q3. Write a query to display employee name and salary of those employee who don’t have
there salary in the range of 2500 to 4000.
Ans: SELECT ENAME, SAL FROM EMPL WHERE SAL NOT BETWEEN 2500 AND 4000;
Q4. Write a query to display the name, job title and salary of employee who do not have
manager.
Ans: SELECT ENAME, JOB, SAL FROM EMPL WHERE MGR IS NULL;
Q5. Write a query to display the name of employee whose name contains ‘A’ as third alphabet.
Q6. Write a query to display the name of employee whose name contains ‘T’ as the last
alphabet.
Q7. Write a query to display the name of employee whose name contains ‘M’ as first alphabet
‘L’ as third alphabet.
Q8. Write a query on the customers table whose output will exclude all customers with a rating
<= 100, unless they are located in Shimla.
Q9. Write a query that selects all orders (Order table) except those with zeros or NULLs in the
amt field.
Ans: SELECT * FROM ORDER WHERE AMT <> 0 OR AMT IS NOT NULL;
(i) Display the names of the students who are getting a grade ‘C’ in either GAME or SUPW.
Ans: SELECT NAME FROM STUDENT WHERE GRADE1 =’C’ OR GRADE2 = ‘C’;
(iil) Display the SUPW taken up by the students, whose name starts with ‘A’.
Ans: SELECT SUPW, NAME FROM STUDENT WHERE NAME LIKE ‘A%’;