Tuesday, May 18, 2010

E. F. Codd’s 12 Rules by anil nain 9416077273

E. F. Codd’s 12 Rules by anil nain 9416077273


E. F. Codd has defined twelve rules that should be satisfied by any DBMS to be benchmarked as a RDBMS. These twelve rules are the guidelines on which all the RDBMS like ORACLE, INGRES, SYBASE, INFORMIX are based.
Rule One: The Information Rule
All information in a relational database is represented explicitly at the logical level and in exactly one way – by values in tables.
Rule Two: The Guaranteed Rule
Each and every datum in a relational database is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.
Rule Three: Systematic Treatment of Null Values
Null values are supported for representing missing information and inapplicable information in a systematic way independent of data type.
Rule Four: Dynamic On-line Catalog Based on the Relational Model
The database description is represented at the logical level in the same way as ordinary data so that authorized users can apply the same relational language to its interrogation as they apply to the regular date.
Rule Five: Comprehensive Data Sub-language Rule
A relational system may support several languages and various modes terminal use. However, there must be at least one language whose statements can express all of the following:
Data Definition, View Definition, Data Manipulation, Integrity constraint, Authorization, Transaction Boundaries.
Rule Six: View Updating Rule
All views that are theoretically updateable are also updateable by the system.
Rule Seven: High-level Insert, Update, and Delete
The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of the data but also to the insertion, updation and deletion.
Rule Eight: Physical Data Independence
Application programmes and terminal activities remain logically unimpaired whenever any changes are made in either storage representation or access methods.
Rule Nine: Logical Data Independence
Application programmes and terminal activities remain logically unimpaired when information-preserving changes of any kind that theoretically permitted modifications are made to the base tables.
Rule Ten: Integrity Independence
Integrity constraints specific to a particular relational database must be definable in the relational data sub-language and storable in the catalogue, not in the application programmes.
Rule Eleven: Distribution Independence
The data manipulation data sub-language of a Relational DBMS must enable application programmes and enquires to remain logically the same whether data is physically centralized or distributed.


Rule Twelve: Non-Subversion Rule
If a Relational system has a low level language, that low level cannot be used to subvert or bypass the integrity rules and constraints expressed in the higher-level relational languages.
E. F. Codd’s 12 Rules by anil nain 9416077273

Friday, March 19, 2010

EVENT AND EVENT HANDLING BY ANIL NAIN 9416077273



What Is an Event?
Application programmers (the folks who make the everyday programs you use for Windows or Macintosh)
have long known that the key to graphical user interface (GUI) programming is events. So, what is an event,
and why are events so important? To answer that question, take a closer look at GUIs.
A GUI is, at its most base form, a large menu that lets the user choose what he wants to do. The problem is that
how the user does this choosing is based on a lot of complex interactions: keys being pressed, keys being
released, the mouse moving, a mouse button being pressed—you get the idea. Each one of these interactions is
an event. It occurs at a specific time and may have information associated with it. (The key that was pressed,
for example.) Now, events aren't limited to forms of user input. Things such as timers, network connections,
and file I/O also can create events. Basically, anytime you are working with something external to your code,
whether that is the hard disk, the user, or even time, you will be working with events.
Methods of Event Handling
There are two main methods to work with events in Flash MX: callbacks and listeners. Both have their
strengths and weaknesses as well as situations for which they are best suited. The most important thing to
remember about both methods is that organization and documentation are key to writing maintainable code.
Callbacks
The first method of working with events is known as a callback. Callbacks take advantage of the fact that
ActionScript is a highly forgiving language. In particular, callbacks execute a function that doesn't exist, and
Flash won't generate an error or even complain. Some forms of callbacks also utilize the fact that you can
overwrite any variable in Flash at any time, which includes functions.
The quick-and-dirty explanation of a callback is when an event occurs, the object that is the event's source tries
to execute a specific function. This may seem a bit confusing, but after you've read a bit more and seen them in
action, you'll see that callbacks are pretty simple.
A good example of a callback in action is the XML class. Now, I'm not going to get into the ins and outs of
XML quite yet, instead I'll go into how the XML class utilizes callbacks.
When you create an XML object your goal is to load XML formatted data into it from a source that can't
deliver the XML instantaneously, such as a hard disk, or more commonly for Flash, an Internet connection.
Therefore, your code needs to be able to deal with this latency. An XML object does this by using an event
callback.

