Topics | Search Log Out | Register | Edit Profile
Hide Clipart | Banned/Unbanned User Log | Moderator Login History | Thread Delete/Move Log | Last 30 mins | 1 | 2
Calling SQL XTreme Programmers again

Chalanachithram.com DB » New TF Industry Related » Archive through November 04, 2015 » Calling SQL XTreme Programmers again « Previous Next »
Author Message
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14916
Registered: 02-2009
Posted From: 166.137.8.86

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 03:40 pm:       

Gagu

Now check ur mail

And let me know
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Abhysg
Megastar
Username: Abhysg

Post Number: 26435
Registered: 08-2008
Posted From: 209.133.66.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 03:14 pm:       


Gandhiguevara:

friendship ki vela kadathaamaa? useless vuncle




edo kullu joke le.. oggey
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14915
Registered: 02-2009
Posted From: 166.137.8.86

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 03:01 pm:       

Gagu

Don't use that query
As I said I have to include ones more condition
Then only its perfect

So don't consider that query as final
After lunch I will add condition and will send updated one to u
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Abhysg
Megastar
Username: Abhysg

Post Number: 26434
Registered: 08-2008
Posted From: 209.133.66.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:59 pm:       


Gandhiguevara:

friendship ki vela kadathaamaa? useless vuncle




bank details pampoddu ani septunnav kadoo.. naughty..
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56965
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:56 pm:       


Driverramudu:


Thanks driver kaka....will check and let you know
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56964
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:56 pm:       


Abhysg:

also send your bank a/c details,,, last month jeetham lo neekooda share ivvali.. inta pani sesi pettinanduku


friendship ki vela kadathaamaa? useless vuncle
 

Abhysg
Megastar
Username: Abhysg

Post Number: 26433
Registered: 08-2008
Posted From: 209.133.66.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:24 pm:       


Driverramudu:

Gagu

Check u mail I sent query to you.

I gave enough explanation
Hope u understand well

Let me know if u got any doubts




also send your bank a/c details,,, last month jeetham lo neekooda share ivvali.. inta pani sesi pettinanduku
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14914
Registered: 02-2009
Posted From: 166.137.8.86

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:19 pm:       

Gagu

Check u mail I sent query to you.

I gave enough explanation
Hope u understand well

I forgot to include one more check
discard my email and will send
Updated query soon by today
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14913
Registered: 02-2009
Posted From: 166.137.8.86

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, November 03, 2015 - 02:14 pm:       

Gagu

Check u mail I sent query to you.

I gave enough explanation
Hope u understand well

Let me know if u got any doubts
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Rowdy
Legend
Username: Rowdy

Post Number: 35860
Registered: 01-2010
Posted From: 73.184.45.249

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 09:35 pm:       


Sannayi_nokkulu:

dxxma life undedemo Tn lo salary emo 3 digits per hr, eppudu susina db lo untav....inka work seperatre ga enduku seyyadam ani db lo unde janalatho ne seyistunnav ante nuvvu mamulodivi kadu raja...


 

Sannayi_nokkulu
Side Hero
Username: Sannayi_nokkulu

Post Number: 4803
Registered: 06-2014
Posted From: 68.100.234.172

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 06:53 pm:       


Gandhiguevara:


dxxma life undedemo Tn lo salary emo 3 digits per hr, eppudu susina db lo untav....inka work seperatre ga enduku seyyadam ani db lo unde janalatho ne seyistunnav ante nuvvu mamulodivi kadu raja...
santakam
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56955
Registered: 10-2009
Posted From: 68.52.124.39

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 06:29 pm:       


Simba:

is this some kind of crowd-sourcing project?


yes
 

Simba
Hero
Username: Simba

Post Number: 19217
Registered: 02-2008
Posted From: 104.148.188.118

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 06:21 pm:       


Gandhiguevara:

Calling SQL XTreme Programmers again


is this some kind of crowd-sourcing project?
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56953
Registered: 10-2009
Posted From: 68.52.124.39

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 06:11 pm:       


Chillarodu:

I assume this is your one week work


last week's assignment...Vegas trip lo kudarledhu...yee week kudaa cheyyakapothe inka vegas lone aaduko andhi Rupa
 

Chillarodu
Side Hero
Username: Chillarodu

Post Number: 7811
Registered: 03-2008
Posted From: 128.103.224.124

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 05:43 pm:       


Gandhiguevara:

Yes




Diver kurrodu answer cheppintharuvaatha send him you half weekly salary :D
I assume this is your one week work :-)
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56952
Registered: 10-2009
Posted From: 68.52.124.39

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 05:25 pm:       

