Current location - Trademark Inquiry Complete Network - Overdue credit card - What is the difference between nested query and join query of SQL? ~ ~ ~ ~ urgent
What is the difference between nested query and join query of SQL? ~ ~ ~ ~ urgent
Explain a nested query, that is, a group of query statements in the middle of a query statement, which is called a nested query. For example, the first example upstairs.

To put it bluntly, the meaning of join query is to query in different tables, but only if the tables are related. Take Bank Credit Card Form A and Personal Information Form B for example. There must be a card number in table A, and there is also a card number in the personal information table. If I want to find out what kind of credit card this person has, suppose Table B has no credit card information, but Table A has relevant information, only the card number of the associated credit card, and then I will look up Table B..

Select B. Credit card attribute, B. Credit card type is from A, B, where A.ID=B.ID and a. Name =' Zhang San'.

Generally speaking, the fields associated with two or more tables are basically fields that do not duplicate data, such as PK, multi-field PK and so on.