Friday 19 February 2016

That's why he is man of MILLIONS.

An Indian man walks into the New York City bank
and asks for the loan officer. He tells the Loan Officer that he was going to India for some business for 2 weeks and needs to borrow $5,000. 

The Loan Officer tells him that the bank will need some form of security for the loan. So the Indian man hands over the keys and the
documents of the new Ferrari car parked on the street in front of the bank. The loan officer consults the president of the bank,

Produces all the required items and everything
check out to be OK. The loan officer agrees to accept the car as a security for the loan. 

The bank president and the Loan Officer had a good laugh at the Indian For keeping a $750,000 Ferrari as a security and taking only $5,000 has a loan. An employee of the bank then drives the Ferrari Into the banks underground garage and parks it there. 

Two weeks later the Indian returns and pays $5000 and the interest which comes to it $15.41. Seeing this, loan officer says, “Sir, we are very happy to have your business
And this transaction has worked out very nicely,
but we are a little puzzled.

While you are away, we checked you out and
Found out that you were a multi millionaire. What puzzled us was why would you bother to
borrow $5000?” The Indian replies
"Where else in the New York City can I park my
car for 2 weeks and
For only $15.41 and expect it to be there when I
return".

This is a true incident and the Indian is none other than... "VIJAY MALLYA"

Thursday 18 February 2016

Don't Take Life Seriously

Don't just have career or academic goals; set goals to give you a balanced, successful life.

Balanced means ensuring your health, relationships, mental peace are all in good order.

There is no point of getting a promotion on the day of your breakup. 
There is no fun in driving a car if your back hurts. 
Sh​​opping is not enjoyable if your mind is full of tensions.

Don't take life seriously. Life is not meant to be taken seriously, as we are really temporary here. 
We are like a prepaid card with limited validity. If we are lucky, we may last another 50 years. 
And 50 years is just 2,500 weekends. Do we really need to get so worked up?

It's OK, score low​ ​in couple of papers, take leave from work, fight a little with your spouse...

It's ok... We are people, not programmed devices..! "Don't be serious, enjoy Life as it comes".

Manoj Kumar Ganadi.

Saturday 13 February 2016

Interview Questions You Should Never Answer

Most of the questions asked in an interview are off-limits. Being a candidate, it is not essential to get ready for the questions employers tend to ask you, but also to be prepared in order to shirk the questions that do not deserve an answer.

1. How old are you?

You're not required to justify any questions related to your age except than just determining that you are above 18 years. There's also no need to provide a photo ID during the interview session. In case, if this question is posed then you can simply state that you're afraid of identity theft and would not opt to hand over the concerned document until it's firmed that you will be joining the team or not.

2. What's your nationality?

Same goes with this particular question, you need not answer the questions posed over your nationality, citizenship status or as in for how long you have been residing in the US or any other country. Just illustrate that you're officially capable to work in the country.

3. Are you married? Do you have any children?

Interviewers have the authority to ask you whether you have made use of alternate name professionally or while your academics, but they are not authorized to ask you about your marital status, children or in case you decide to have a family in the foreseeable future. In such circumstances, readdress the question back to the interviewer.

4. Do you have any spiritual beliefs?

Questions related to religious ideas are beyond limits while an interview, getting your religious fundaments and what religious holidays you noticed. If the interviewer pose this question, then try to find out what they are alarmed with and then tackle those concerns.

5. How long would your commute be to this office?

The recruiter should not ask you questions about the residence you stay from the office , as in how far it is, he can try to find out whether you can start the work at a certain hour or displace from the position. If your planning to relocate due to the post, then straight-away mention the same in your professional summary on your resume as well as online profiles that you desire and able to transfer ASAP.


Regards
Manoj Kumar Ganadi.

Monday 8 February 2016

SQL FUNCTIONS WITH A CLEAR VIEW BY MANOJ KUMAR GANADI

SQL FUNCTIONS

NOTE:[To View tables in Schema by using this Syntax:  select tablespace_name, table_name from user_tables; ]

FUNCTIONS-->(1.SINGLE ROW FUNCTIONS AND 2.MULTIPLE ROW FUNCTIONS)
1.SINGLE ROW FUNCTIONS-->(1.CHARACTER 2.NUMBER 3.DATE 4.CONVERSION 5.GENERAL)

1.CHARACTER FUNCTIONS : ?ccept character input and can return both character and number values

CHARACTER FUNCTION--> 1.CASE-CONVERSION FUNCTIONS 2.CHARACTER MANIPULATION FUNCTIONS

1.CASE-CONVERSION FUNCTIONS(1.LOWER 2.UPPER 3.INITCAP)

SYNTAX:SELECT 'The job id for '||UPPER(last_name)||' is ' ||LOWER(job_id) AS "EMPLOYEE DETAILS" FROM employees;
     :SELECT employee_id, last_name, department_id FROM employees WHERE LOWER(last_name) = 'higgins';
                                      :SELECT employee_id, UPPER(last_name), department_id FROM employees WHERE INITCAP(last_name) = 'Higgins;

1.LOWER   :Converts alpha character values to lowercase
2.UPPER   :Converts alpha character values to Uppercase
3.INITCAP :Converts alpha character values to uppercase for the first letter of each word; all other letters in lowercase