Yes
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14911
Registered: 02-2009
Posted From: 166.137.246.25

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, November 02, 2015 - 05:11 pm:       

Gagu

Should we check coffee served every shift atleast once
In a day forevery customer?

Is this is main criteria to check

Correct me if i am wrong
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14900
Registered: 02-2009
Posted From: 76.95.174.87

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, October 30, 2015 - 11:27 pm:       


Gandhiguevara:




If u still need I will write query for you also do u need specific database query or ansi query

This is big confusion always.

I would suggest you next time you mention the database that you are using

Now tell me which database that you are using if not I will write query in ANSI with the common feature

Me going gym now after come back I see your response then I write query
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Abcdefghij
Hero
Username: Abcdefghij

Post Number: 17189
Registered: 02-2007
Posted From: 99.59.193.29

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, October 30, 2015 - 11:19 pm:       

aa data in
customer startdate/enddate, shifts, served yes or no format lo vochetatu pettuko
customer checked in 1/1/2015 at 8.30 am, checked out at 1/3/2015 8.30pm
first find total shifts he is in and # served in that time period by sum you should get it in one sql. unless i missed the question completely.

customer startdate/enddate, shifts, totalserved
cust1, 1/1/2015, 1/3/2015, 1, 4
cust1, 1/1/2015, 1/3/2015, 2, 0
cust1, 1/1/2015, 1/3/2015, 3, 1
cust1, 1/1/2015, 1/3/2015, 4, 5
cust1, 1/1/2015, 1/3/2015, 5, 0
cust1, 1/1/2015, 1/3/2015, 6, 1

three days vunte 6 rows vochetattu...sometimes 5 shifts vundochu 3 days lo etc


leka naku ardam kaleda...
Post by Knf: bittter annai, welcome RS prakasam varaku madi, Prakasm nunchi UA vaaraku meeedi
http://www.chalanachithram.com/cgi-bin/discus/show.cgi?tpc=115&post=5144373#POST5144373
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56937
Registered: 10-2009
Posted From: 8.27.177.130

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, October 30, 2015 - 08:54 pm:       


Driverramudu:


Murthy gaaru naa SQL edhi?
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56935
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 10:41 pm:       


Driverramudu:

did u get the right query


confuse chesinatlunnaaa...neeku scenario ardham ayyindhaa?
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14880
Registered: 02-2009
Posted From: 76.95.174.87

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 10:40 pm:       


Gandhiguevara:



did u get the right query
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56934
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 10:34 pm:       


Liferocks:

Gives all shifts where coffee is NOT served.


per customer raavali bhayya
 

Rowdy
Legend
Username: Rowdy

Post Number: 35830
Registered: 01-2010
Posted From: 12.155.202.69

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 04:10 pm:       


Kkkiran:


into l_counter is not sql, it's plsql


}
edo okati abap lo rasi chupinchandi poni
 

Liferocks
Junior Artist
Username: Liferocks

Post Number: 278
Registered: 01-2009
Posted From: 104.175.209.81

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 03:01 pm:       

select * from t_shifts s where not exists (select 1 from t_checkins c
where c.coffee_served_dt between s.shift_beg_dt and s.shift_end_dt);

Gives all shifts where coffee is NOT served.

You build t_shifts from time_dimension table by selecting range of dates and adding 8 am and 8 pm to construct the shift_beg_dt and shift_end_dt values. One record per shift will end up in this table. You don't need ETL for this, just a query/view will do
 

Abhysg
Megastar
Username: Abhysg

Post Number: 26265
Registered: 08-2008
Posted From: 209.133.66.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 02:20 pm:       


Gandhiguevara:

Hey working from vegas no...Kindaki velthe koorcho betti naakesaaru 5 min lo




nee enkamma... akkada poyindi antha ipudu sql rasi client nundi lagala...

j/k :-)
 

Kkkiran
Junior Artist
Username: Kkkiran

Post Number: 2
Registered: 09-2015
Posted From: 45.117.48.117

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 02:04 pm:       


Rowdy:

INTO l_counter.




into l_counter is not sql, it's plsql}
 

Kkkiran
Junior Artist
Username: Kkkiran

Post Number: 1
Registered: 09-2015
Posted From: 45.117.48.117

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 01:47 pm:       


Ruj:




based on your question, it doesn't matter how many days the guest stayed, only days of our interest is his "checkin and check out dates", remaining all days we can be rest assued that he was served that coffee in all shifts. so your logic for the answer to this question is some thing like this
1. on his checkin date, whether the coffee served before or after his arrival
2. on his check out date , whether the coffee served before or after his departure
3.if you missed out in any one scenario of the above 2 points.. therez ur answer.

