Posts

SQL: Keys,Natural Keys, Artificial Keys, Surrogate Keys, Physical Locators

Image
Natural Keys: -A natural key is a subset of attributes that occur in a table and act as a unique identifier. The user sees them. You can go to the external reality and verify them. Example: bar codes on consumer goods (read the package), geographic coordinates (get a GPS), or the VIN on an automobile (read the tag riveted to the dashboard, etched into the windows, and engraved on the engine block). Artificial Keys:- An artificial key is an extra attribute added to the table that is seen by the user. It does not exist in the external reality but can be verified for syntax or check digits inside itself. Example: the open codes in the UPC/EAN scheme that a user can assign to his own stuff. For example, a grocery store not only sells packaged good with preprinted bar codes but also bakes bread in the store and labels them with an open code. The check digits still work, but you have to verify them inside your own enterprise. Exposed Physical LOactors: An exposed physical loca...

It is the Time to Update New IT Skills

Image
Bill Gates is a very rich man today…and do you want to know why? The answer is one word: versions. - Dave Barry, Pulitzer prize-winning American author and columnist It seems IT industry glamour is reducing. Increasing cost, lot of competition, technology advancements. To survive in the market there is only one solution  is to update our IT skills. Daily need to spend 1 or 2 hours to upgrade our IT skills.  Maybe they didn't finish college, but I'll be damned if our famous (and infamous) tech captains of industry, and most of the minions who helped them get there, did one thing quite well—and that's this: they constantly strove to be bigger, better, and badder. Badder to the bone, baby. Meaning that they acquired new skills and upgraded themselves, and they ensured that their teams did the same. These days are no exception, because those who do these things are the ones who will survive the greatest recession since the Depression.  It's not going to be easy...

SQL Query To Get Only Duplicates

The below SQL query we can get only Duplicates: SELECT NAME,EMAIL,COUNT(*) FROM DA31.TABLE1 GROUP BY NAME,EMAIL HAVING COUNT(*) > 1; So, after running this query we get only duplicate rows of NAME and EMAIL.

PL/SQL Interview Questions-Part-1

PL/SQL Interview Questions from Srinimf | Tech.Jobs.Biz.Success

Big SQL Video Tutorial

Image

5 Tips to Become Expert in SQL

5 Tips to Become Expert in SQL from Srinimf | Tech.Jobs.Biz.Success

How to find Top 5 Salaries

Image
Three ways we can do it   To find top 5 salaries: Method-1 WITH RANK_TBL AS(SELECT LASTNAME, SALARY,RANK() OVER (ORDER BY SALARY DESC) AS RANK_NUM  FROM EMP) SELECT * FROM RANK_TBL WHERE RANK_NUM < 6; What is Rank Function? The RANK function orders and ranks a result. In this example, the result in being ranked by SALARY in descending sequence, so the highest salary has a rank of 1. When there is a tie, all rows with the value receive the same rank and an appropriate number of ranks are "skipped". In this example, since there were 2 salary values in second place, the value of 3 is skipped. The result set may be ordered using an ORDER BY for the entire SELECT, and this order need not be the same as the column being ranked. When this is done, 2 sorts may need to be performed to achieve the desired result Method-2 WITH RANK_TBL AS(SELECT LASTNAME, SALARY,DENSE_RANK() OVER (ORDER BY SALARY DESC) AS RANK_NUM FROM EMP) SELECT * FROM RANK_TBL WHERE RAN...