2.CHARACTER MANIPULATION FUNCTIONS(1.CONCAT 2.SUBSTR 3.LENGTH 4.INSTR 5.LPAD/RPAD 6.TRIM 7.REPLACE)
SYNTAX:SELECT employee_id, CONCAT(first_name, last_name) NAME, job_id, LENGTH (last_name), INSTR(last_name, 'a') "Contains 'a'?" FROM employees WHERE SUBSTR(job_id, 4) = 'REP';
                                      :SELECT employee_id, CONCAT(first_name, last_name) NAME, LENGTH (last_name), INSTR(last_name, 'a') "Contains 'a'?" FROM employees WHERE SUBSTR(last_name, -1, 1) = 'n';

1.CONCAT :Concatenates the first character value to the second character value; equivalent to concatenation operator (||)
  2.SUBSTR :Returns specified characters from character value starting at character position m, n characters long
 (If m is negative, the count starts from the end of the character value. If n is omitted, all characters to the end of the string are returned.)
3.LENGTH :Returns the number of characters in the expression
4.INSTR  :Returns the numeric position of a named string. Optionally, you can provide a position m to start searching, and the occurrence n of the string. m and n default to 1, meaning start the search at the beginning of the string and report the first occurrence.
5.LPAD/RPAD:Returns an expression left-padded to length of n characters with a character expression. Returns an expression right-padded to length of n characters with a character expression.
6.TRIM   :Enables you to trim leading or trailing characters (or both) from a character string. If trim_character or trim_source is a character literal, you must enclose it in single quotation marks. This is a feature that is available in Oracle8i and later versions.
7.REPLACE:Searches a text expression for a character string and, if found, replaces it with a specified replacement string

                                                                        NOTE
*********************************************************************************
1.CONCAT: Joins values together (You are limited to using two parameters with CONCAT.)    
2.SUBSTR: Extracts a string of determined length                                                                        
3.LENGTH: Shows the length of a string as a numeric value                                                        
4.INSTR : Finds the numeric position of a named character                                                          
5.LPAD  : Returns an expression left-padded to the length of n characters with a character                                  expression                                                                                                                      
6.RPAD  : Returns an expression right-padded to the length of n characters with a character                               expression                                                                                                                    
7.TRIM  : Trims leading or trailing characters (or both) from a character string                              
 (If trim_character or trim_source is a character literal, you must enclose it within single quotation marks.)
*********************************************************************************                                                                                                                                                                
2.NUMBER FUNCTIONS    : Accept numeric input and return numeric values
NUMBER FUNCTIONS--> 1.ROUND 2.TRUNC 3.MOD

1.ROUND:Rounds the column, expression, or value to n decimal places or, if n is omitted, no decimal places.
                                (If n is negative, numbers to the left of decimal point are rounded.
2.TRUNC:Truncates the column, expression, or value to n decimal places or, if n is omitted, n defaults to zero.
3.MOD  :Returns the remainder of m divided by n.

                                                                    NOTE
*********************************************************************************
DUAL Table: The DUAL table is owned by the user SYS and can be accessed by all users. It contains one column, DUMMY, and one row with the value X. The DUAL table is useful when you want to return a value only once  (for example, the value of a constant, pseudocolumn, or expressionthat is not derived from a table with user data). The DUAL table is generally used for completeness of the SELECT clause syntax, because both SELECT and FROM clauses are mandatory, and several calculations do not need to select from the actual tables.
*********************************************************************************                                                                                                                
*****NESTING FUNCTIONS*****
SELECT last_name,UPPER(CONCAT(SUBSTR (LAST_NAME, 1, 8), '_US')) FROM employees WHERE department_id = 60;
SELECT TO_CHAR(NEXT_DAY(ADD_MONTHS (hire_date, 6), 'FRIDAY'), 'fmDay, Month ddth, YYYY') "Next 6 Month Review" FROM employees ORDER BY hire_date;

*****NUMBER FUNCTIONS*****
-------------------------ROUND FUNCTIONS------------------------------
SELECT round(20.992, 2), round(20.992, 0), ROUND(20.992,-1) FROM DUAL;

-------------------------TRUNC FUNCTIONS------------------------------
SELECT TRUNC(20.992, 2), round(20.992, 0), TRUNC(20.992,-1) FROM DUAL;
SELECT TRUNC(20.392,0) FROM DUAL;

-------------------------MOD FUNCTIONS------------------------------
SELECT LAST_NAME,SALARY,MOD(SALARY,5000) FROM EMPLOYEES;
SELECT LAST_NAME,SALARY,MOD(SALARY,5000) FROM EMPLOYEES WHERE JOB_ID ='SA_REP';


3.DATE FUNCTIONS      : Operate on values of the DATE data type
(All date functions return a value of the DATE data type except the MONTHS_BETWEEN function, which returns a number.)

*****DATE FUNCTIONS*****
SELECT last_name, hire_date FROM employees WHERE hire_date < '01-FEB-08';
SELECT last_name, hire_date FROM employees WHERE hire_date < '01-FEB-99';
SELECT SYSDATE FROM  DUAL;
SELECT last_name, (SYSDATE-hire_date)/7 AS WEEKS FROM employees WHERE department_id = 90;



4.CONVERSION FUNCTIONS: Convert a value from one data type to another
DATA TYPE CONVERSION FUNCTIONS :1.IMPLICIT 2.EXPLICIT
1.IMPLICIT DATA TYPE CONVERSION FUNCTIONS
                                  FROM         TO
VARCHAR2 or CHAR NUMBER
                                VARCHAR2 or CHAR DATE

2.EXPLICIT DATA TYPE CONVERSION FUNCTIONS: 1.TO_CHAR 2.TO_DATE 3.TO_NUMBER

1.TO_CHAR: Converts a number or date value to a VARCHAR character string with the format model fmt
Number conversion: The nlsparams parameter specifies the following characters,
which are returned by number format elements:
• Decimal character
• Group separator
• Local currency symbol
• International currency symbol
If nlsparams or any other parameter is omitted, this function uses the default parameter values for the session.
---------------------------------------------------------NOTE---------------------------------------------------------
The format model:
• Must be enclosed with single quotation marks
• Is case-sensitive
• Can include any valid date format element
• Has an fm element to remove padded blanks or suppress leading zeros
• Is separated from the date value by a comma


TO_CHAR converts a datetime data type to a value of VARCHAR2 data type in the format specified by the format_model. A format model is a character literal that describes the format
of datetime stored in a character string. For example, the datetime format model for the string '11-Nov-2000' is 'DD-Mon-YYYY'. You can use the TO_CHAR function to convert a date
from its default format to the one that you specify.

******************Guidelines******************

• The format model must be enclosed with single quotation marks and is case-sensitive.
• The format model can include any valid date format element. But be sure to separate the date value from the format model with a comma.
• The names of days and months in the output are automatically padded with blanks.
• To remove padded blanks or to suppress leading zeros, use the fill mode fm element.

--------------------------------------------------------------------------------------------------------------------------
YYYY- FULL YEAR IN NUMBERS, YEAR- YEAR SPELLED OUT IN WORDS
MM- TWO DIGIT VALUE OF THE MONTH, MONTH- FULL NAME OF MONTH, MON- THREE LETTER ABBREVIATION OF THE MONTH
DD- NUMERIC DAY OF THE MONTH, DAY- FULL NAME OF THE DAY OF THE WEEK, DY- THREE LETTER ABBREVIATION OF THE DAY OF THE WEEK

*****Elements of the Date Format Model*****
1.Time elements format the time portion of the date:
  HH24:MI:SS AM - 15:45:32 PM
2.Add character strings by enclosing them with double quotation marks:
  DD "of" MONTH - 12 of OCTOBER
3.Number suffixes spell out numbers:
  ddspth - fourteenth

Element Description
AM or PM Meridian indicator
A.M. or P.M. Meridian indicator with periods
HH or HH12 12 hour format
HH24 24 hour format
MI Minute (0–59)
SS Second (0–59)
SSSSS Seconds past midnight (0–86399)
/ . , Punctuation is reproduced in the result.
“of the” Quoted string is reproduced in the result.
TH Ordinal number (for example, DDTH for 4TH)
SP Spelled-out number (for example, DDSP for FOUR)
SPTH or THSP Spelled-out ordinal numbers (for example, DDSPTH for FOURTH)



******************SYNTAX******************
SELECT employee_id, TO_CHAR(hire_date, 'MM/YY') Month_Hired
FROM employees
WHERE last_name = 'Higgins';

SELECT employee_id, first_name, TO_CHAR(hire_date, 'DD/MM/YY') Month_Hired FROM employees WHERE last_name = 'Grant';
SELECT employee_id, first_name, email, TO_CHAR(hire_date, 'DD/MM/YY') Month_Hired FROM employees WHERE last_name = 'Whalen';
SELECT employee_id, first_name, TO_CHAR(hire_date, 'DD/MM/YYYY') Month_Hired FROM employees WHERE last_name = 'Fay';
SELECT employee_id, first_name, TO_CHAR(hire_date, 'DD-DY/MON/YY') Month_Hired FROM employees WHERE last_name = 'Baer';
SELECT employee_id, first_name, TO_CHAR(hire_date, 'DAY-DD/MONTH-MM/YEAR-YYYY') Month_Hired FROM employees WHERE last_name = 'Baer';

*****Using the TO_CHAR Function with Dates*****

SELECT last_name, TO_CHAR(hire_date, 'fmDD Month YYYY') AS HIREDATE FROM employees;
SELECT last_name, TO_CHAR(hire_date, 'fmDdspth "of" Month YYYY fmHH:MI:SS AM') HIREDATE FROM employees;
SELECT TO_CHAR(salary, '$99,999.00') SALARY FROM employees WHERE last_name = 'Ernst';

*****Using the TO_CHAR Function with Numbers*****

Element Result
$ Places a floating dollar sign
L Uses the floating local currency symbol
9 Represents a number
0 Forces a zero to be displayed
. Prints a decimal point
, Prints a comma as a thousands indicator

*****Number Format Elements*****
If you are converting a number to the character data type, you can use the following format elements:

Element Description Example Result
9 Numeric position (number of 9s determine display width) 999999 1234
0 Display leading zeros 099999 001234
$ Floating dollar sign $999999 $1234
L Floating local currency symbol L999999 FF1234
D Returns the decimal character in the specified position.
         The default is a period (.). 9999D99 1234.00
. Decimal point in position specified 999999.99 1234.00
G Returns the group separator in the specified position. You can specify multiple group
separators in a number format model. 9G999 1,234
, Comma in position specified 999,999 1,234
MI Minus signs to right (negative values) 999999MI 1234-
PR Parenthesize negative numbers 999999PR <1234>
EEEE Scientific notation (format must specify four Es) 99.999EEEE 1.234E+03
U Returns in the specified position the “Euro” (or other) dual currency U9999 €1234
V Multiply by 10 n times (n = number of 9s after V) 9999V99 123400
S Returns the negative or positive value S9999 -1234 or +1234
B Display zero values as blank, not 0 B9999.99 1234.00



Using the TO_NUMBER and TO_DATE Functions:

1.Convert a character string to a number format using the
TO_NUMBER function: TO_NUMBER(char[, 'format_model'])

2.Convert a character string to a date format using the
TO_DATE function: TO_DATE(char[, 'format_model'])

3.These functions have an fx modifier. This modifier specifies the exact match for the character argument and
date format model of a TO_DATE function.


******************SYNTAX******************
SELECT last_name, hire_date
FROM employees
WHERE hire_date = TO_DATE('May 24, 2007', 'fxMonth DD, YYYY');

--------------------------------------------------------------------------------------------------------------------------

2.TO_DATE: Converts a character string representing a date to a date value according to fmt that is specified. If fmt
is omitted, the format is DD-MON-YY.
The nlsparams parameter has the same purpose in this function as in the TO_CHAR function for date conversion.
---------------------------------------------------------NOTE---------------------------------------------------------


3.TO_NUMBER: Converts a character string containing digits to a number in the format specified by the optional format model fmt.
The nlsparams parameter has the same purpose in this function as in the TO_CHAR function for number conversion.
--------------------------------------------------------NOTE----------------------------------------------------------

                             
5.GENERAL FUNCTIONS   : 1.NVL 2.NVL2 3.NULLIF 4.COALESCE 5.CASE 6.DECODE
These functions work with any data type and pertain to the use of null values in the
expression list.

Function Description
1.NVL Converts a null value to an actual value
2.NVL2 If expr1 is not null, NVL2 returns expr2. If expr1 is null, NVL2 returns expr3. The argument expr1 can have any data type.
3.NULLIF Compares two expressions and returns null if they are equal; returns the first expression if they are not equal
4.COALESCE Returns the first non-null expression in the expression list

--------------------------------------------------------------------------------------------------------------------------
1.NVL (expr1, expr2)
In the syntax:
1.expr1 is the source value or expression that may contain a null
2.expr2 is the target value for converting the null
You can use the NVL function with any data type, but the return value is always the same as the data type of expr1.

SELECT last_name, salary,commission_pct, (salary*12) + (salary*12*NVL(commission_pct, 0)) AN_SAL FROM employees;
SELECT last_name, salary, NVL(commission_pct, 0), (salary*12) + (salary*12*NVL(commission_pct, 0)) AN_SAL FROM employees;
SELECT last_name, salary, commission_pct, (salary*12) + (salary*12*commission_pct) AN_SAL FROM employees;

  2.NVL2(expr1, expr2, expr3)
In the syntax:
1.expr1 is the source value or expression that may contain a null
2.expr2 is the value that is returned if expr1 is not null
3.expr3 is the value that is returned if expr1 is null

Tuesday 2 February 2016

SQL SELECT COMMANDS WITH A CLEAR VIEW BY MANOJ KUMAR GANADI.



SYNTAX: SELECT *|{[DISTINCT] column [alias],...} FROM table;

In the syntax:

SELECT Is a list of one or more columns

* Selects all columns

DISTINCT Suppresses duplicates

column|expression Selects the named column or the expression

alias Gives different headings to the selected columns

FROM table Specifies the table containing the columns

-------------------------------------------------------------------------

*****SELECTING ALL COLUMNS*****

SELECT *FROM departments;

*****SELECTING SPECIFIC COLUMNS*****

SELECT DEPARTMENT_ID,DEPARTMENT_NAME FROM departments;
SELECT DEPARTMENT_ID,LOCATION_ID FROM departments;
-------------------------------------------------------------------------
*****COLUMN HEADING DEFAULTS*****

SELECT LAST_NAME,HIRE_DATE,SALARY FROM employees;
-------------------------------------------------------------------------
*****USING AIRTHEMATIC OPERATIONS*****

SELECT LAST_NAME,SALARY,SALARY+300 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300, salary-100 FROM employees;
Retrieving Data Using the SQL SELECT Statement
-------------------------------------------------------------------------
*****OPERATOR PRECEDENCE*****

SELECT LAST_NAME,SALARY,12*SALARY+100 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300-100 FROM employees;
-------------------------------------------------------------------------
*****DEFINING A NULL VALUE*****

SELECT LAST_NAME,JOB_ID,SALARY,COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****NULL VALUES IN ARITHEMATIC EXPRESSIONS*****

SELECT LAST_NAME,JOB_ID,12*SALARY*COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****USING COLUMN ALIASES*****

SELECT LAST_NAME AS NAME,SALARY AS SAL FROM employees;
-------------------------------------------------------------------------
*****USING CONCATENATION OPERATOR*****

SELECT LAST_NAME||JOB_ID AS "EMPLOYEES" FROM employees;
-------------------------------------------------------------------------
*****USING LITERAL CHARACTER STRING*****

SELECT LAST_NAME || ' is a ' ||JOB_ID AS "EMPLOYEE DETAILS" FROM employees;
SELECT LAST_NAME ||' : 1MONTH SALARY =  '||SALARY MONTHLY FROM EMPLOYEES;
-------------------------------------------------------------------------
*****ALTERNATIVE QUOTE (q) OPERATOR*****

SELECT DEPARTMENT_NAME || '  DEPARTMENTS MANAGER ID:  '|| MANAGER_ID AS "DEPARTMENT AND MANAGER" FROM DEPARTMENTS;
-------------------------------------------------------------------------
*****DUPLICATE ROWS*****

SELECT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT first_name, last_name, job_id, salary*12 AS "Yearly Sal" FROM employees;
-------------------------------------------------------------------------
*******-----Restricting and Sorting Data-----*****

Use the WHERE clause to restrict rows of output:

– Use the comparison conditions
– Use the BETWEEN, IN, LIKE, and NULL operators
– Apply the logical AND, OR, and NOT operators

• Use the ORDER BY clause to sort rows of output:
• Use ampersand substitution to restrict and sort output at
run time

SYNTAX:
SELECT {*|[DISTINCT] column|expression [alias],...} FROM table [WHERE condition(s)] [ORDER BY {column, expr, alias} [ASC|DESC]] ;
SELECT *|{[DISTINCT] column|expression [alias],...} FROM table [WHERE logical expression(s)];

Limiting the Rows That Are Selected
• Restrict the rows that are returned by using the WHERE
clause:
• The WHERE clause follows the FROM clause.
-------------------------------------------------------------------------
*****USING THE WHERE CLAUSE*****

SELECT employee_id, last_name, job_id, department_id FROM employees WHERE department_id = 90 ;
SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE department_id=10;
-------------------------------------------------------------------------
*****CHARACTER STRINGS AND DATES*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME = 'WHALEN';
SELECT LAST_NAME FROM EMPLOYEES WHERE HIRE_DATE = '17-OCT-03';
-------------------------------------------------------------------------
*****USING COMPARISION OPERATORS*****

SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary<=3000;
SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary>=3000;
-------------------------------------------------------------------------
*****USING BETWEEN OPERATORS*****

SELECT LAST_NAME,SALARY FROM employees WHERE SALARY BETWEEN 2500 AND 3500;
SELECT LAST_NAME FROM EMPLOYEES WHERE last_name BETWEEN 'KING' AND 'SMITH';
-------------------------------------------------------------------------
*****USING IN OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,SALARY,MANAGER_ID FROM EMPLOYEES WHERE MANAGER_ID IN (100,101,200);
SELECT EMPLOYEE_ID,MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME IN ('KOCHHAR','VARGAS');
SELECT employee_id, manager_id, department_id FROM employees WHERE last_name IN ('Hartstein', 'Vargas');
-------------------------------------------------------------------------
*****USING LIKE OPERATOR*****

SELECT FIRST_NAME FROM EMPLOYEES WHERE FIRST_NAME LIKE 'S%';
SELECT LAST_NAME,HIRE_DATE FROM EMPLOYEES WHERE HIRE_DATE LIKE '%05';
-------------------------------------------------------------------------
*****USING WILDCARD CHARACTERS*****

SELECT last_name FROM employees WHERE last_name LIKE '_o%' ;
SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\';
-------------------------------------------------------------------------
*****USINIG NULL CONDITION*****

SELECT LAST_NAME,MANAGER_ID FROM employees WHERE MANAGER_ID IS NULL;
SELECT LAST_NAME,JOB_ID,COMMISSION_PCT FROM employees WHERE commission_pct IS NULL;
-------------------------------------------------------------------------
*****USING AND OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM EMPLOYEES WHERE SALARY >=10000 AND JOB_ID LIKE '%MAN%' ;
-------------------------------------------------------------------------
*****USING OR OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM employees WHERE SALARY >=10000 OR JOB_ID LIKE '%MAN%';
-------------------------------------------------------------------------
*****USING NOT OPERATOR*****

SELECT LAST_NAME,JOB_ID FROM employees WHERE JOB_ID NOT IN ('IT_PROG','ST_CLERK','SA_REP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE JOB_ID NOT IN ('AC_ACCOUNT','AD_VP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE SALARY NOT BETWEEN 10000 AND 15000;
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE last_name NOT LIKE '%A%';
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE commission_pct IS NOT NULL;
-------------------------------------------------------------------------
*****RULES OF PRECEDENCE*****

SELECT LAST_NAME,JOB_ID,SALARY FROM employees WHERE JOB_ID = 'SA_REP' OR job_id= 'AD_PRES' AND SALARY >15000;
SELECT last_name, job_id, salary FROM employees WHERE (job_id = 'SA_REP' OR job_id = 'AD_PRES') AND salary > 15000;
-------------------------------------------------------------------------
*****USING ORDER BY CLAUSE*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date ;
-------------------------------------------------------------------------
*****USING SORTING*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date DESC;
SELECT EMPLOYEE_ID,LAST_NAME,SALARY*12 AS ANNSAL FROM employees ORDER BY ANNSAL;
SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM employees ORDER BY 4;
SELECT LAST_NAME,DEPARTMENT_ID,SALARY FROM employees ORDER BY DEPARTMENT_ID, salary DESC;
-------------------------------------------------------------------------
*****Using the Single-Ampersand Substitution Variable*****

SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
SELECT EMPLOYEE_ID FROM employees;
-------------------------------------------------------------------------
*****Character and Date Values with Substitution Variables*****

SELECT last_name, department_id, salary*12 FROM employees WHERE job_id = '&job_title' ;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT * FROM EMPLOYEES;
-------------------------------------------------------------------------
*****Specifying Column Names, Expressions, and Text*****

SELECT employee_id, last_name, job_id,&column_name FROM employees WHERE &condition ORDER BY &order_column ;
-------------------------------------------------------------------------
*****Using the Double-Ampersand Substitution Variable*****

SELECT employee_id, last_name, job_id, &&column_name FROM employees ORDER BY &column_name ;
-------------------------------------------------------------------------
*****Using the DEFINE Command*****

DEFINE employee_num = 101 SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
-------------------------------------------------------------------------


SYNTAX: SELECT *|{[DISTINCT] column [alias],...} FROM table;

In the syntax:

SELECT Is a list of one or more columns

* Selects all columns

DISTINCT Suppresses duplicates

column|expression Selects the named column or the expression

alias Gives different headings to the selected columns

FROM table Specifies the table containing the columns

-------------------------------------------------------------------------

*****SELECTING ALL COLUMNS*****

SELECT *FROM departments;

*****SELECTING SPECIFIC COLUMNS*****

SELECT DEPARTMENT_ID,DEPARTMENT_NAME FROM departments;
SELECT DEPARTMENT_ID,LOCATION_ID FROM departments;
-------------------------------------------------------------------------
*****COLUMN HEADING DEFAULTS*****

SELECT LAST_NAME,HIRE_DATE,SALARY FROM employees;
-------------------------------------------------------------------------
*****USING AIRTHEMATIC OPERATIONS*****

SELECT LAST_NAME,SALARY,SALARY+300 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300, salary-100 FROM employees;
Retrieving Data Using the SQL SELECT Statement
-------------------------------------------------------------------------
*****OPERATOR PRECEDENCE*****

SELECT LAST_NAME,SALARY,12*SALARY+100 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300-100 FROM employees;
-------------------------------------------------------------------------
*****DEFINING A NULL VALUE*****

SELECT LAST_NAME,JOB_ID,SALARY,COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****NULL VALUES IN ARITHEMATIC EXPRESSIONS*****

SELECT LAST_NAME,JOB_ID,12*SALARY*COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****USING COLUMN ALIASES*****

SELECT LAST_NAME AS NAME,SALARY AS SAL FROM employees;
-------------------------------------------------------------------------
*****USING CONCATENATION OPERATOR*****

SELECT LAST_NAME||JOB_ID AS "EMPLOYEES" FROM employees;
-------------------------------------------------------------------------
*****USING LITERAL CHARACTER STRING*****

SELECT LAST_NAME || ' is a ' ||JOB_ID AS "EMPLOYEE DETAILS" FROM employees;
SELECT LAST_NAME ||' : 1MONTH SALARY =  '||SALARY MONTHLY FROM EMPLOYEES;
-------------------------------------------------------------------------
*****ALTERNATIVE QUOTE (q) OPERATOR*****

SELECT DEPARTMENT_NAME || '  DEPARTMENTS MANAGER ID:  '|| MANAGER_ID AS "DEPARTMENT AND MANAGER" FROM DEPARTMENTS;
-------------------------------------------------------------------------
*****DUPLICATE ROWS*****

SELECT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT first_name, last_name, job_id, salary*12 AS "Yearly Sal" FROM employees;
-------------------------------------------------------------------------
*******-----Restricting and Sorting Data-----*****

Use the WHERE clause to restrict rows of output:

– Use the comparison conditions
– Use the BETWEEN, IN, LIKE, and NULL operators
– Apply the logical AND, OR, and NOT operators

• Use the ORDER BY clause to sort rows of output:
• Use ampersand substitution to restrict and sort output at
run time

SYNTAX:
SELECT {*|[DISTINCT] column|expression [alias],...} FROM table [WHERE condition(s)] [ORDER BY {column, expr, alias} [ASC|DESC]] ;
SELECT *|{[DISTINCT] column|expression [alias],...} FROM table [WHERE logical expression(s)];

Limiting the Rows That Are Selected
• Restrict the rows that are returned by using the WHERE
clause:
• The WHERE clause follows the FROM clause.
-------------------------------------------------------------------------
*****USING THE WHERE CLAUSE*****

SELECT employee_id, last_name, job_id, department_id FROM employees WHERE department_id = 90 ;
SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE department_id=10;
-------------------------------------------------------------------------
*****CHARACTER STRINGS AND DATES*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME = 'WHALEN';
SELECT LAST_NAME FROM EMPLOYEES WHERE HIRE_DATE = '17-OCT-03';
-------------------------------------------------------------------------
*****USING COMPARISION OPERATORS*****

SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary<=3000;
SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary>=3000;
-------------------------------------------------------------------------
*****USING BETWEEN OPERATORS*****

SELECT LAST_NAME,SALARY FROM employees WHERE SALARY BETWEEN 2500 AND 3500;
SELECT LAST_NAME FROM EMPLOYEES WHERE last_name BETWEEN 'KING' AND 'SMITH';
-------------------------------------------------------------------------
*****USING IN OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,SALARY,MANAGER_ID FROM EMPLOYEES WHERE MANAGER_ID IN (100,101,200);
SELECT EMPLOYEE_ID,MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME IN ('KOCHHAR','VARGAS');
SELECT employee_id, manager_id, department_id FROM employees WHERE last_name IN ('Hartstein', 'Vargas');
-------------------------------------------------------------------------
*****USING LIKE OPERATOR*****

SELECT FIRST_NAME FROM EMPLOYEES WHERE FIRST_NAME LIKE 'S%';
SELECT LAST_NAME,HIRE_DATE FROM EMPLOYEES WHERE HIRE_DATE LIKE '%05';
-------------------------------------------------------------------------
*****USING WILDCARD CHARACTERS*****

SELECT last_name FROM employees WHERE last_name LIKE '_o%' ;
SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\';
-------------------------------------------------------------------------
*****USINIG NULL CONDITION*****

SELECT LAST_NAME,MANAGER_ID FROM employees WHERE MANAGER_ID IS NULL;
SELECT LAST_NAME,JOB_ID,COMMISSION_PCT FROM employees WHERE commission_pct IS NULL;
-------------------------------------------------------------------------
*****USING AND OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM EMPLOYEES WHERE SALARY >=10000 AND JOB_ID LIKE '%MAN%' ;
-------------------------------------------------------------------------
*****USING OR OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM employees WHERE SALARY >=10000 OR JOB_ID LIKE '%MAN%';
-------------------------------------------------------------------------
*****USING NOT OPERATOR*****

SELECT LAST_NAME,JOB_ID FROM employees WHERE JOB_ID NOT IN ('IT_PROG','ST_CLERK','SA_REP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE JOB_ID NOT IN ('AC_ACCOUNT','AD_VP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE SALARY NOT BETWEEN 10000 AND 15000;
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE last_name NOT LIKE '%A%';
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE commission_pct IS NOT NULL;
-------------------------------------------------------------------------
*****RULES OF PRECEDENCE*****

SELECT LAST_NAME,JOB_ID,SALARY FROM employees WHERE JOB_ID = 'SA_REP' OR job_id= 'AD_PRES' AND SALARY >15000;
SELECT last_name, job_id, salary FROM employees WHERE (job_id = 'SA_REP' OR job_id = 'AD_PRES') AND salary > 15000;
-------------------------------------------------------------------------
*****USING ORDER BY CLAUSE*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date ;
-------------------------------------------------------------------------
*****USING SORTING*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date DESC;
SELECT EMPLOYEE_ID,LAST_NAME,SALARY*12 AS ANNSAL FROM employees ORDER BY ANNSAL;
SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM employees ORDER BY 4;
SELECT LAST_NAME,DEPARTMENT_ID,SALARY FROM employees ORDER BY DEPARTMENT_ID, salary DESC;
-------------------------------------------------------------------------
*****Using the Single-Ampersand Substitution Variable*****

SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
SELECT EMPLOYEE_ID FROM employees;
-------------------------------------------------------------------------
*****Character and Date Values with Substitution Variables*****

SELECT last_name, department_id, salary*12 FROM employees WHERE job_id = '&job_title' ;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT * FROM EMPLOYEES;
-------------------------------------------------------------------------
*****Specifying Column Names, Expressions, and Text*****

SELECT employee_id, last_name, job_id,&column_name FROM employees WHERE &condition ORDER BY &order_column ;
-------------------------------------------------------------------------
*****Using the Double-Ampersand Substitution Variable*****

SELECT employee_id, last_name, job_id, &&column_name FROM employees ORDER BY &column_name ;
-------------------------------------------------------------------------
*****Using the DEFINE Command*****

DEFINE employee_num = 101 SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
-------------------------------------------------------------------------


SYNTAX: SELECT *|{[DISTINCT] column [alias],...} FROM table;

In the syntax:

SELECT Is a list of one or more columns

* Selects all columns

DISTINCT Suppresses duplicates

column|expression Selects the named column or the expression

alias Gives different headings to the selected columns

FROM table Specifies the table containing the columns

-------------------------------------------------------------------------

*****SELECTING ALL COLUMNS*****

SELECT *FROM departments;

*****SELECTING SPECIFIC COLUMNS*****

SELECT DEPARTMENT_ID,DEPARTMENT_NAME FROM departments;
SELECT DEPARTMENT_ID,LOCATION_ID FROM departments;
-------------------------------------------------------------------------
*****COLUMN HEADING DEFAULTS*****

SELECT LAST_NAME,HIRE_DATE,SALARY FROM employees;
-------------------------------------------------------------------------
*****USING AIRTHEMATIC OPERATIONS*****

SELECT LAST_NAME,SALARY,SALARY+300 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300, salary-100 FROM employees;
Retrieving Data Using the SQL SELECT Statement
-------------------------------------------------------------------------
*****OPERATOR PRECEDENCE*****

SELECT LAST_NAME,SALARY,12*SALARY+100 FROM employees;
SELECT LAST_NAME,SALARY,SALARY+300-100 FROM employees;
-------------------------------------------------------------------------
*****DEFINING A NULL VALUE*****

SELECT LAST_NAME,JOB_ID,SALARY,COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****NULL VALUES IN ARITHEMATIC EXPRESSIONS*****

SELECT LAST_NAME,JOB_ID,12*SALARY*COMMISSION_PCT FROM employees;
-------------------------------------------------------------------------
*****USING COLUMN ALIASES*****

SELECT LAST_NAME AS NAME,SALARY AS SAL FROM employees;
-------------------------------------------------------------------------
*****USING CONCATENATION OPERATOR*****

SELECT LAST_NAME||JOB_ID AS "EMPLOYEES" FROM employees;
-------------------------------------------------------------------------
*****USING LITERAL CHARACTER STRING*****

SELECT LAST_NAME || ' is a ' ||JOB_ID AS "EMPLOYEE DETAILS" FROM employees;
SELECT LAST_NAME ||' : 1MONTH SALARY =  '||SALARY MONTHLY FROM EMPLOYEES;
-------------------------------------------------------------------------
*****ALTERNATIVE QUOTE (q) OPERATOR*****

SELECT DEPARTMENT_NAME || '  DEPARTMENTS MANAGER ID:  '|| MANAGER_ID AS "DEPARTMENT AND MANAGER" FROM DEPARTMENTS;
-------------------------------------------------------------------------
*****DUPLICATE ROWS*****

SELECT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID FROM EMPLOYEES;
SELECT DISTINCT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT first_name, last_name, job_id, salary*12 AS "Yearly Sal" FROM employees;
-------------------------------------------------------------------------
*******-----Restricting and Sorting Data-----*****

Use the WHERE clause to restrict rows of output:

– Use the comparison conditions
– Use the BETWEEN, IN, LIKE, and NULL operators
– Apply the logical AND, OR, and NOT operators

• Use the ORDER BY clause to sort rows of output:
• Use ampersand substitution to restrict and sort output at
run time

SYNTAX:
SELECT {*|[DISTINCT] column|expression [alias],...} FROM table [WHERE condition(s)] [ORDER BY {column, expr, alias} [ASC|DESC]] ;
SELECT *|{[DISTINCT] column|expression [alias],...} FROM table [WHERE logical expression(s)];

Limiting the Rows That Are Selected
• Restrict the rows that are returned by using the WHERE
clause:
• The WHERE clause follows the FROM clause.
-------------------------------------------------------------------------
*****USING THE WHERE CLAUSE*****

SELECT employee_id, last_name, job_id, department_id FROM employees WHERE department_id = 90 ;
SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE department_id=10;
-------------------------------------------------------------------------
*****CHARACTER STRINGS AND DATES*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME = 'WHALEN';
SELECT LAST_NAME FROM EMPLOYEES WHERE HIRE_DATE = '17-OCT-03';
-------------------------------------------------------------------------
*****USING COMPARISION OPERATORS*****

SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary<=3000;
SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE salary>=3000;
-------------------------------------------------------------------------
*****USING BETWEEN OPERATORS*****

SELECT LAST_NAME,SALARY FROM employees WHERE SALARY BETWEEN 2500 AND 3500;
SELECT LAST_NAME FROM EMPLOYEES WHERE last_name BETWEEN 'KING' AND 'SMITH';
-------------------------------------------------------------------------
*****USING IN OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,SALARY,MANAGER_ID FROM EMPLOYEES WHERE MANAGER_ID IN (100,101,200);
SELECT EMPLOYEE_ID,MANAGER_ID,DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME IN ('KOCHHAR','VARGAS');
SELECT employee_id, manager_id, department_id FROM employees WHERE last_name IN ('Hartstein', 'Vargas');
-------------------------------------------------------------------------
*****USING LIKE OPERATOR*****

SELECT FIRST_NAME FROM EMPLOYEES WHERE FIRST_NAME LIKE 'S%';
SELECT LAST_NAME,HIRE_DATE FROM EMPLOYEES WHERE HIRE_DATE LIKE '%05';
-------------------------------------------------------------------------
*****USING WILDCARD CHARACTERS*****

SELECT last_name FROM employees WHERE last_name LIKE '_o%' ;
SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\';
-------------------------------------------------------------------------
*****USINIG NULL CONDITION*****

SELECT LAST_NAME,MANAGER_ID FROM employees WHERE MANAGER_ID IS NULL;
SELECT LAST_NAME,JOB_ID,COMMISSION_PCT FROM employees WHERE commission_pct IS NULL;
-------------------------------------------------------------------------
*****USING AND OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM EMPLOYEES WHERE SALARY >=10000 AND JOB_ID LIKE '%MAN%' ;
-------------------------------------------------------------------------
*****USING OR OPERATOR*****

SELECT EMPLOYEE_ID,LAST_NAME,JOB_ID,SALARY FROM employees WHERE SALARY >=10000 OR JOB_ID LIKE '%MAN%';
-------------------------------------------------------------------------
*****USING NOT OPERATOR*****

SELECT LAST_NAME,JOB_ID FROM employees WHERE JOB_ID NOT IN ('IT_PROG','ST_CLERK','SA_REP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE JOB_ID NOT IN ('AC_ACCOUNT','AD_VP');
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE SALARY NOT BETWEEN 10000 AND 15000;
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE last_name NOT LIKE '%A%';
SELECT LAST_NAME,JOB_ID FROM EMPLOYEES WHERE commission_pct IS NOT NULL;
-------------------------------------------------------------------------
*****RULES OF PRECEDENCE*****

SELECT LAST_NAME,JOB_ID,SALARY FROM employees WHERE JOB_ID = 'SA_REP' OR job_id= 'AD_PRES' AND SALARY >15000;
SELECT last_name, job_id, salary FROM employees WHERE (job_id = 'SA_REP' OR job_id = 'AD_PRES') AND salary > 15000;
-------------------------------------------------------------------------
*****USING ORDER BY CLAUSE*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date ;
-------------------------------------------------------------------------
*****USING SORTING*****

SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM EMPLOYEES ORDER BY hire_date DESC;
SELECT EMPLOYEE_ID,LAST_NAME,SALARY*12 AS ANNSAL FROM employees ORDER BY ANNSAL;
SELECT LAST_NAME,JOB_ID,DEPARTMENT_ID,HIRE_DATE FROM employees ORDER BY 4;
SELECT LAST_NAME,DEPARTMENT_ID,SALARY FROM employees ORDER BY DEPARTMENT_ID, salary DESC;
-------------------------------------------------------------------------
*****Using the Single-Ampersand Substitution Variable*****

SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
SELECT EMPLOYEE_ID FROM employees;
-------------------------------------------------------------------------
*****Character and Date Values with Substitution Variables*****

SELECT last_name, department_id, salary*12 FROM employees WHERE job_id = '&job_title' ;
SELECT DEPARTMENT_ID,JOB_ID FROM EMPLOYEES;
SELECT * FROM EMPLOYEES;
-------------------------------------------------------------------------
*****Specifying Column Names, Expressions, and Text*****

SELECT employee_id, last_name, job_id,&column_name FROM employees WHERE &condition ORDER BY &order_column ;
-------------------------------------------------------------------------
*****Using the Double-Ampersand Substitution Variable*****

SELECT employee_id, last_name, job_id, &&column_name FROM employees ORDER BY &column_name ;
-------------------------------------------------------------------------
*****Using the DEFINE Command*****

DEFINE employee_num = 101 SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
-------------------------------------------------------------------------