You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sql/SQL-basics/filtering-data.md
+87-97Lines changed: 87 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,32 +3,32 @@ id: filtering-data
3
3
title: SQL Filtering Data
4
4
sidebar_label: SQL Filtering Data
5
5
sidebar_position: 3
6
-
tags: [html, web-development, attributes, values]
7
-
description: In this tutorial, you will learn about HTML attributes and values. HTML attributes provide additional information about elements, and values define the specific settings or properties of the attributes.
8
-
keywords: [html, web development, attributes, values, html attributes, html values, html tutorial, html basics, web design, web pages, websites, html structure, html attributes tutorial, html values tutorial, html in 2024]
description: This document is a tutorial on SQL data filtering techniques, designed for beginners learning database querying. It covers the fundamental concepts and practical applications of retrieving specific data from database tables.
Welcome to the **Selecting Data** module! This foundational learning path is designed to help you master the basics of querying data, particularly focusing on how to retrieve specific information from databases effectively.
14
14
15
-
### 📘 Using Coditions
15
+
### 📘 Using Conditions with the WHERE Clause
16
16
17
17
In this tutorial, you'll learn how to interpret and use rows in a database table. Tables are essential to storing structured data, and each **row** in a table represents a unique **item or record**.
18
-
> The first step in filtering is selecting the Items
19
-
> We use WHERE keyword to filter the data., we also apply the condition over there.
20
-
> We filter the table items we slect to get only items that satisy certain conditions.
21
-
> The condition we want our items to fulfil comes after the where keyword
18
+
> The first step in filtering is selecting the items.
19
+
> We use **WHERE** keyword to filter the data by applying conditions.
20
+
> We filter the table items, we select to get only items that satisfy certain conditions.
21
+
> The condition we want our items to fulfill comes after the where keyword
22
22
23
23
24
-
For example, consider a table named `Friends`. Below is how a simple table might look:
24
+
For example, consider a table named `Students`. Below is how a simple table might look:
25
25
26
26
27
27
28
-
:::info
28
+
:::info
29
29
<Tabs>
30
30
<TabItemvalue="SQL Table"label="SQL Table">
31
-
```sql title="Friends"
31
+
```sql title="Students"
32
32
| name | year | major |
33
33
|-------------|------|---------|
34
34
| Ava Smith | 1 | Biology |
@@ -37,42 +37,41 @@ For example, consider a table named `Friends`. Below is how a simple table might
37
37
```
38
38
</TabItem>
39
39
40
-
<TabItemvalue="SQL Code"label="SQL Code">
40
+
<TabItemvalue="SQL Code"label="SQL Code">
41
41
42
-
```sql title="Creating SQL Tables & db. "
43
-
SELECT*
44
-
FROM students
45
-
WHERE major ='Biology';
42
+
```sql title="Select command with a condition"
43
+
SELECT*
44
+
FROM Students
45
+
WHERE major ='Biology';
46
+
```
46
47
47
-
```
48
-
49
-
</TabItem>
48
+
</TabItem>
50
49
51
-
<TabItem value="how-git-works" label="Output ">
50
+
<TabItemvalue="Students"label="Output ">
52
51
| name | year | major |
53
52
|-----------|------|---------|
54
53
| Ava Smith | 1 | Biology |
55
54
| Lin Wong | 3 | Biology |
56
55
</TabItem>
57
56
</Tabs>
57
+
:::
58
58
59
59
60
60
61
61
62
+
### 📘 Practice Example
62
63
63
-
### 📘 Practise Example
64
-
65
-
> To query data from a table, use the FROM clause followed by the table's name.
64
+
> To query data from a table, use the FROM clause followed by the table's name and then the WHERE clause to specify the conditions for the data you want to retrieve.
66
65
67
66
68
-
For example, consider a table named `Friends`. Below is how a simple table might look:
67
+
For example, consider a table named `Students`. Below is how a simple table might look:
69
68
70
69
71
70
72
-
:::info
71
+
:::info
73
72
<Tabs>
74
73
<TabItemvalue="SQL Table"label="SQL Table">
75
-
```sql title="Friends"
74
+
```sql title="Students"
76
75
| name | email | type |
77
76
|------|-------------------|-------|
78
77
| Sam | sam17@mail.com | free |
@@ -82,52 +81,46 @@ For example, consider a table named `Friends`. Below is how a simple table might
82
81
```
83
82
</TabItem>
84
83
85
-
<TabItem value="SQL Code" label="SQL Code">
84
+
<TabItemvalue="SQL Code"label="SQL Code">
86
85
87
-
```sql title="Creating SQL Tables. "
86
+
```sql title="Data from the table where type is pro"
0 commit comments