http://library.jain.org/
Friday, September 21, 2012
Know Why to Oppose FDI in retail
http://www.bhaskar.com/article/NAT-pros-and-cons-of-fdi-in-retail-3809347-NOR.html?seq=8&HT1a=
For Entrepreneurs
For Entrepreneurs
- Take Owner ship of whatsoever Happens done by whatever in your Company.
- Business Plan. define what success means.
- good strategy.. well executed is excellent.
- Good strategy.. Not executed is worst.
- high level approach.. don't be afraid to get advice.
Motivation
1. Don’t allow any negative thought At least for 21 Day
2. Don’t let other define your Goal.
3. Make your Body Language Positive.
4. Not to waste your time.
5. Each moment is costly. Be Alert.
6. Be Expressive.
7. Luck is meeting point of alertness of your mind and the Opportunities Passing by.
Thanks to Mr. Rajesh for Motivation.
http://www.rajeshaggarwal.in/index.php
2. Don’t let other define your Goal.
3. Make your Body Language Positive.
4. Not to waste your time.
5. Each moment is costly. Be Alert.
6. Be Expressive.
7. Luck is meeting point of alertness of your mind and the Opportunities Passing by.
Thanks to Mr. Rajesh for Motivation.
http://www.rajeshaggarwal.in/index.php
SUCCESS IS NEVER FINAL......
|
Friday, September 14, 2012
Unix Shell Interview question part-1
Unix Shell Interview question part-1
In shell scripting How to indentify that the previous command was run successfully?
• How will you write a shell script to connect to SQL database?
• What does UID and GID signify?
• What are the different security mechanisms available in UNIX?
Unix is having 3 ways of Security Mechanism:
1. By granting or revoking File permissions. Owner or Admin can change permissions to be given to group or others by using chmod command in Unix.
2. Login is restricted using login credentials (User name and Password).
3. Password is kept in encrypted format in the file /etc/passwd
• What are the different types of shells available in UNIX?
• How many users have logged in and logged out in last five or 10 minutes. Last command gives last logins of user.
• How do you search the string for vowel's occurrence and number of occurrences of each vowel
• What is make used for? How is it different from a shell script?
• How to compare floating point number in shell scripting .
• How to delete a word from a file using shell scripting???
• How to extract the second row of a text-file?
• How to compare two floating point numbers?
• How to compress files by using shell scripting
• What are the steps to take files from unix server to windows?
• How to find see the file which is created today,s date with time after 10 a.m to 5 p.m?
• What is the basic difference u find between a shell script and perl.I mean the advantages of one over
• What is use of "cut" command ? Give some examples. Can we use "awk" or "sed"
• How Connect to a Database in Shell Programming? Please tell me Step by Step?
• What is this line in the shell script do #!/bin/ksh?
• Write a shell script to identify the given string is palindrome or not?
• What is the difference between writing code in shell and editor?
• What is INODE?
• What is the difference between a 'thread' and a 'process'? Process uses its own own state information, use their own address spaces, and only interact with each other via interprocess communication mechanisms (generally managed by the operating system).
Process contains threads.
A single process might contains multiple threads; all threads within a process share the same state and same memory space, and can communicate with each other directly, because they share the same variables.
• What does $# stand for? –total number of parameteres
• What is $*? – All Arguments
• If you have a string "one two three", Which shell command would you use to extract the strings?
• What is the difference between a shell variable that is exported and the one that is not exported?
• How will you list only the empty lines in a file (using grep)? Grep “^$” file_name
Count the number of empty lines:
grep -c '^$' list.txt
• How do you schedule a command to run at 4:00 every morning?
By Cron
0 4 * * *
Syntax
min hour DayOfMonth Month dayOfWeek Command
{MHDMD C} shortcut to remember
1.0 Format
Field name Mandatory? Allowed values Allowed special characters
Minutes Yes 0-59 * / , -
Hours Yes 0-23 * / , -
Day of month Yes 1-31 * / , - ? L W
Month Yes 1-12 or JAN-DEC * / , -
Day of week Yes 0-6 or SUN-SAT * / , - ? L #
Year No 1970–2099 * / , -
• How do u open a read only file in Unix?
• What are the different kinds of loops available in shell script? – For, While, Until,
Name ID Number
/dev/stdin 0
/dev/stdout 1
/dev/stderr 2
W whoami Who Finger [ Or f]
• Tells Idle Time
• who is logged in, and what are they doing
• display your username • identifies the users currently logged in • Tells Idle Time
• display information about users
Difference.
Soft link Hard Link
• Symbolic link ‘is’ a file that only contains the pathname of another file or directory. it is created with ln –s
• Operation on the symbolic link is directed to the file pointed by the it
• A softlink fills the same role as a Windows shortcut
• ln -s [target] [link name]
• Creating a softlink is creating a new file, and will consume a small amount (usually 4KB) of space on your filesystem.
• If the original file is deleted, then all softlinks to it become invalid
• when you create a hardlink, you are creating another pointer to the data location on disk, not a pointer to the existing file.
• That means that editing a hard link of a file is equivalent to editing the original instance of the file.
• You can’t use a hardlink to link to a directory.
Because a hardlink is a direct reference to the underlying filesystem, you can’t hardlink across filesystems.
• With a hardlink, you can delete any of the instances, including the original, and as long as at least one instance exists the file will remain on the system.
•
http://techthrob.com/2010/09/26/softlinks-vs-hardlinks-a-quick-explanation/
In shell scripting How to indentify that the previous command was run successfully?
• How will you write a shell script to connect to SQL database?
• What does UID and GID signify?
• What are the different security mechanisms available in UNIX?
Unix is having 3 ways of Security Mechanism:
1. By granting or revoking File permissions. Owner or Admin can change permissions to be given to group or others by using chmod command in Unix.
2. Login is restricted using login credentials (User name and Password).
3. Password is kept in encrypted format in the file /etc/passwd
• What are the different types of shells available in UNIX?
• How many users have logged in and logged out in last five or 10 minutes. Last command gives last logins of user.
• How do you search the string for vowel's occurrence and number of occurrences of each vowel
• What is make used for? How is it different from a shell script?
• How to compare floating point number in shell scripting .
• How to delete a word from a file using shell scripting???
• How to extract the second row of a text-file?
• How to compare two floating point numbers?
• How to compress files by using shell scripting
• What are the steps to take files from unix server to windows?
• How to find see the file which is created today,s date with time after 10 a.m to 5 p.m?
• What is the basic difference u find between a shell script and perl.I mean the advantages of one over
• What is use of "cut" command ? Give some examples. Can we use "awk" or "sed"
• How Connect to a Database in Shell Programming? Please tell me Step by Step?
• What is this line in the shell script do #!/bin/ksh?
• Write a shell script to identify the given string is palindrome or not?
• What is the difference between writing code in shell and editor?
• What is INODE?
• What is the difference between a 'thread' and a 'process'? Process uses its own own state information, use their own address spaces, and only interact with each other via interprocess communication mechanisms (generally managed by the operating system).
Process contains threads.
A single process might contains multiple threads; all threads within a process share the same state and same memory space, and can communicate with each other directly, because they share the same variables.
• What does $# stand for? –total number of parameteres
• What is $*? – All Arguments
• If you have a string "one two three", Which shell command would you use to extract the strings?
• What is the difference between a shell variable that is exported and the one that is not exported?
• How will you list only the empty lines in a file (using grep)? Grep “^$” file_name
Count the number of empty lines:
grep -c '^$' list.txt
• How do you schedule a command to run at 4:00 every morning?
By Cron
0 4 * * *
Syntax
min hour DayOfMonth Month dayOfWeek Command
{MHDMD C} shortcut to remember
1.0 Format
Field name Mandatory? Allowed values Allowed special characters
Minutes Yes 0-59 * / , -
Hours Yes 0-23 * / , -
Day of month Yes 1-31 * / , - ? L W
Month Yes 1-12 or JAN-DEC * / , -
Day of week Yes 0-6 or SUN-SAT * / , - ? L #
Year No 1970–2099 * / , -
• How do u open a read only file in Unix?
• What are the different kinds of loops available in shell script? – For, While, Until,
Name ID Number
/dev/stdin 0
/dev/stdout 1
/dev/stderr 2
W whoami Who Finger [ Or f]
• Tells Idle Time
• who is logged in, and what are they doing
• display your username • identifies the users currently logged in • Tells Idle Time
• display information about users
Difference.
Soft link Hard Link
• Symbolic link ‘is’ a file that only contains the pathname of another file or directory. it is created with ln –s
• Operation on the symbolic link is directed to the file pointed by the it
• A softlink fills the same role as a Windows shortcut
• ln -s [target] [link name]
• Creating a softlink is creating a new file, and will consume a small amount (usually 4KB) of space on your filesystem.
• If the original file is deleted, then all softlinks to it become invalid
• when you create a hardlink, you are creating another pointer to the data location on disk, not a pointer to the existing file.
• That means that editing a hard link of a file is equivalent to editing the original instance of the file.
• You can’t use a hardlink to link to a directory.
Because a hardlink is a direct reference to the underlying filesystem, you can’t hardlink across filesystems.
• With a hardlink, you can delete any of the instances, including the original, and as long as at least one instance exists the file will remain on the system.
•
http://techthrob.com/2010/09/26/softlinks-vs-hardlinks-a-quick-explanation/
SQL Interview Question part-1
SQL Interview Question part-1
1. What do you understand by SQL?
2. What are different phases of normalization?
3. Explain different kinds of keys used in Database?
4. What is the difference between primary and unique key?
Answer:
Primary key and Unique key enforce Uniqueness of the column on which they are defined.
But by default PK creates Clustered index on Col and Unique creates Non-Clustered index.
PK does not allow Null, whereas Unique Key allows one NULL only.
5. What are constraints?
6. Explain different types of constraints with an example?
1.0 DELETE
The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows . If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.
Note that this operation will cause all DELETE triggers on the table to fire.
2.0 TRUNCATE
TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUNCATE is faster and doesn't use as much undo space as a DELETE.
3.0 DROP
The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed. No DML triggers will be fired. The operation cannot be rolled back.
DELETE
TRUNCATE
DROP
you need to COMMIT or ROLLBACK
few Rows also can be delete
the table structure remains the same,
The operation cannot be rolled back
TRUNCATE is faster than Delete
Used to remove whole table
the table structure remains the same,
The operation cannot be rolled back.
the table structure is also deleted.
JOINS
JOIN: Return rows when there is at least one match in both tables
LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table
RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table
FULL JOIN: Return rows when there is a match in one of the tables
SQL INNER JOIN Keyword
The INNER JOIN keyword return rows when there is at least one match in both tables.
SQL INNER JOIN Syntax
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
Example:
1
SELECT selection_list
2
FROM table_A
3
INNER JOIN table_B ON join_condition
4
WHERE row_conditions.
We can simplify the inner join as
1 SELECT productID,productName,categoryName
2
FROM products, categories
3
WHERE products.categoryID = categories.categoryID
SQL LEFT JOIN (LEFT OUTER JOIN) Keyword
The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2).
SQL LEFT JOIN Syntax
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
PS: In some databases LEFT JOIN is called LEFT OUTER JOIN.
SQL RIGHT JOIN Keyword
PS: In some databases RIGHT JOIN is called RIGHT OUTER JOIN.
The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1).
SQL RIGHT JOIN Syntax
SELECT column_name(s)
FROM table_name1
RIGHT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
SQL FULL JOIN Keyword
The FULL JOIN keyword return rows when there is a match in one of the tables.
SQL FULL JOIN Syntax
SELECT column_name(s)
FROM table_name1
FULL JOIN table_name2
ON table_name1.column_name=table_name2.column_name
4.0 The SQL UNION Operator
The UNION operator is used to combine the result-set of two or more SELECT statements.
Notice that each SELECT statement within the UNION must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order.
i. SQL UNION Syntax
SELECT column_name(s) FROM table_name1
UNION
SELECT column_name(s) FROM table_name2
Note: The UNION operator selects only distinct values by default. To allow duplicate values, use UNION ALL. That’s why union is slower than UNION ALL.
ii. SQL UNION ALL Syntax
SELECT column_name(s) FROM table_name1
UNION ALL
SELECT column_name(s) FROM table_name2
PS: The column names in the result-set of a UNION are always equal to the column names in the first SELECT statement in the UNION.
5.0 Oracle/PLSQL: Oracle System Tables
Below is an alphabetical listing of the Oracle system tables that are commonly used.
System Table
Description
ALL_ARGUMENTS
Arguments in object accessible to the user
ALL_CATALOG
All tables, views, synonyms, sequences accessible to the user
ALL_COL_COMMENTS
Comments on columns of accessible tables and views
ALL_CONSTRAINTS
Constraint definitions on accessible tables
ALL_CONS_COLUMNS
Information about accessible columns in constraint definitions
ALL_DB_LINKS
Database links accessible to the user
ALL_ERRORS
Current errors on stored objects that user is allowed to create
ALL_INDEXES
Descriptions of indexes on tables accessible to the user
ALL_IND_COLUMNS
COLUMNs comprising INDEXes on accessible TABLES
ALL_LOBS
Description of LOBs contained in tables accessible to the user
ALL_OBJECTS
Objects accessible to the user
ALL_OBJECT_TABLES
Description of all object tables accessible to the user
ALL_SEQUENCES
Description of SEQUENCEs accessible to the user
ALL_SNAPSHOTS
Snapshots the user can access
ALL_SOURCE
Current source on stored objects that user is allowed to create
ALL_SYNONYMS
All synonyms accessible to the user
ALL_TABLES
Description of relational tables accessible to the user -- It list the percentage of Used space as well.
ALL_TAB_COLUMNS
Columns of user's tables, views and clusters
ALL_TAB_COL_STATISTICS
Columns of user's tables, views and clusters
ALL_TAB_COMMENTS
Comments on tables and views accessible to the user
ALL_TRIGGERS
Triggers accessible to the current user
ALL_TRIGGER_COLS
Column usage in user's triggers or in triggers on user's tables
ALL_TYPES
Description of types accessible to the user
ALL_UPDATABLE_COLUMNS
Description of all updatable columns
ALL_USERS
Information about all users of the database
ALL_VIEWS
Description of views accessible to the user
DATABASE_COMPATIBLE_LEVEL
Database compatible parameter set via init.ora
DBA_DB_LINKS
All database links in the database
DBA_ERRORS
Current errors on all stored objects in the database
DBA_OBJECTS
All objects in the database
DBA_ROLES
All Roles which exist in the database
DBA_ROLE_PRIVS
Roles granted to users and roles
DBA_SOURCE
Source of all stored objects in the database
DBA_TABLESPACES
Description of all tablespaces
DBA_TAB_PRIVS
All grants on objects in the database
DBA_TRIGGERS
All triggers in the database
DBA_TS_QUOTAS
Tablespace quotas for all users
DBA_USERS
Information about all users of the database
DBA_VIEWS
Description of all views in the database
DICTIONARY
Description of data dictionary tables and views
DICT_COLUMNS
Description of columns in data dictionary tables and views
GLOBAL_NAME
global database name
NLS_DATABASE_PARAMETERS
Permanent NLS parameters of the database
NLS_INSTANCE_PARAMETERS
NLS parameters of the instance
NLS_SESSION_PARAMETERS
NLS parameters of the user session
PRODUCT_COMPONENT_VERSION
version and status information for component products
ROLE_TAB_PRIVS
Table privileges granted to roles
SESSION_PRIVS
Privileges which the user currently has set
SESSION_ROLES
Roles which the user currently has enabled.
SYSTEM_PRIVILEGE_MAP
Description table for privilege type codes. Maps privilege type numbers to type names
TABLE_PRIVILEGES
Grants on objects for which the user is the grantor, grantee, owner, or an enabled role or PUBLIC is the grantee
TABLE_PRIVILEGE_MAP
Description table for privilege (auditing option) type codes. Maps privilege (auditing option) type numbers to type names
COMMAND TYPE
Command names
Data Definition Language (DDL) Statements
· Create, alter, and drop schema objects
· Grant and revoke privileges and roles
[CAD GR]
These are AUTOCOMMIT
6.0 Data Manipulation Language (DML) Statements
· CALL
· DELETE
· EXPLAIN PLAN
· INSERT
· LOCK TABLE
· MERGE
· SELECT
· UPDATE
[UDI-SM]
NOT AUTOCOMMIT
7.0 Transaction Control Statements (TCL)
· COMMIT
· ROLLBACK
· SAVEPOINT
· SET TRANSACTION
Used to manage changes done by DML command
8.0 Session Control Statements
· ALTER SESSION
· SET ROLE
9.0 Data Control Language (DCL)
GRANT
REVOKE
What are the predefined oracle exceptions?
Following is the predefined oracle exceptions
No_data_found
Too_many_rows
Zero_divide
Login_denied
Program_error
Timeout_on_resource
Invalid_cursor
Cursor_already_open
Dup_val_on_index
Explain user defined exceptions in oracle.
User defined exception in oracle are defined by the user. They need to be explicitly raised by the user using the RAISE statement. Oracle is not aware of these exceptions unless declared.
Example:
DECLARE
Trans EXCEPTION;
BEGIN
IF TO_CHAR(SYSDATE, ‘DY’)= ‘SUN’ THEN
RAISE Trans;
END IF
EXCEPTION
WHEN trans THEN
DBMS_OUTPUT.PUT_LINE(‘No transactions today’);
END;
What are SQL functions in oracle?
There are two types of functions –
Single row that operates row by row . Functions that fall under single functions are Date, Numeric, Character, Conversion and miscellaneous function
Group function operates on multiple rows. Functions that fall under group functions are avg, max, min, count, and sum.
CURSOR
A cursor is a variable that runs through the tuples of some relation. This relation can be a stored table, or it can be the answer to some query.
There are different types of cursors but broadly classified into two :
Implicit cursor
Explicit cursor.
Every query that we issue on a database is an implicit cursor for eg. a select, an update, a delete etc.
On the other hand explicit cursor is a user defined cursor eg: cursor explicit_cur.
Subscribe to:
Posts (Atom)