Skip to playerSkip to main content
  • 3 months ago
Hi, this video will help you to SQL interview preparation.

Whatsapp Group Link- https://chat.whatsapp.com/Ck0eUZzs2FJBNhopD0B0Gt

SQL Script file : -
https://drive.google.com/file/d/1dEV0YSrEfjq2hbx10fpJkYdppyVdVgoz/view?usp=sharing

Microsoft Excel Course: Advanced Excel Training

https://www.udemy.com/course/microsoft-excel-excel-from-beginner-to-advanced-m/?couponCode=FC0D30F148B3045E6E59
Transcript
00:00I am recording.
00:02I am going to go to the office now.
00:08I am at 9-10-19.
00:13I am at 9-10-19.
00:17I am at 9-10-19.
00:21So we will create this database in September 28, 2025.
00:30I have made a table and put a card on the table with a salesman, so the salesman
00:53I have made a table with a customer, a table with a record, a table with a customer, a table with a order, a table with a record, this is a table with a order,
01:21find the salesman and customer who reside in same city, this is a table, select salesman,
01:35this is a table with a customer, this is a table with a customer, this is a table with a salesman,
01:53this is a table with a salesman, this is a table with a salesman who is in same city, it is easy,
02:01in the process.
02:03Can you join with me?
02:05Yes, sir, join.
02:07Tell me.
02:09Or do it without joining?
02:11Do it without joining?
02:13Do it without joining?
02:15Do it without joining?
02:17Do it without joining?
02:19Do you have to add a name or an idea?
02:21Name and city and customer name and city.
02:27And salesman name and city.
02:29Select.
02:31Star from salesman.
02:33Select.
02:35Select.
02:37Star from salesman.
02:39S dot.
02:41Is that right?
02:43Coma.
02:45Yes, sir.
02:47I need to add a name.
02:49C dot.
02:51Is that right?
02:53Coma.
02:55Yes, sir.
02:57C dot.
02:59C is the customer name.
03:01Yes.
03:03Yes.
03:05Join.
03:07Join customer.
03:09On.
03:11Customer.
03:13On.
03:15On.
03:17Customer.
03:19On.
03:21On.
03:23On.
03:25Customer.
03:27On.
03:29On.
03:31On.
03:33On.
03:35On.
03:37On.
03:39On.
03:41On.
03:43On.
03:45On.
03:47On.
03:49On.
03:51On.
03:53On.
03:55On.
03:57On.
04:01On.
04:03On.
04:05On.
04:07On.
04:09city and c.city
04:21It's gone from this too
04:26and if here
04:29s.salesman id
04:34Selzeman id is equal to c.selzeman id
04:38Let's see, we are matching them
04:42No, where is the condition?
04:46Okay, second one
04:50Where c.so
04:54s.city is equal to c.city
05:04I have something wrong
05:10I am seeing
05:16This is not coming again
05:20This is not coming again
05:24This is coming again
05:26This is coming again
05:28This is coming again
05:30This is coming again
05:32And this is not coming again
05:34This has not come again
05:36This has not come again
05:38This is coming again
05:42Why did you come again?
05:44Okay, two customers
05:46That's fine, two customers
05:48So, second one, something is wrong
05:50Then there is something wrong
05:52Second one, something is wrong
05:54Second one is wrong
05:56Second one, but why is wrong
05:58I don't know, but it will be wrong, why is it wrong?
06:03When we do this,
06:09the ID has something extra.
06:121, 2, 6, 3.
06:15It is wrong here.
06:175 is not here.
06:195 is not here.
06:211, 2, 5, 1, 2, 3, 5, 6, 7.
06:241, 2, 3, 5, 6, 7.
06:28So it is the same.
06:31So it is wrong.
06:40But the customer, the salesman's ID is matching.
06:46So it will be less.
06:48But the salesman's ID,
06:51the salesman's ID is matching.
06:54But it is also the same.
06:57So it is the same.
07:00So the salesman's ID is matching.
07:05That means,
07:07you understand the main logic,
07:09that,
07:10the state has two salesman's ID.
07:12Okay, sir?
07:13Yes.
07:14So the salesman's ID is matching,
07:16and then the city is matching.
07:19and we put it on the direct city and the salesmen side doesn't mean to the salesmen, so we put it on the salesmen.
07:28So then our first one hit is okay.
07:32I think that's it.
07:36If I do one thing, what do you say?
07:42If I do the left join,
07:44I will go to the left join.
07:51The customer is okay.
07:54If you do the left join,
07:56I will go to the right join.
08:01I will go to the right join.
08:04Okay sir.
08:07I will go to the right join.
08:14This is the right join.
08:16I will go to the right join.
08:18I will go to the right join.
08:20The right join.
08:23Now it is not here.
08:27I will go to the right join.
08:37Now it is not here.
08:42Okay, if I do this,
08:43then salesmen id, salesmen id, city different.
08:49I will go to the right join.
08:50But the right join will be the right join.
08:52How much record will be the right join?
08:56The customer has 8 records.
08:58The salesmen have 6 records.
08:59The salesmen have 6 records.
09:04The 4 records have 4 records.
09:09The other four records.
09:12The company exists in the right name.
09:13The same go to the right join.
09:14At the right-win store,
09:15The client has 8 records.
09:16If I do just like that,
09:17The other thing I will do is write join.
09:18The customer has 8 records.
09:19The same時間 has 8 records.
09:21Now it is 1,2,3...
09:22The same?
09:23All right, The same.
09:28The same.
09:29The same.
09:304 cities are the same.
09:31This is the same.
09:33Then, I will go to the right join.
09:36The same.
09:37the name is James, two customers are in New York, one is Nick and one is Brad, okay sir?
09:53And then you can see the Fit Alex, which is London, one is Julian Green and one is Brad.
10:01The name of the customer is different and it will be different, right?
10:07No, it's okay, sir.
10:09Look at your two sales.
10:15But the customer is the same.
10:18I have understood, but why is it going to join?
10:22Do you want to join?
10:25My question is this.
10:31Why is it going to join?
10:35It will be the same.
10:37The customer is selling.
10:41And the customer is deleting the data.
10:43Okay, what do you want to join?
10:49It is the same.
10:51Look, two salesmen are selling one customer.
10:53And the customer is deleting the data.
10:55I will delete it.
10:57What is happening?
10:59The city is equal to city
11:01which is matching the city
11:03and it is doing it.
11:05So, this is our logic
11:07and we will not use it.
11:09We will not use it.
11:11We will not use it.
11:13We will not use it.
11:15We will not use it.
11:17We will not use it.
11:19We will not use it.
11:21This is the best.
11:23This is the best.
11:25Find those orders
11:29where the order amount
11:31exists between 500
11:33and 2000
11:35This is the customer or order table.
11:39This is the customer or order table.
11:41This is the customer or order table.
11:43Customer or order table.
11:45Customer.
11:47Select start from orders.
11:51Find those orders.
11:57Find those orders.
11:59Find those orders.
12:01Find those orders which exist.
12:05Now we need to do that.
12:07Our order number is 500 to 2000.
12:09This is customer name, city.
12:11I am a customer name city.
12:16Select star from order.
12:24Order.
12:25Order.
12:26Order.
12:27Order.
12:28Order.
12:29Order.
12:30Order.
12:31Order.
12:32Order.
12:33Order.
12:36Order.
12:37Order.
12:38Order.
12:39Order.
12:41Order.
12:42Purchase.
12:43Amount.
12:44Customer.
12:45Order.
12:46Order.
12:47Amount.
12:48Customer.
12:49Order.
12:50Amount.
12:51C.
12:52Customer.
12:53Customer.
12:54Name.
12:55Customer.
12:56I am a customer.
12:57Here.
12:58C.
12:59Customer.
13:00Name.
13:01Direct.
13:02Sector.
13:03C.
13:04Do.
13:05Do.
13:06Do.
13:07Do.
13:08Do.
13:09Do.
13:10Do.
13:11Is.
13:12Customer.
13:13I.
13:14ones.
13:15Do.
13:16Do.
13:17Here.
13:18I.
13:19Under.
13:20Name.
13:21City,
13:22I.
13:23So, if you think that you have another table in the other table, then you can do it without it.
13:33If you think that in the other table, we don't have customer name and city, so we can do it directly.
13:41Join customer tables.
13:43On to another table and then on.
13:54So, click on customer id.
14:00The customer id.
14:01The customer id.
14:03The customer id.
14:06Ah, this is the customer id.
14:08It is where you can.
14:11Where?
14:12It's a year ago, I think.
14:15Where?
14:16Where?
14:17Where?
14:18Where?
14:19Aap, O. purchase amount?
14:21Purchased amount?
14:22Between?
14:23Between?
14:24500 and 2000.
14:25Purchased amount?
14:26Purchased amount?
14:27Between?
14:28Between, 500 and 2000.
14:30Purchased amount, okay?
14:31Aagaya.
14:32See?
14:33purchase amount
14:35okay
14:37okay
14:39okay
14:45find the salesman
14:47and customer
14:49he represent
14:51okay
14:53which salesman
14:55to which customer
14:57is assigned
14:59but
15:01customer name
15:03city salesman
15:05or commission
15:07have a question to answer
15:13this is
15:15find the salesperson
15:17and customer
15:19commission
15:21so here
15:23it is
15:25customer name city
15:27salesman name
15:29select
15:31select
15:33start from customers
15:35start from customers
15:43so here
15:45select join
15:47c dot customers
15:49dot
15:51dot
16:03dot
16:05dot
16:07dot
16:09dot
16:11S contents of the nearest C, c, c, c, t , s dot, sales man name is the name little
16:34Join Salisman S on C dot Salisman ID.
17:04It's a customer.
17:11It's not a customer.
17:16It's not a customer.
17:21It's not a customer.
17:27It's not a customer.
17:34It's not a customer.
17:39It's not a customer.
17:43It's not a customer.
17:53It's not a customer.
18:00It's not a customer.
18:05It's not a customer.
18:11It's not a customer.
18:15I will do it.
18:17And in this...
18:19...
18:21...
18:23...
18:25...
18:27...
18:29...
18:31...
18:33...
18:35...
18:37...
18:39...
18:41...
18:43...
18:45...
18:47...
18:50Customer
18:53Sir, customer has a right zone
18:56Sir, right zone
18:57Sir, right zone
19:03So, some customers will remain empty
19:088 is coming
19:12How much is coming?
19:178 customers
19:18And if I want a right zone
19:23Then it is 18
19:25Okay, ID is matching
19:27So, it is not coming
19:29No?
19:31Yes
19:32ID is matching
19:34Thank you
19:38Write SQL query to find salesperson
19:44Who received commission
19:46Of more than 12% from the company
19:51This is that
19:53Puraak Pura
19:55Customer name, city salesman commission
19:57That we have released
19:59This is Puraak Pura
20:03We will do everything here
20:05And we will give commission
20:07Yes sir, where commission greater than 12%?
20:13Yes sir, where commission is greater than 12%?
20:190.12%
20:24Yes sir
20:27Yes sir
20:29Write SQL query to locate those salesmen for people and customers not from same city
20:42And we have received a commission of more than 12% from company
20:47Yeh bhi chahiye
20:50To yeh bhi to customer or sales
21:00This is same here, it's a sales city or a diverse person
21:04Yes sir
21:14Yes sir, we will do a column here
21:16Yes sir
21:18Yes sir
21:19Yes sir
21:20To nous equal to
21:25Not equal to
21:27To
21:28To
21:29To
21:30To
21:31To
21:32To
21:33To
21:35To
21:36To
21:37To
21:38To
21:39To
21:40First of the commission
21:42There is city, city is coming
21:44But both of them
21:46No, both of them will show
21:48So that's why
21:50s.city
21:54s.city
22:00Now both of them are showing city
22:04And this is more than 12%
22:06The name of customer, city
22:08S.S.M.S.M.S
22:10The name of customer, city
22:12S.S.M.S
22:14Where is the name of customer?
22:16The name of customer
22:18S.S.M.S
22:20The city commission
22:22All will join
22:24Write a query
22:26To find the details of an order
22:30What is this doing?
22:32It's simple
22:34Why is this question?
22:36No
22:38Write SQL
22:40To find the details of an order
22:42Order ID
22:44No, no
22:46Order number
22:48Order table
22:50Or customer table
22:52Order table
22:54Or customer table
22:56Salesman
22:58Salesman
23:00Tja
23:01I
23:02I
23:04And
23:06I
23:08Dja
23:10Who
23:11Do you
23:12To find,
23:14Or
23:16To find,
23:18To find,
23:19To find,
23:20To find,
23:23To find,
23:25To find,
23:26To find,
23:27yeah
23:29yeah
23:31yeah
23:33we have right of the order number
23:35let's write the order number
23:37select
23:47o dot
23:49o
23:51o dot
23:53blast pressure o
23:55Now we are going to go to order date, order date, purchase amount, order date, purchase amount,
24:14and then join the customer table.
24:26If you want to add a column, then add a column.
24:32Using a grade.
24:38Grade.
24:43Salesman.
24:50Palace.
24:54Transportation.
25:00Salesman.
25:02Customer, Order, 3
25:093 not only grade
25:24Then join the second one
25:30.name
25:35.name
25:39.name
25:41.name
25:44.name
25:48.name
25:57more id
26:01c dot
26:05salesman id
26:07match
26:11it
26:17join
26:19salesman
26:23salesman
26:25on
26:27o dot
26:29salesman id
26:31equal to
26:33s dot
26:35salesman id
26:37equal to
26:39s dot
26:41salesman id
26:43do
26:45do
26:47do
26:49do
26:51do
26:53do
26:55do
26:57s dot
26:59name
27:05s dot
27:07commission
27:09do
27:11do
27:15do
27:17do
27:19do
27:21do
27:23do
27:25do
27:27do
27:29do
27:31do
27:33do
27:35do
27:37do
27:39do
27:41do
27:43do
27:45do
27:47do
27:49do
27:51do
27:53do
27:55do
27:57do
27:59do
28:01do
28:03do
28:05do
28:07do
28:09do
28:11do
28:13do
28:15do
28:17do
28:19do
28:21do
28:23do
28:25do
28:27do
28:29do
28:31do
28:35do
28:37do
28:39do
28:41do
28:43do
28:45do
28:47do
28:49do
28:51do
28:53do
28:55do
28:57do
28:59do
29:01do
29:03do
29:05do
29:07do
29:09do
29:11do
29:13do
29:15do
29:17do
29:19do
29:21do
29:23do
29:25do
29:27do
29:29do
29:31do
29:33do
29:35do
29:37do
29:39do
29:41do
29:43do
29:45do
29:47do
29:49do
29:51do
29:53Do you want to go all the way together?
30:00Yes.
30:02Yes.
30:03Yes.
30:04Create table.
30:07Yes.
30:08Sales.
30:10Sales entry.
30:15Yes.
30:16Sales ID, shop ID, item ID, quantity.
30:19Yes.
30:20A rating also, brother.
30:24This is very important.
30:26A rating is also reduced.
30:30Agra.
30:32The rating is also reduced.
30:34A rating is reduced and has a name of the name.
30:37Everything, everything.
30:40This data is more.
30:43This data is reduced.
30:47yeah
30:53yeah
30:55rating id rating id
30:58rating id
30:59shop id
31:00customer name
31:01rating
31:03and it is a great channel
31:05and it is a different comment
31:07okay
31:08Now question
31:09List all T shop details
31:12How many of our first table is?
31:15How many of our first table is?
31:17Yes
31:18T shop
31:19Is it a T shop?
31:21Yes
31:22It is a T shop
31:24Yes
31:26And it is a T shop
31:29Yes
31:30Yes
31:32Yes
31:33Yes
31:34Yes
31:36Yes
31:38Yes
31:40Yes
31:41Yes
31:42Yes
31:43Yes
31:44Yes
31:46Yes
31:47Well
31:48Yes
31:50No
31:51You
31:53Yes
31:55Yes
31:56Yes
31:57Yes
31:57hey
31:58yes
31:59Yes
32:00ah
32:01Yes
32:03Let's start for all my red dreams.
32:33Three or four?
32:37Four.
32:39Four.
32:41Now the question is list all T-sop details.
32:47T-sop details will be our T-sop.
32:52It will not be the same.
33:02Now I am confused.
33:04I think it is all the details,
33:06all the tables.
33:08No.
33:10T-sop details.
33:12T-sop details.
33:14Select the start.
33:16Select the start.
33:18There is nothing else.
33:20Find out menu available in the shop.
33:26So,
33:30item.
33:32This is the whole question.
33:34It is all available.
33:36So, this is all available.
33:38This is all available.
33:40It is all available.
33:42This is all available.
33:44This is all available.
33:46The question is simple.
33:48And then you can search it.
33:50It is all available.
33:52Here you go.
33:54Find the total number of order for each menu type.
33:58Each menu type.
34:00Each menu type.
34:02Here is the menu menu and these are sales.
34:04Then the time is finished.
34:06This time is going to be finished.
34:13What is the question?
34:15This table.
34:20find a total numbers of each menu type
34:50.
Be the first to comment
Add your comment

Recommended