pl/sql中的賦值運算符
Basically, AND / OR operator is used to retrieving the record from the database. If we give more than one conditions by using AND Operator, then it retrieves the data from the database when both the conditions are true. And if we use OR operator it retrieves data from the database in both cases either one or more condition is true. Here, in this example we use table 1 for retrieving data using AND, OR operator:
基本上, AND / OR運算符用于從數據庫檢索記錄。 如果我們使用AND運算符給出多個條件,則當兩個條件都為真時,它將從數據庫中檢索數據。 而且,如果我們使用OR運算符,則在兩種或兩種情況下,它都從數據庫中檢索數據。 在此示例中,我們使用表1使用AND,OR運算符檢索數據:
Example:
例:
Table 1:
表格1:
Student_ID | Student_Name | Dept | Branch | Course |
---|---|---|---|---|
15011 | AmanGautam | CSE | IT | B.tech |
15028 | AtulAnand | CSE | CS | B.tech |
15032 | Bharti Parmar | CSE | CS | B.tech |
15068 | Partha Biswas | CSE | IT | B.tech |
學生卡 | 學生姓名 | 部門 | 科 | 課程 |
---|---|---|---|---|
15011 | 阿曼·高塔姆(AmanGautam) | 自學考試 | 它 | 科技 |
15028 | 阿圖拉南德 | 自學考試 | CS | 科技 |
15032 | 巴爾蒂·帕瑪(Bharti Parmar) | 自學考試 | CS | 科技 |
15068 | 帕薩·比斯瓦斯(Partha Biswas) | 自學考試 | 它 | 科技 |
1) We have to find the Student_Name whose Dept is CSE and Branch is CS using SQL query.
1)我們必須使用SQL查詢來找到其Dept為CSE且Branch為CS的Student_Name。
2) We have to find the Student_Name whose Dept is CSE OR Branch is CS using SQL query.
2)我們必須使用SQL查詢來找到其Cept或Branch是CS的Student_Name。

Table 2:
表2:
Student_ID | HOD | Dean |
---|---|---|
15011 | Shivani rajpoot | Aditya sikarwar |
15028 | Sanchita nayak | Aditya Sikarwar |
15032 | Sanchita nayak | RK sharma |
15068 | Shivani rajpoot | RK sharma |
學生卡 | HOD | 院長 |
---|---|---|
15011 | 西瓦尼·拉布波特 | 阿迪亞·西卡瓦爾(Aditya sikarwar) |
15028 | Sanchita nayak | 阿迪亞(Aditya Sikarwar) |
15032 | Sanchita nayak | RK夏爾馬 |
15068 | 西瓦尼·拉布波特 | RK夏爾馬 |
Here, in this example we use two table which are join by primary and foreign key for retrieving data using AND OR operator.
在此示例中,我們使用兩個表(通過主鍵和外鍵聯接)使用AND OR運算符檢索數據。
1) We have to find the Student_Name, HOD whose Dean is R. K Sharma and Branch is CS using SQL query.
1)我們必須使用SQL查詢來找到其Dean為R. K Sharma而Branch為CS的Student_Name,HOD。
2) We have to find the Student_Name, Dean where HOD is shivani rajpoot using SQL query.
2)我們必須使用SQL查詢找到Student_Name,Dean,其中HOD是shivani rajpoot。
Conclusion:
結論:
In this article, we are using AND OR operator to retrieve data from the database/table. Also, we see the example of how to retrieve data from the single table or more than one table. I hope you understand the concept; if you have any query, feel free to ask in the comment section. I will be trying to give you an answer of your question as soon as possible. We will know more about SQL in the upcoming article.
在本文中,我們使用AND OR運算符從數據庫/表中檢索數據。 另外,我們看到了如何從單個表或多個表中檢索數據的示例。 希望您理解這個概念; 如果您有任何疑問,請隨時在評論部分提問。 我將盡力為您解答。 在下一篇文章中,我們將更多地了解SQL。
翻譯自: https://www.includehelp.com/sql/use-AND-OR-operator-in-sql.aspx
pl/sql中的賦值運算符