The 15 most difficult questions you'll be asked on a job interview BY anil nain 9416077273

The 15 most difficult questions you'll be asked on a job interview
Being prepared is half the battle.
If you are one of those executive types unhappy at your present post and embarking on a New Year's resolution to find a new one, here's a helping hand. The job interview is considered to be the most critical aspect of every expedition that brings you face-to- face with the future boss. One must prepare for it with the same tenacity and quickness as one does for a fencing tournament or a chess match.
1. Tell me about yourself.
Since this is often the opening question in an interview, be extracareful that you don't run off at the mouth. Keep your answer to a minute or two at most. Cover four topics: early years, education, work history, and recent career experience. Emphasize this last subject. Remember that this is likely to be a warm-up question. Don't waste your best points on it.
2. What do you know about our organization?
You should be able to discuss products or services, revenues, reputation, image, goals, problems, management style, people, history and philosophy. But don't act as if you know everything about the place. Let your answer show that you have taken the time to do some research, but don't overwhelm the interviewer, and make it clear that you wish to learn more.
You might start your answer in this manner: "In my job search, I've investigated a number of companies.
Yours is one of the few that interests me, for these reasons..."
Give your answer a positive tone. Don't say, "Well, everyone tells me that you're in all sorts of trouble, and that's why I'm here", even if that is why you're there.
3. Why do you want to work for us?
The deadliest answer you can give is "Because I like people." What else would you like-animals?
Here, and throughout the interview, a good answer comes from having done your homework so that you can speak in terms of the company's needs. You might say that your research has shown that the company is doing things you would like to be involved with, and that it's doing them in ways that greatly interest you. For example, if the organization is known for strong management, your answer should mention that fact and show that you would like to be a part of that team. If the company places a great deal of emphasis on research and development, emphasize the fact that you want to create new things and that you know this is a place in which such activity is encouraged. If the organization stresses financial controls, your answer should mention a reverence for numbers.
If you feel that you have to concoct an answer to this question - if, for example, the company stresses research, and you feel that you should mention it even though it really doesn't interest you- then you probably should not be taking that interview, because you probably shouldn't be considering a job with that organization.
Your homework should include learning enough about the company to avoid approaching places where you wouldn't be able -or wouldn't want- to function. Since most of us are poor liars, it's difficult to con anyone in an interview. But even if you should succeed at it, your prize is a job you don't really want.
4. What can you do for us that someone else can't?
Here you have every right, and perhaps an obligation, to toot your own horn and be a bit egotistical. Talk about your record of getting things done, and mention specifics from your resume or list of career accomplishments. Say that your skills and interests, combined with this history of getting results, make you valuable. Mention your ability to set priorities, identify problems, and use your experience and energy to solve them.
5. What do you find most attractive about this position? What seems least attractive about it?
List three or four attractive factors of the job, and mention a single, minor, unattractive item.
6. Why should we hire you?
Create your answer by thinking in terms of your ability, your experience, and your energy. (See question 4.)
7. What do you look for in a job?
Keep your answer oriented to opportunities at this organization. Talk about your desire to perform and be recognized for your contributions. Make your answer oriented toward opportunity rather than personal security.
8. Please give me your defintion of [the position for which you are being interviewed].
Keep your answer brief and taskoriented. Think in in terms of responsibilities and accountability. Make sure that you really do understand what the position involves before you attempt an answer. If you are not certain. ask the interviewer; he or she may answer the question for you.
9. How long would it take you to make a meaningful contribution to our firm?
Be realistic. Say that, while you would expect to meet pressing demands and pull your own weight from the first day, it might take six months to a year before you could expect to know the organization and its needs well enough to make a major contribution.
10. How long would you stay with us?
Say that you are interested in a career with the organization, but admit that you would have to continue to feel challenged to remain with any organization. Think in terms of, "As long as we both feel achievement-oriented."
11. Your resume suggests that you may be over-qualified or too experienced for this position. What's Your opinion?
Emphasize your interest in establishing a long-term association with the organization, and say that you assume that if you perform well in his job, new opportunities will open up for you. Mention that a strong company needs a strong staff. Observe that experienced executives are always at a premium. Suggest that since you are so wellqualified, the employer will get a fast return on his investment. Say that a growing, energetic company can never have too much talent.
12. What is your management style?
You should know enough about the company's style to know that your management style will complement it. Possible styles include: task oriented (I'll enjoy problem-solving identifying what's wrong, choosing a solution and implementing it"), results-oriented ("Every management decision I make is determined by how it will affect the bottom line"), or even paternalistic ("I'm committed to taking care of my subordinates and pointing them in the right direction").
A participative style is currently quite popular: an open-door method of managing in which you get things done by motivating people and delegating responsibility.
As you consider this question, think about whether your style will let you work hatppily and effectively within the organization.
13. Are you a good manager? Can you give me some examples? Do you feel that you have top managerial potential?
Keep your answer achievementand ask-oriented. Rely on examples from your career to buttress your argument. Stress your experience and your energy.
14. What do you look for when You hire people?
Think in terms of skills. initiative, and the adaptability to be able to work comfortably and effectively with others. Mention that you like to hire people who appear capable of moving up in the organization.
15. Have you ever had to fire people? What were the reasons, and how did you handle the situation?
Admit that the situation was not easy, but say that it worked out well, both for the company and, you think, for the individual. Show that, like anyone else, you don't enjoy unpleasant tasks but that you can resolve them efficiently and -in the case of firing someone- humanely.

Monday, February 8, 2010

Relational Model Concepts by anil nain

Relational Model Concepts

The relational model is an abstract theory of data that is based on certain aspects of mathematics (principally set theory and predicate logic).

The principles of relational model were originally laid down in 1969-70 by Dr. E.F. Codd at that time a member of IBM. Relational model is a way of looking at data. The relational model is concerned with three aspects of data: Structures, data integrity, manipulation(for example join, projection etc.)

1. Structure aspects: the data in the database is perceived by the user as a table. It means database arranged in the tables & collection of tables called database. Structure means design view of database like data type, its size etc.

2. Integrity aspect: Those tables that satisfy certain integrity constraints like domain constraints, entity integrity, referential integrity and operational constraints.

3. Manipulative aspects: The operators available for the user for manipulating those tables into database e.g. for purpose of retrieval of data like projection, join and restrict.

Top

Relational Model Constraining

PURPOSE: Used to validate data entered for the specified columns (s) namely:

There are two types of constraints

· Table Constraint

· Column

Table Constraint

If the constraint spans across multiple columns, the user will have to use table level constraints. If the data constraint attached to a specific cell in a table references the contents of another cell in the table, then the user will have to use table level constraints.

Primary key as a table level constraint:

E.g. Create table sales-order-details (s_order_no var char2 (6),

Product_no varchar2(6),…. PRIMARY KEY (S_order_no, product no.));

Column Level Constraint

If the constraints are defined with the column definition, it is called as a column level constraint. They are local to a specific column.

Primary key as a column level constraint

Create table client (client _no varchar 2(6) Primary key…);

by anil nain

Thursday, October 8, 2009

Granting And Revoking Permissions by anil nain


Granting And Revoking Permissions by anil nain
Permission on the objects created by the use
The objects created by one user are not accessible by another user unless the owner of those objects gives such permission to other user. These permissions cab be given by using the Grant statement. One user can grant permission to another user if he is the owner of the object of has the permission to grant access to other users.
Granting Permissions Using Grant Statement
The Grant statement provides various types of access to database objects such as tables, views and sequence. Granting And Revoking Permissions by anil nain
Syntax
GRANT {object privileges}
ON objectname
TO username
[WITH GRANT OPTION];
Object Privileges
Each object privilege that is granted authorizes the grantee to perform some operation on the object. The user can granto all the privileges or grant only specific object privileges.
The list object privileges is as follows:
· ALTER : allows the grantee to change the table definition with the ALTER
TABLE command
· DELETE : allows the grantee to remove the records from the table eith the DELETE
Command.
· INDEX : allows the grantee to create an index on the table with the CREATE INDEX
Command.
· INSERT : allows the grantee to add records to the table with the INSERT command.
· SELECT : allows the grantee to query to the table with the INSERT command.
· UPDATE : allows the grantee to modify to the records in the tables with the UPDATE
Command.
With Grant Option
The WITH GRANT OPTION allows the grantee to grant object privileges to other users.
Example 1
Grant all privileges on the table product_master to the user Pradeep
GRANT ALL
ON product_master
TO pradeep;
Example 2
Grant Select and Update privileges on table client_master to Mita.
GRANT SELECT, UPDATE
ON client_master
TO mita;
Example 3
Grant all privileges on the table client_master to the user Ivan with the grant option.
GRANT ALL
ON client_master
TO ivan
WITH GRANT OPTION;
Granting And Revoking Permissions by anil nain

Thursday, September 17, 2009

Sorting process by anil nain from sonepat haryana


Sorting: Sorting is the process of arranging a set of similar information into an increasing or decreasing order. Sorting is one of the most intellectually pleasing category because the process is so well defined. We can use function qsort( ) for sorting but it will sort array in memory not linked lists. Finally qsort( ) is very effective in general case but not the best for all situations.

Selection Sort : A selection sort selects the element with the lowest value and exchanges it with first element. Then from the remaining n-1 elements, the element with smallest value is found and exchanged with the second element, and so forth. The exchanges continue to the last two elements. For example, if selection sort method is used on the array dcab, each pass would like this:

Initial d c a b
Pass 1 a c d b
Pass 2 a b d c
Pass 3 a b c d
n / 6 log n
Average Number of Exchanges = .


Bubble Sort : The most well known and infamous sort is Bubble Sort. Its popularity is derived from its catchy name and simplicity. However, for general purpose sorting, it is one of the worst sort sorts ever convinced.
The Bubble Sort is an exchange sort. It involves repeated comparisons and, if necessary exchange of adjacent elements. The elements are just like bubbles in a tank of water – each seeks its own level. For example, if bubble sort method is used on the array dcab, each pass is shown here:

Initial d c a b
Pass 1 a d b c
Pass 2 a b d c
Pass 3 a b c d

In analyzing any sort, it is useful to have an idea about comparisons and exchanges performed for best, average, worst case. With Bubble Sort, the no. of comparisons are always same because two for loops repeat the specified no. of times whether the list is initially ordered or not.
1 / 2(n2-n)
Average Number of Exchanges =

Where n is no. of elements to be sorted. The formula is derived from the fact that outer for loop executes n-1 times while inner one n/2 times. Multiplied together results in the preceding formula. For Bubble Sort :
Case No. of Exchanges. Remarks
Best Zero Already Sorted List
Average 1/2(n2-n) -
Worst 1/2(n2-n) -
Sorting process by anil nain from sonepat haryana

Tuesday, September 15, 2009

Binary Search by anil nain


Binary Search: If data to be searched in sorted array, In such cases we use a vastly superior method to find a match named Binary Search which uses the divide and conquer approach. To employ this method, test the middle element. If it is larger than key(element to be searched), test the middle element of the first half; otherwise test the middle element of lower half. Repeat this procedure until a match is found or there is no more elements to test.

For Example, to find number 4 in Array :
1 2 3 4 5 6 7 8 9

A binary search first tests the middle element, which is 5. Since 5 is greater than 4, the search continues in first half, or
1 2 3 4 5

The middle element is now 3. This is less than 4, so first half is discarded, and search continues with
4 5
This time the match is found.

No. of Comparisons (Worst Case) = log2 n
No. of Comparisons (Best Case) = 0
No. of Comparisons for Average Case are somewhat lower as compared to Worst Case.
by anil nain 9416077273