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"
Friday, 19 February 2016
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.
Shopping 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.
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
*********************************************************************************
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
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 ;
-------------------------------------------------------------------------
Tuesday, 26 January 2016
Very proud to be an INDIAN.
Congratulation to all of us.Our national anthem "Jana Gana Mana... "is declared as the "BEST ANTHEM OF THE WORLD"by UNESCO.
Very proud to be an INDIAN.
✨✨ Meaning of our National Anthem ✨✨
Please try to understand the meaning and pronounce it clearly.
Word by word meaning..
Jana = People
Gana = Group
Mana = Mind
Adhinayaka= Leader
Jaya He = Victory
Bharata = India
Bhagya = Destiny
Vidhata = Disposer
Punjaba = Punjab
Sindhu = Indus
Gujarata = Gujarat
Maratha = Marathi Maharashtra
Dravida = South
Utkala = Orissa
Banga = Bengal
Vindhya =Vindhyas
Himachal =Himalay
Yamuna = Yamuna
Ganga = Ganges
Uchchhala = Moving
Jaladhi = Ocean
Taranga = Waves
Tava = Your
Shubh =Auspicious
Naame = name
Jage = Awaken
Tava = Your
Shubha = Auspicious
Aashisha = Blessings
Maage = Ask
Gaahe = Sing
Tava = Your
Jaya = Victory
Gatha = Song
Jana = People
Gana = Group
Mangala = Fortune
Dayaka = Giver
Jay He = Victory Be
Bharata = India
Bhagya = Destiny
Vidhata = Dispenser
Jay He, Jay He, Jay He, Jay Jay Jay Jay He = Victory, Victory, Victory, Victory Forever...
PLEASE SHARE IT AND LET ALL PEOPLE KNOW THE MEANING OF OUR NATIONAL ANTHEM..
Thursday, 31 December 2015
50 Ways to Save Money by Using Common Household Items
Let us hope that our Indian government do not plan for " Fringe Benefit Tax" on these 10 common household items !
50 Ways to Save Money by Using Common Household Items
Which of us doesn’t have toothpaste, rubber bands, or salt at home? There are many items in our homes that have many more uses than we realize, some of which can greatly improve our lives and save us money too. These 10 items mostly can be found in your home already, some probably just lie there, gathering dust. By knowing the extra uses you can get out of each item, you can employ them more effectively when you need them.
Toothpaste - Useful Items
1. Remove ink and lipstick stains
– Leaky pen stained your shirt or pants? Apply some plain toothpaste on it and give it a good scrub, rinse, and repeat until the stain is gone. This trick works for lipstick stains as well.
2. Remove strong odors from your hands
- If you were peeling garlic and can’t seem to get rid of the smell, wash your hands with toothpaste instead of with soap.
3. Prevents fogging of glass surfaces
– This is a trick I learned while diving. Plain toothpaste prevents glass surfaces from fogging, which is important while diving. It also works for bathroom mirrors, glass shower doors, etc.
4. Remove oil stains from walls
– If you left your kid alone for a moment, only to return and discover he or she “decorated” the walls with crayons, then toothpaste is your friend. Grab a brush or microfiber cloth, put on some plain toothpaste and scrub the wall. Follow by using a wet cloth to wipe off the paste and enjoy your clean wall.
5. Polish diamonds
– Grab an old toothbrush, put on some toothpaste and give your diamond ring or earrings a scrub. Use a damp cloth to remove the paste and watch how your diamonds sparkle again.
Rubber Bands - Useful Items
1. Better tool grip
– If you’ve got sweaty hands or you’re trying to unscrew something that was screwed in too tightly, try wrapping the handle of your tool with a few rubber bands. The rubber’s natural qualities will provide for better grip, making every job that much easier. It even works for tightly-sealed jar lids.
2. Prevent glasses from slipping
– If you’re wearing prescription glasses even when you do physical exercise, you can use a rubber band to keep them securely in place. All you need to do is wrap a rubber band around the edges of the temples to keep your glasses from flying off.
3. Cushion falling remotes
– If you have a history of accidentally dropping remote controls, you can wrap them in a couple of rubber bands. The rubber’s elasticity will serve as shock absorbers and will cushion the remotes if / when you drop them.
4. Safely close cabinets
– If you keep cleaning detergents and other poisonous materials in cabinets but want to keep your kids from opening the doors, wrap the handles tightly with a rubber band and keep your kids safe.
5. Revitalize an old broom
– If your broom’s bristles are too frayed, wrap a rubber band around them to keep them together again, which will get your broom to sweep new.
Nail Polish - Useful Items
Source
1. Strengthen screws
– Is the handle of your favorite pot coming loose? Is your cupboard door loosening all the time? Unscrew them, apply clear nail polish to the screw, and then screw it back in and let the nail polish dry. Another benefit is that the polish prevents the screw from rusting.
2. Seal envelopes
– If the adhesive on your envelope is too weak or non-existing, you can substitute it for clear nail polish. Just remember to keep the envelope sealed while the polish is drying.
3. Thread a needle
– Are you struggling with threading a needle? Dip the tip of the thread into a bit of nail polish and let it dry. Now that it’s hard you can thread the needle with ease.
4. Keep jewels from tarnishing
– If you’ve got simple jewelry that might tarnish in time, coat them with a thin layer of clear nail polish. They’ll remain tarnish-free and looking new for a long time.
5. Tell your keys apart
– If you’ve got a bunch of keys that look similar, apply different colored nail polish to the heads of the keys to help you tell them apart in an instant.
Dryer Sheets - Useful Items
Source
1. Shoe deodorizer
– If your sneakers are a source of foul smells, shove a dryer sheet into each shoe and leave them in overnight for odorless shoes come morning. This also works for suitcases and backpacks. To be even more “green”, you can use dryer sheets that have already been through the dryer.
2. Clean tough stains from pans
– Burnt stains not coming off of your pan no matter how much you scrub? Pour water into the pan, pot, or baking dish and leave a dryer sheet in. Give it a few hours and those tough stains will become a thing of the past.
3. Effectively clean dust
– If there are surfaces you want to dust but would rather not use a damp cloth on, substitute it for a dryer sheet, which is effective in removing dust even when it’s dry.
4. Insect repellant
– Mosquitos and bees hate the smell of dryer sheets. You can leave some around you when you sleep or tuck some in hidden corners of the house. Don't smear them on yourelf though, as they contain a lot of chemicals.
5. Remove scum from the shower
– If your shower glass door is filled with scum stains, grab a dryer sheet and scrub them away with ease.
Vaseline - Useful Items
1. Protect your pets’ cracked paws
– If your pet is suffering from dry or cracked paws, rub on some Vaseline and message it into the paw. It’s best to do this after a walk.
2. Prevents mishaps when painting your nails
– If you hate having to clean up after you apply nail polish, rub some Vaseline around the nail to prevent the polish from adhering to that surface.
3. Helps heal sunburns
– Sunburns are unpleasant at best and painful at worst. Apply Vaseline to the burnt areas to help them heal faster and prevent the skin from cracking and peeling.
4. Prevents chafing
– If you suffer from chafing and don’t have talcum powder accessible, you can apply a little Vaseline to the chafing area to protect it.
5. Hides split ends
– No time to go to the hair stylist? Use a little Vaseline on your split ends to hide them.
Pencils - Useful Items
1. Moth repellent
– If you can’t get mothballs, you can use pencil shavings instead. The smell of the shavings is an effective repellant.
2. Fix stuck zippers
– If your zipper is stuck, rub the “teeth” on either side with the pencil’s graphite, it’ll act as a dry lubricant and free the zipper. This also works on old locks.
3. Pincushion substitute
– Doing some sewing but can’t find that darn pin cushion? Stick the needles into the pencil’s eraser to keep them safe for the time being.
4. Temporary earring clasp
– If you lost the back clasp of your earring, cut a piece of the eraser from a pencil and use it as a temporary clasp.
5. Clean the soles of your shoes
– If you stepped in something sticky ( gum) and need to clean it somehow, a pencil will do the work perfectly.
Salt - Useful Items
1. Cleaning vegetables
– The best way to wash vegetables is in a bowl of salt water. The salt and water combination is tough on dirt but harmless to the vegetable.
2. Better tasting coffee
– Sprinkle a little bit of salt in your coffee to make it less acidic and bring out the real coffee flavors.
3. Cheese preserver
– Dip napkins in salt water and use them to wrap pieces of cheese before putting them back in the fridge. The salt prevents mold from forming on the cheese, keeping it fresh for longer.
4. Clean wine stains
– Spilled some wine on your table cloth? Cover it with salt and let it sit for about 30 minutes, and then clear the salt and wash it in the washing machine. The stain will be a thing of the past.
5. Relieve mosquito bites
– If you’ve become a mosquito’s meal and are now scratching yourself raw, dip a napkin or washcloth in salt water and apply to the bites. For tough bites you can add some olive oil.
Vinegar - Useful Items
1. Prevent fabrics from fading
– If you’re worried that your favorite piece of clothing will fade in the wash, soak it in an equal mix of water and vinegar for 15 minutes before the wash. The vinegar will protect the color.
2. Kill weeds
– Did you know that by pouring vinegar on weeds you can effectively kill them?
3. Revive mushy vegetables
– If your veggies have gained a mushy texture, you can fix it in a jiffy by dipping them in a mix of 2 cups of water and a teaspoon of vinegar for 10 minutes. Just remember to rinse them.
4. Clean your keyboard
– Keyboards can get greasy and dirty, but cleaning them can be very easy. Unplug it from the computer, grab a microfiber cloth and dip it in a solution of equal parts water and vinegar, wring it as much as you can, and then wipe the grime off of the keys. If you need to clean between the keys, use cotton swabs.
5. Get rid of the smell of smoke
– If you accidentally burned a dish and now the house stinks of smoke, grab a rag and dip it in vinegar, wring it, and then flap it around the room. It may feel silly, but the vinegar absorbs the smoke particles that make the house smell bad. You should also leave a bowl of vinegar in the kitchen for a few hours to absorb any leftover smell.
Toothpicks - Useful Items
1. Stop boiled water from overflowing
– Scared of leaving a pot on the stove? Stick a toothpick between the pot and the lid. This will allow the steam to escape, preventing the pressure that causes water to overflow.
2. Find the ends of sticky tape with ease
– If you hate struggling with a roll of tape just to find the end, stick a toothpick to the edge before putting the roll away to make it easy to find it next time.
3. Efficiently fry sausages
– By running a toothpick through every pair of sausages, you can make sure that they fry evenly on all sides.
4. Keep young seedlings straight
– Just you’d use a piece of wood as a splint for a young tree, you can stick a few toothpicks around a young seedling to make sure it grows straight up.
5. Paint hard-to-reach corners
– When painting, if you encounter corners, grooves, or crevices that the brush doesn’t reach, you can dip a toothpick in the paint and use it on those areas.
Talcum Powder - Useful Items
1. Easily remove rubber and latex gloves
– If you have problems removing gloves once you’re done using them, pour a bit of talcum into the glove before donning it. Once you’re ready, the glove will come off with ease.
Subscribe to:
Posts (Atom)