Posts

Javascript Logo

What does use strict do in javascript?

< 1 min readThe “use strict” directive is a way to opt in to a restricted variant of JavaScript. It enables strict mode, which is a way to write more secure and efficient code by eliminating certain syntax and behaviors that are potentially error-prone or confusing. When strict mode is enabled, JavaScript will throw more exceptions and will…

Read More

how to add indexes in mysql?

2 min readIndexing is a way to improve the performance of certain types of queries in a database by creating a data structure that allows the database to quickly locate and retrieve the required data. An index is a separate data structure that is created on one or more columns of a table, and it contains a…

Read More

How to find the MySQL my.cnf location?

< 1 min readyour operating system and the installation method used. Here are some common locations where the my.cnf file may be located: On Unix-like systems (including Linux and macOS), the my.cnf file is usually located in the /etc directory, or in the /etc/mysql directory if MySQL was installed from a package. On Windows systems, the my.cnf file…

Read More

what is the Maximum length for MySQL type text?

< 1 min readThe maximum length for the TEXT data type in MySQL is 65535 characters. This is because TEXT data types are stored using a two-byte length prefix that indicates the number of characters in the value. Here is a summary of the different TEXT data types in MySQL and their maximum lengths: TINYTEXT: 255 characters TEXT:…

Read More

How to declare a variable in MySQL?

< 1 min readIn MySQL, you can declare a variable by using the DECLARE statement. Here is the syntax: For example, to declare a variable x of type INT with a default value of 0, you can use the following statement: You can also declare multiple variables in a single DECLARE statement, like this: Once a variable is…

Read More

How to get the size of a MYSQL database?

< 1 min readTo get the size of a MySQL database, you can use the SELECT statement with the SUM() function to sum the sizes of all the tables in the database. Here’s an example of how to get the size of a MySQL database named database_name: In this example, we use the information_schema.TABLES table to get the…

Read More