0% found this document useful (0 votes)
14 views1 page

Customer Table Query

The document contains a series of SQL queries related to employee and customer data retrieval from various tables. It includes queries to filter employees based on salary, commission, job title, and name patterns, as well as customer ratings and student grades. Each query is presented with its corresponding SQL syntax for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Customer Table Query

The document contains a series of SQL queries related to employee and customer data retrieval from various tables. It includes queries to filter employees based on salary, commission, job title, and name patterns, as well as customer ratings and student grades. Each query is presented with its corresponding SQL syntax for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Q1.

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.

Ans: SELECT * FROM EMPL WHREE COMM IS NULL;

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.

Ans: SELECT ENAME FROM EMPL WHERE ENAME LIKE ‘_ _ A%’;

Q6. Write a query to display the name of employee whose name contains ‘T’ as the last
alphabet.

Ans: SELECT ENAME FROM EMPL WHERE ENAME LIKE ‘%T’;

Q7. Write a query to display the name of employee whose name contains ‘M’ as first alphabet
‘L’ as third alphabet.

Ans: SELECT ENAME FROM EMPL WHERE ENAME LIKE ‘M_L%’;

Q8. Write a query on the customers table whose output will exclude all customers with a rating
<= 100, unless they are located in Shimla.

Ans: SELECT * FROM CUSTOMERS WHERE RATING <=100 OR CITY = ‘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’;

(ii) Display the different games offered in the school.

Ans: SELECT DISTINCT GAME FROM STUDENT;

(iil) Display the SUPW taken up by the students, whose name starts with ‘A’.

Ans: SELECT SUPW, NAME FROM STUDENT WHERE NAME LIKE ‘A%’;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy