Tags » SQL

Spatial Queries

To calculate the distance between two place write spatial queries.


Declare @Meterpermile Float = 1609.344;

Declare @Locstart GEOGRAPHY = GEOGRAPHY :: Point (30.7333,76.7794,4326)

Declare @LOCDest GEOGRAPHY = Geography :: Point (23.2825, 72.7774, 4326) 93 more words


Hacking and SQL Injections

Disclaimer: This post is a little technical code wise for SQL!

A friend of mine asked me a very interesting question the other day which I was quite unqualified to answer but did anyway. 2,003 more words

Computer Programming

SQL Queries

Assume a table containing rollno, name & another table containing roll no, subcd, & Marks.

Write a SQL query to:

  1. Display the student having opted maximum number of subjects.
  2. 410 more words

Data Engineering vs. Data Science Infographic

(C) by DataCamp

If you’re interested in the field of analytics, you’ve probably heard the terms Data Engineering and Data Science, but do you know the difference? 57 more words


Using alternate login id without using alternate login id – part 3

Welcome back to part 3 of this not so typical technical article about alternate login id. If you have missed the first two you should start reading them first to fully get my intention behind it. 1,375 more words


More on Comparing Columns across Rows

My previous post got several replies about other ways to compare columns across rows. Here’s my take on all of them.

Test data (again)
create table t as
with data as (
  select level n from dual connect by level <= 3
, tests as (
  select row_number() over (order by a.n, b.n) test_id,
  nullif(a.n, 3) a, 
  nullif(b.n, 3) b,
  case a.n when b.n then 'Same' else 'Different' end status
  from data a, data b
select test_id, tbl, n, status
from tests
unpivot include nulls (n for tbl in(A,B));

select * from t order by 1,2; 484 more words

How to generate custom code from database

Sometimes, we need to generate custom code from database. In this blog post will explain how to generate custom code from database. For example ABC Ltd company wants to store employee data, where they want employee code should be like “EC0001” and auto increment for subsequent employees, it means for employee 2, the code would be “EC0002”. 134 more words