select case when checkin_dt < (select coffee_served_dt
from your_table where the_date = checkin_dt) and check_out_dt > (select coffee_served_dt
from your_table where the_date = checked_out_date) then 'Y' else 'N' end "Yeah..we serverhim allshifts" from your_table;

however, i still doubt, whether u got the same data model of the table, where u wud like to store
"Customer ID Customer Name
Time and date Checked in Time and
Date checked out Time " all are constant during the entire period of stay with the other column that changes every day "date of coffee served".

hope i got ur question correctly sir.
 

Rowdy
Legend
Username: Rowdy

Post Number: 35828
Registered: 01-2010
Posted From: 12.155.202.69

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 01:32 pm:       

SELECT COUNT (DISTINCT x y z) FROM T_TAB INTO l_counter.

idi enduku pani cheyyadam ledu? I want the count of distinct values of the combination (x y z) from T_TAB. multiple lines code tho vachestadi ... single line lo ela? :D
 

Ruj
Hero
Username: Ruj

Post Number: 18253
Registered: 03-2007
Posted From: 170.202.122.2

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 01:06 pm:       



dervied columns

extract(time of coffee setrved) is between 8AM to 8PM then 'A1' else 'A2' as shift_coffee
extract(date of coffee served) as 'Date cofee'

date coffe + shift_cofee as cofeee

count distinct(coffee)



ok this will give how many shifts cofee is served ..


now we have to somehow derive how many shifts actually are there between checkin and checkout..

using both these we can determine if coffee is served every shift or not..



edho tochindi seppan
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56931
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:54 pm:       


Ruj:

its more of ETL anukuntuna..we can generate a flag column..not sure how to do using sql..


SQL lo cheyyalenidi ETL lo emi chesthaam
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56930
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:54 pm:       


Abhysg:

Vegas trip ayipoyindi. ..dog running


Hey working from vegas no...Kindaki velthe koorcho betti naakesaaru 5 min lo
 

Ruj
Hero
Username: Ruj

Post Number: 18251
Registered: 03-2007
Posted From: 170.202.122.2

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:47 pm:       

its more of ETL anukuntuna..we can generate a flag column..not sure how to do using sql..
 

Abhysg
Megastar
Username: Abhysg

Post Number: 26264
Registered: 08-2008
Posted From: 166.137.244.94

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:44 pm:       

Vegas trip ayipoyindi. ..dog running
 

Rowdy
Legend
Username: Rowdy

Post Number: 35826
Registered: 01-2010
Posted From: 12.155.202.69

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:35 pm:       

mee client hotel lo coffee contractor aa?
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56929
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:33 pm:       


Mahiz:

Sample Data inthe na ..


Yes
 

Mahiz
Junior Artist
Username: Mahiz

Post Number: 544
Registered: 10-2012
Posted From: 168.159.213.208

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:32 pm:       

Sample Data inthe na ..

Customer ID || Customer Name || Time and date Checked in || Time and Date checked out || Time and date of coffee served
111 || Mahi || 10/25/2015 7:15 AM || 10/28/2015 9:30 PM || 10/25/2015 7:50 AM
111 || Mahi || 10/25/2015 7:15 AM || 10/28/2015 9:30 PM || 10/25/2015 10:30 AM
111 || Mahi || 10/25/2015 7:15 AM || 10/28/2015 9:30 PM || 10/26/2015 9:45 AM
111 || Mahi || 10/25/2015 7:15 AM || 10/28/2015 9:30 PM || 10/27/2015 3:30 PM
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 56928
Registered: 10-2009
Posted From: 64.79.151.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, October 29, 2015 - 12:25 pm:       

Scenario:

1) In a hotel daily there are 2 shifts from 8 AM to 8 PM 1st shift and 8PM to 8 AM second shift. 2) Guests can check in anytime and can stay any number of days.

Objective is to identify if coffee has been served at least one time in each shift.

Example: A guest checked in on 10/25/2015 7:15 AM and checked out on 10/28/2015 9:30 PM 1) Coffee has to be served before 8 AM on 10/25/2015 at least once. 2) Coffee between 8 AM and 8 PM at least once and same on next shifts. it doesn't matter if a customer was served twice or thrice between a shift . 3) on the final day since a shift starts at 8 PM and the guest checked out at 9:30 PM. we still have to verify if he/she has been served at least once.

My table columns are: Customer ID Customer Name Time and date Checked in Time and Date checked out Time and date of coffee served.

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x96e34a0){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

  A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: