Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kellatirupathi/6f7e1cec5427624cd3baa09fcd54c277 to your computer and use it in GitHub Desktop.

Select an option

Save kellatirupathi/6f7e1cec5427624cd3baa09fcd54c277 to your computer and use it in GitHub Desktop.
Transcript for transcript_1Tpfk6Ovzx5ibzqQKjMigzHt7AqbHBli-_1_2080_edd70a30396b_1.txt
[00:00:00] column with values 1, 2, 3, 4 in it.
[00:00:16] Okay, table 2 also has a single column with values 1, 1, 2, 3.
[00:00:28] 1, 1, 2, 3.
[00:00:30] Okay.
[00:00:32] 1, 1, 2, 3.
[00:00:33] Yes.
[00:00:34] Table 1 is 1, 2, 3, 4.
[00:00:36] Table 2 is 1, 1, 2, 3.
[00:00:39] 1, 1.
[00:00:41] Correct.
[00:00:42] So, yeah.
[00:00:45] Can you give me the output for inner and left join of these two tables?
[00:00:52] For energy on the output is 1 connect to 1 1 and 2 connect to 2 and 3 connect to 3 and 4 is not connected.
[00:01:04] Okay, so 4 will be there or not?
[00:01:07] The 4 is not in the output.
[00:01:09] Okay.
[00:01:11] For the left join, 1, 2, 3 is connected to 1, 1 and 2 connected to 2 and 3, 4 is in the right part is empty.
[00:01:23] Okay, so total how many rows will be there in the output?
[00:01:28] So in Lebanon?
[00:01:32] Yeah.
[00:01:37] Okay, cool.
[00:01:39] Moving on, let's move on to the question two.
[00:01:43] Again, it's the same scenario.
[00:01:44] You have two tables, table one and table two.
[00:01:47] Both have single column in it.
[00:01:49] Table one has five entries.
[00:01:52] Five entries.
[00:01:54] Yes.
[00:01:55] Table 2 has 10 entries.
[00:02:07] Now, when you do an inner join of these two tables, what is the minimum possible outcomes that you get and what is the maximum possible outcomes that you get?
[00:02:18] You can assume any values as the table entries.
[00:02:31] The minimum is 0, maximum is 5.
[00:02:33] If the no condition is matched, then the minimum is 0 and all the conditions match for the minimum tables row, then the maximum value is 5 rows in a table.
[00:02:47] Can you, I understood the minimum part.
[00:02:50] Can you explain me the maximum part with an example?
[00:02:57] Suppose table 1 have 5 students and table 2 has 5 different students and table 2 have 10 students.
[00:03:10] For a minimum, if the result of the student is not the student, in the result table, the result is not the student of 5.
[00:03:19] Then the value is minimum.
[00:03:21] If the result of the 10 students found in the table 2, then the result is 5 maximum.
[00:03:31] I mean, it was not clear to me exactly what you're trying to say.
[00:03:35] So see, you've understood the scenario, right?
[00:03:37] Table 1, 5 entries, table 2, 10 entries.
[00:03:40] You're saying maximum possible outcomes is 5.
[00:03:42] Am I correct?
[00:03:44] Okay, sir.
[00:03:45] Is that what you're saying?
[00:03:46] Maximum outcomes, 5.
[00:03:49] Yes, sir.
[00:03:50] Can you give me a small example and explain me?
[00:03:53] Take different values in five rows and ten rows and just tell me how it is fine.
[00:04:01] Then is table one have five entries like five unique keys, one, two, three, four and five.
[00:04:08] Okay.
[00:04:09] In table two, if we have unique keys related, related unique keys, unique keys like one, two, three, four, five, six, seven, eight, nine, ten.
[00:04:20] And we apply the energy by the condition that table one dot value, student ID equal to, equal to table two dot student ID equal to, equal to.
[00:04:30] Then we apply the energy one, then the five values are matched.
[00:04:38] If the values are not matched, then the minimum value is 0.
[00:04:43] Okay, but again, can you think of any other scenario wherein you'll get more than five entries?
[00:04:56] And more than five minutes.
[00:05:09] I've taken up table one more than five minutes.
[00:05:13] Outcome, outcome table I'm asking.
[00:05:15] Maximum you said is five, right?
[00:05:18] Yes.
[00:05:19] Is there any other scenario wherein maximum outcomes are more than five?
[00:05:26] Yes, sir.
[00:05:27] It may be possible if in the table 2, if the repeated value in table 2, then it may be possible.
[00:05:39] Then you said the maximum is 5, right?
[00:05:41] Earlier.
[00:05:45] Sir, I consider as a duplicate value in table 2.
[00:05:50] You can consider any values as the entries.
[00:05:53] It's up to you.
[00:05:54] What is the maximum that you can get?
[00:05:58] If the table to have a duplicate value, then the maximum is 10.
[00:06:04] Sure, only 10.
[00:06:13] Yes, sir.
[00:06:13] If table 2 has duplicate value, then it may be 10.
[00:06:18] Okay, I'll tell you one scenario.
[00:06:20] You have table 1 with 5 values as 1, 1, 1, 1, 1.
[00:06:26] Okay?
[00:06:29] We have table 2 with 10 values.
[00:06:31] Everything is 1.
[00:06:35] Now when you do an inner join for these two tables, how many outcomes can you get?
[00:07:04] You understood the question, right?
[00:07:07] Yes, sir.
[00:07:08] I have the same question.
[00:07:33] It may be if the one connect, if the entries have five same values and second table has one, one, one, then one connect, first entry connect to all tens and second entry is also connected to all tens.
[00:07:47] So it may be 50, sir.
[00:07:51] Correct.
[00:07:52] So the maximum that you can get is 50.
[00:07:55] Not 5 or 10.
[00:07:57] What size of duplicate?
[00:07:59] That's what I told you, right?
[00:08:00] You can assume any value.
[00:08:01] There is no restriction on value saying that only these are to be used.
[00:08:05] You can assume anything.
[00:08:08] Okay.
[00:08:09] Okay.
[00:08:10] Let's move on to the main question now.
[00:08:12] I'll share you the question in the chat box.
[00:08:14] Can you try forming that question?
[00:08:28] Second one?
[00:08:29] Yes.
[00:08:34] So go through the question.
[00:08:35] If you have any doubts, you can ask me.
[00:12:33] Yeah, fine.
[00:12:35] You can start writing the problem solution for this.
[00:12:38] The right approach?
[00:12:40] Yeah, you need to write an SQL query which gives the output in the given format.
[00:23:14] Yeah, is it done?
[00:23:16] It's done.
[00:23:35] Understood.
[00:23:35] So you'll have columns from both cities.
[00:23:39] That's fine.
[00:23:40] So you can leave that there.
[00:23:43] Understood.
[00:23:46] Yeah.
[00:23:47] So can you explain me what you have done in here?
[00:23:50] So in Manly, by creative view for the daily orders and daily products, how many daily orders we placed and how many daily products we order in a particular day.
[00:24:04] According to that, by the...
[00:24:08] From order step we filtered and filters by the group by and order daily product and daily orders by selecting making the group and after we apply the aggregation function.
[00:24:23] So can I ask why did you use two different cities here?
[00:24:31] You used a separate, is it a view or is it a city?
[00:24:35] It's a view.
[00:24:38] Okay, fine.
[00:24:40] Why did you use two different views in here?
[00:24:43] I mean, why did you break order separately and product separately?
[00:24:51] So on the, the poor order, the brown order, poor,
[00:25:00] We select the daily orders.
[00:25:03] Do not do not.
[00:25:06] We use a view one and for daily products.
[00:25:10] We use.
[00:25:13] We use you to end up in the best in the.
[00:25:18] You had a join of orders and products table, right?
[00:25:22] Yes, sir.
[00:25:24] So you will have all the columns of order table one, view one in your view two as well.
[00:25:29] You have order date, orders, revenue and products.
[00:25:33] Yes, sir.
[00:25:34] By view one, we create our daily orders and view two, we create our daily products.
[00:25:40] By then, after that, we apply the...
[00:25:44] That's what I'm saying.
[00:25:46] See, my point is basically when you have view two, which is giving you all the values, why do you need a view one?
[00:25:57] You can write the same count of star as orders placed and sum of order amount as total revenue in view too as well, right?
[00:26:05] What is stopping you from writing that?
[00:26:09] Or why did you use a V1 separately?
[00:26:23] Mainly the why the due to be founded of daily products
[00:26:31] by the order date and also we have found the daily orders by the order date, grouping by order date.
[00:26:41] In the selection, we use the
[00:26:48] No, have you understood my question?
[00:26:55] My question is basically whatever you have done in view one, you can also do that in view two.
[00:27:03] So in view two, it may be chance to have duplicate value.
[00:27:07] So how will there be duplicates?
[00:27:10] Can you tell me that?
[00:27:17] And why the FB was delivered with the order by FB.
[00:27:26] If we make by group by product by the order date in the same date,
[00:27:37] in the same date, if we have independent dates, if we have same products, we place.
[00:27:42] But so due to that, if we have chances of duplicate values.
[00:27:47] Sorry, sorry.
[00:27:48] Can you repeat that again, please?
[00:27:51] Then in product 2, we have given the order IDs of and not mention the product date in which we place the order.
[00:28:00] But in table 1, give the order date and with product ID.
[00:28:08] Okay.
[00:28:09] And if we use mainly view 2 only, then we have chances of the same date.
[00:28:15] Independent date have chances of duplicate values.
[00:28:19] Independent date.
[00:28:25] That's that.
[00:28:39] Nothing.
[00:30:06] So, in this we can see 21, so 2 products are on date.
[00:30:18] On date 4-4, we have the two products only, 101 and 102.
[00:30:28] Water ID is given 101 and 102.
[00:30:33] 102.
[00:30:34] Okay.
[00:30:37] Therapy apply the only first view to then chances of
[00:30:59] So I will tell you basically if you only use a view to as you mentioned duplicates are possible, but the major issue is your duplication will happen during amount.
[00:31:10] Your amount will get duplicated.
[00:31:13] Yes, sir.
[00:31:14] So if you do directly sum there, it will give you a higher amount than the actual one.
[00:31:22] Yeah, all right.
[00:31:24] Take it.
[00:31:24] That's fine.
[00:31:25] So, okay, we've passed the time.
[00:31:28] Just I'd like to ask you one quick question and then we can close this.
[00:31:33] Okay.
[00:31:33] So, yeah, assume you have, I've given you eight coins.
[00:31:39] Coin.
[00:31:41] Okay.
[00:31:42] One coin.
[00:31:43] 8, 8, 8 coins.
[00:31:47] Out of that 8 coins, 7 coins are of same weight.
[00:31:50] One coin is of a different weight.
[00:31:54] Okay.
[00:31:54] One coin is higher rate basically.
[00:31:59] Okay.
[00:32:00] Okay.
[00:32:01] So you also have a weighing machine, weighing scale, basically, wherein you put weights on both the sides and see if they're balanced or not.
[00:32:12] Now, how many trials do you need to identify that higher weight coin?
[00:32:19] Okay.
[00:32:34] Can you tell me how is it three times?
[00:32:37] We have eight points.
[00:32:39] First we compare four points.
[00:32:45] In the one form, the higher weight point is found.
[00:32:50] Then we select that form.
[00:32:53] Understood.
[00:32:54] Got it.
[00:32:54] After that, we divide same two more times.
[00:32:59] All right.
[00:33:00] So, yeah, I think we can end this here.
[00:33:02] If you have any questions, you can ask.
[00:33:05] Yes, sir.
[00:33:06] My main question is, sir, what is the path and what mainly works in product analyst?
[00:33:13] So basically, as a product analyst, you will be looking at the numbers daily and see, let's say, if we are rolling out a feature, you look at the numbers of that feature and see if it is performing nicely or not.
[00:33:27] And daily level, you'll track some metrics and see if they're going down, then what is the reason they are not performing.
[00:33:32] So it's mainly dealing with data.
[00:33:34] You'll write SQL queries.
[00:33:36] Fetch the data, analyze the data and give us the insights.
[00:33:41] Okay, sir.
[00:33:42] Yeah.
[00:33:43] Anything else?
[00:33:44] No, sir.
[00:33:45] Okay, then.
[00:33:46] It was nice talking to you.
[00:33:48] Thank you, sir.
[00:33:49] Okay, then.
[00:33:50] Bye.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment