filmov
tv
SQL Commands: MySQL EXPLAIN Explained!
Показать описание
In this mysql tutorial about sql commands we'll walk you through one of the primary sql queries - EXPLAIN. The EXPLAIN SQL query, at least in MySQL, can have 3 output formats:
1) EXPLAIN TRADITIONAL which is the same as the SQL statement of EXPLAIN (vanilla statement.)
2) EXPLAIN JSON provides SQL output in a JSON format.
3) EXPLAIN TREE (available only in MySQL 8.0.16 and later) - the TREE option provides MySQL DBAs and developers with a tree-like output of the EXPLAIN SQL query.
Some of the most popular SQL interview questions and answers can be found below:
Q: What are some of the most popular SQL commands?
A: CRUD queries are the most popular SQL queries. They can be used to create (insert), read (select), update, or delete data.
Q: How dangerous is SQL injection? How to protect our web applications from this attack?
A: SQL injection is one of the most dangerous attacks targeting applications today. To protect our web applications from sql injection, we need to sanitize our inputs and never provide user input to a database.
Q: What file should be used for mysql server configuration?
Q: What are the most important settings we should optimize in MySQL?
A: Optimize these settings (these mysql server settings are specific to InnoDB or Percona XtraDB storage engines):
* innodb-data-file-path: this parameter defines the location of the InnoDB system tablespace (the file where all InnoDB data is stored.)
* innodb-buffer-pool-size: this parameter defines the size of the InnoDB buffer pool and it is the most important parameter in the entire MySQL server infrastructure related to its primary storage engine - InnoDB.
* innodb-log-file-size: this MySQL server InnoDB parameter defines the log file size. The larger it is, the better your mysql server performance will be, but the longer recovery time after a crash will be required too.
* innodb-log-buffer-size: this mysql server parameter is used to write to the log files on disk.
* innodb-flush-log-at-trx-commit: this MySQL install parameter controls the balance between strict database ACID compliance and high performance.
* innodb-flush-method: this MySQL install parameter defines the method that is used to flush data to InnoDB log files.
Q: What storage engine should we use in our MySQL install?
A: Use either InnoDB or Percona XtraDB. If there's a necessity to run COUNT(*) queries, use MyISAM, because InnoDB and Percona XtraDB don't store the row count internally while MyISAM does.
Q: What is the most frequently used type of SQL index?
A: A B-tree SQL index is used the most frequently in mysql server as well as other RDBMS systems.
Enjoy the video!
#shorts #reels #database #mysql #web #webdevelopment #developer
1) EXPLAIN TRADITIONAL which is the same as the SQL statement of EXPLAIN (vanilla statement.)
2) EXPLAIN JSON provides SQL output in a JSON format.
3) EXPLAIN TREE (available only in MySQL 8.0.16 and later) - the TREE option provides MySQL DBAs and developers with a tree-like output of the EXPLAIN SQL query.
Some of the most popular SQL interview questions and answers can be found below:
Q: What are some of the most popular SQL commands?
A: CRUD queries are the most popular SQL queries. They can be used to create (insert), read (select), update, or delete data.
Q: How dangerous is SQL injection? How to protect our web applications from this attack?
A: SQL injection is one of the most dangerous attacks targeting applications today. To protect our web applications from sql injection, we need to sanitize our inputs and never provide user input to a database.
Q: What file should be used for mysql server configuration?
Q: What are the most important settings we should optimize in MySQL?
A: Optimize these settings (these mysql server settings are specific to InnoDB or Percona XtraDB storage engines):
* innodb-data-file-path: this parameter defines the location of the InnoDB system tablespace (the file where all InnoDB data is stored.)
* innodb-buffer-pool-size: this parameter defines the size of the InnoDB buffer pool and it is the most important parameter in the entire MySQL server infrastructure related to its primary storage engine - InnoDB.
* innodb-log-file-size: this MySQL server InnoDB parameter defines the log file size. The larger it is, the better your mysql server performance will be, but the longer recovery time after a crash will be required too.
* innodb-log-buffer-size: this mysql server parameter is used to write to the log files on disk.
* innodb-flush-log-at-trx-commit: this MySQL install parameter controls the balance between strict database ACID compliance and high performance.
* innodb-flush-method: this MySQL install parameter defines the method that is used to flush data to InnoDB log files.
Q: What storage engine should we use in our MySQL install?
A: Use either InnoDB or Percona XtraDB. If there's a necessity to run COUNT(*) queries, use MyISAM, because InnoDB and Percona XtraDB don't store the row count internally while MyISAM does.
Q: What is the most frequently used type of SQL index?
A: A B-tree SQL index is used the most frequently in mysql server as well as other RDBMS systems.
Enjoy the video!
#shorts #reels #database #mysql #web #webdevelopment #developer