House write database queries in contingency table at home

Is associated keyword query table join, if it is necessary to determine the conditions on the Join (judgment condition added later on), which generally occur in pairs of two, here to explain to connect the two tables given first two table, students are student achievement tables and result tables

First, we explain the connection (inner join) within , is the most commonly used as a contingency table query, the so-called inner join, that is, when we query the student's name and achievements, we need to use student achievement student tables and result tables, and isolated inner join result is that students have a table in the student and the results of the table have the corresponding student achievement to meet this condition will be checked out

 

Presentation inquiry following the student's name and achievements, we will see the names and corresponding results are, no students did not score, nor did student achievement appear

An outer connector includes an outer left and right outer connector, also referred to as left and right connections. The so-called left connection (left the Join) , which is connected to the foundation, including, again left the table all the information is printed out

Or to check students' names and grades, for example, the connection will not result left the names printed out (when the premise of the former student table, which is on the left), demonstrate the following

Right connection (right join) connected with left almost, that is connected on the basis of inside information to the right of the table printed out

 

Or to check students' names and grades, for example, the right connection will not name the results printed out (when provided in the table after the result, that is, on the right), demonstrate the following

Published 379 original articles · won praise 249 · views 50000 +

Guess you like

Origin blog.csdn.net/HeZhiYing_/article/details/104112262