Self-correlating query (self ID associated with its own ID (primary key), the query can be logically divided into two tables, and then a separate alias to distinguish)
SELECT * FROM areas as City
Inner join areas as provinces on Provinces.id=city.pid
Where Provinces.title= ' Shanxi province '
Views: Encapsulation of query statements.
Create View V_stu_cla_sco as (followed by query statements, note and query different is field cannot be duplicated)
Select Stu.name,class.title,scores.score from Scores
Inner join Stu on Scores.stuid=stu.id
INNER JOIN class on scores.classid=class.id;
Modify the view: replace Create with Alter
Things: Four properties of acid (atomicity, consistency, isolation, durability)
Open: Begin; Commit commit; Roll back the rollback;
Index: View show index from table name
Creating index: Create index name on table name (field name (word length));
Delete index: Drop the index name on table name;
MySQL database: Self-correlating, view, Thing, index