Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,960 --> 00:00:06,810
In the last video, we learned how to insert the data in our table using the insert into and copy command.
2
00:00:07,260 --> 00:00:11,070
Now let us look at how to retrieve this data from the table.
3
00:00:11,100 --> 00:00:15,390
That is how to get back the records present in the customer table.
4
00:00:15,890 --> 00:00:19,380
The level of data from tables is done using the select command.
5
00:00:19,920 --> 00:00:25,440
Select Command is used to fetch the data from database and the result table that you get is called result
6
00:00:25,440 --> 00:00:26,040
sets.
7
00:00:26,490 --> 00:00:28,950
The syntax for command is as follows.
8
00:00:29,310 --> 00:00:30,480
We select.
9
00:00:31,340 --> 00:00:34,160
Then mention the columns that we want to retrieve.
10
00:00:35,090 --> 00:00:36,830
Then comes the key word from.
11
00:00:37,160 --> 00:00:39,140
And then we mention the table name.
12
00:00:40,250 --> 00:00:46,280
If you want to get all the columns and do not need to and do not want to specify any particular column
13
00:00:46,310 --> 00:00:49,520
or columns, we will use a wild card.
14
00:00:49,760 --> 00:00:51,730
Wild card is a special symbol.
15
00:00:52,070 --> 00:00:56,510
Wild card for selecting all columns is an aesthetics sign.
16
00:00:57,620 --> 00:01:04,220
So if we select aesthetics from table name, it will give us all the columns of that particular table.
17
00:01:04,940 --> 00:01:06,500
Let us look at the examples.
18
00:01:07,990 --> 00:01:14,080
So to retrieve only one column, for example, say if you want just the first name of all the customers
19
00:01:14,080 --> 00:01:17,970
that you have in your customer table, this is the query you will write.
20
00:01:17,980 --> 00:01:21,730
Select first name from Customer table.
21
00:01:21,760 --> 00:01:23,410
Customer table is the table name.
22
00:01:24,400 --> 00:01:27,040
Let us go to admin and run this command.
23
00:01:35,360 --> 00:01:36,890
Select first name.
24
00:01:38,110 --> 00:01:40,990
From the table, which is customer table.
25
00:01:43,580 --> 00:01:44,410
Semicolon.
26
00:01:44,810 --> 00:01:46,580
Select this query and turn it.
27
00:01:49,350 --> 00:01:50,730
You can see the output below.
28
00:01:51,540 --> 00:01:52,350
It has the.
29
00:01:53,620 --> 00:01:57,160
It records and only the first name is fetched.
30
00:01:58,560 --> 00:02:00,240
Now let us go back to the presentation.
31
00:02:00,810 --> 00:02:02,940
If we want to get multiple columns.
32
00:02:02,940 --> 00:02:08,610
So for example, if we now want both first name and last name for the customer, we will mention both
33
00:02:08,610 --> 00:02:10,020
the column names.
34
00:02:11,330 --> 00:02:12,900
So let's go and fetch.
35
00:02:12,920 --> 00:02:15,210
First name and last name from the customer table.
36
00:02:19,210 --> 00:02:20,380
First name.
37
00:02:22,140 --> 00:02:22,790
Coma.
38
00:02:23,190 --> 00:02:24,120
Last name?
39
00:02:26,730 --> 00:02:28,710
From customer table.
40
00:02:35,330 --> 00:02:36,050
But I need.
41
00:02:38,000 --> 00:02:41,630
You can see now we have the first name and the last name.
42
00:02:42,880 --> 00:02:45,520
Retrieved from the database for all the records.
43
00:02:48,230 --> 00:02:54,170
If you remember, we discussed that aesthetics wild card can be used to get all the columns.
44
00:02:54,200 --> 00:02:56,270
Let us use aesthetics while God.
45
00:02:56,900 --> 00:02:58,400
So we'll write select.
46
00:02:59,900 --> 00:03:00,620
Start.
47
00:03:01,720 --> 00:03:02,470
From.
48
00:03:03,320 --> 00:03:04,550
Customer table.
49
00:03:08,000 --> 00:03:13,490
And you can guess it will give us all the columns of this table.
50
00:03:15,060 --> 00:03:15,510
So.
51
00:03:15,510 --> 00:03:16,230
Customer ID.
52
00:03:16,230 --> 00:03:16,830
First name.
53
00:03:16,830 --> 00:03:17,520
Last Name.
54
00:03:17,520 --> 00:03:17,860
Age.
55
00:03:17,880 --> 00:03:18,540
Email ID.
56
00:03:18,570 --> 00:03:21,480
All the columns are retrieved for all the records.
57
00:03:22,370 --> 00:03:27,680
So this is how using the select statement, we retrieve data from the table.
58
00:03:28,970 --> 00:03:34,670
In the next lecture, we will see if there is duplicate entries in the table and we want to identify
59
00:03:34,670 --> 00:03:36,140
only the unique values.
60
00:03:36,440 --> 00:03:39,680
How do we retrieve unique data from a table?
4714
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.