Category Archive: MSSQL

Dec 14

Find the Nth Highest Salary

See on following table records Emp1 Table Emp ID              Salary 1                          10000 2                          25000 3                     …

Continue reading »

Dec 14

Get Record with Highest Amount in Given Hour

We can achieve this approach using join table it self. create table t1(id int, date datetime, amount int) insert into data values (1,’2014-10-11 15:15:00′,150), (2,’2014-10-11 15:20:00′,50), (3,’2014-10-11 18:30:00′,100), (4,’2014-10-11 18:40:00′,10), (5,’2014-10-11 21:10:00′,40), (6,’2014-10-11 21:20:00′,80); Table Structure with data ID         Date                       …

Continue reading »

Oct 02

Prevent from SQL Injection Attack

SQL injection attacks is the malicious attack by hacker. In this process SQL command injected into predefine SQL query in order to alter outcome of the query. When SQL is used to display data on a web page, it is common to let web users input their own search values. SQL Injection Based on 1=1 …

Continue reading »

Sep 29

Rules for a Relational Database

The Most popular database module is a relational database module which is develop by Dr. E. F. Codd in 1970.  This rules proved that database relational or not. Dr. Codd develop 13 rules for relational database module but 12 rules are enough to prove the relational database module. Followings are Rules for relational database module. Rule …

Continue reading »