1. BASIC SQL QUERY Help-
CREATE EMPLOYEE TABLE
EMP_ID |
FIRST_NAME |
LAST_NAME |
GENDER |
DEPARTMENT |
JOINING_DATE |
SALARY |
1001 |
ANDREW |
CENCINI |
MALE |
IT |
08-01-2014 |
300000 |
1002 |
STEVEN |
THROPE |
MALE |
HR |
10-02-2014 |
400000 |
1003 |
ANNE |
HELLUNG-LARSEN |
FEMALE |
FINANCE |
20-03-2014 |
500000 |
1004 |
DENE |
SENA |
FEMALE |
ACCOUNT |
30-04-2014 |
200000 |
1) Write a query for all the detail of "EMPLOYEE" table.
Query:
SELECT * FROM EMPLOYEE;
2) Write a query to get only "FIRSTNAME" column from "EMPLOYEE" table
Query:
SELECT FIRST_NAME FROM EMPLOYEE ;
3) Write a query to get FirstName in upper case as " FIRST_NAME ".
Query:
SELECT UPPER(FIRST_NAME) AS "First Name" FROM EMPLOYEE ;
4) Write a query to get FIRST_NAME in lower case as "First Name".
Query:
SELECT LOWER(FIRST_NAME) AS "First Name" FROM EMPLOYEE ;
5) Write a query for combine FIRST_NAME and LAST_NAME and display it as " FULL NAME " (also include white space between first name & last name)
Query:
SELECT FIRST_NAME +' '+ LAST_NAME AS [FULL NAME] FROM EMPLOYEE ;
6) Select EMPLOYEE detail whose name is "ANDREW"
Query:
SELECT * FROM EMPLOYEE WHERE FIRST_NAME = 'ANDREW'
7) Get all employee detail from EMPLOYEE table whose " FIRST_NAME" start with latter 'D'.
Query:
SELECT * FROM EMPLOYEE WHERE FIRST_NAME like 'D%'
8) Get all employee details from EMPLOYEE table whose " FIRST_NAME" contains 'E'
Query:
SELECT * FROM EMPLOYEE WHERE FIRST_NAME like '%E%'
9) Get all employee details from EMPLOYEE table whose " FIRST_NAME" end with 'h'
Query:
SELECT * FROM EMPLOYEE WHERE FIRST_NAME like '%W'
10) Get all employee detail from EMPLOYEE table whose " FIRST_NAME" start with any single character between 'A-N'
Query:
SELECT * FROM EMPLOYEE WHERE FIRST_NAME like '[A-N]%'
Very affordable projects!! And that to submit before deadlines. Thanks for helping me in my database project and raising my grades. I have been able to secure good marks in my internal assessment only because of you. Read More
Follow Us