BD Flashcards
GROUP_CONCAT
Не забывайте про замечательную функцию GROUP_CONCAT. Она может выручить при сложных запросах.
Index
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. This is much faster than reading every row sequentially.
Most MySQL indexes (PRIMARY KEY,UNIQUE,INDEX, andFULLTEXT) are stored inB-trees. Exceptions: Indexes on spatial data types use R-trees;MEMORYtables also supporthash indexes;InnoDBuses inverted lists forFULLTEXTindexes.
What are joins in SQL?
A JOIN clause is used to combine rows from two or more tables, based on a related column between them. It is used to merge two tables or retrieve data from there. There are 4 joins in SQL namely:
Inner Join
Right Join
Left Join
Full Join
What are Constraints?
Constraints are used to specify the limit on the data type of the table. It can be specified while creating or altering the table statement. The sample of constraints are:
NOT NULL
CHECK
DEFAULT
UNIQUE
PRIMARY KEY
FOREIGN KEY