Browsed by
Tag: Notes on MySQL

How to search second maximum(second highest) salary value(integer)from table employee (field salary)in the manner so that mysql gets less load?

How to search second maximum(second highest) salary value(integer)from table employee (field salary)in the manner so that mysql gets less load?

By below query we will get second maximum(second highest) salary value(integer)from table employee (field salary)in the manner so that mysql gets less load? SELECT DISTINCT(salary) FROM employee order by salary desc limit 1 , 1 ; (This way we will able to find out 3rd highest , 4th highest salary so on just need to change limit condtion like LIMIT 2,1 for 3rd highest and LIMIT 3,1 for 4th some one may finding this way useing below query that taken…

Read More Read More

How to import a database in MySQL?

How to import a database in MySQL?

Importing database in MySQL is a process of moving data from one place to another place. It is a very useful method for backing up essential data or transferring our data between different locations. For example, we have a contact book database, which is essential to keep it in a secure place. So we need to export it in a safe place, and whenever it lost from the original location, we can restore it using import options. In MySQL, we…

Read More Read More

How to check USERS in MySQL?

How to check USERS in MySQL?

If we want to manage a database in MySQL, it is required to see the list of all user’s accounts in a database server. The following command is used to check the list of all users available in the database server: mysql> SELECT USER FROM mysql.user; To check the users in MySQL, you can use the following SQL query: SELECT User, Host FROM mysql.user; This will retrieve a list of users along with their corresponding hostnames from the MySQL user…

Read More Read More

What are the disadvantages of MySQL?

What are the disadvantages of MySQL?

MySQL is not so efficient for large scale databases. It does not support COMMIT and STORED PROCEDURES functions version less than 5.0. Transactions are not handled very efficiently. The functionality of MySQL is highly dependent on other addons. Development is not community-driven. MySQL, like any technology, has its drawbacks: Limited Functionality: Compared to some other relational databases, MySQL may have limited functionality in terms of features such as stored procedures, triggers, and views. Performance Bottlenecks: In certain scenarios, MySQL may…

Read More Read More

What is SQLyog?

What is SQLyog?

SQLyog program is the most popular GUI tool for admin. It is the most popular MySQL manager and admin tool. It combines the features of MySQL administrator, phpMyadmin, and others. MySQL front ends and MySQL GUI tools. SQLyog is not a product developed by MySQL. It is a popular graphical user interface (GUI) tool used to manage MySQL and MariaDB databases. It offers features such as database schema visualization, query building, data synchronization, backup management, and more. It’s developed by…

Read More Read More

Which command is used to view the content of the table in MySQL?

Which command is used to view the content of the table in MySQL?

The SELECT command is used to view the content of the table in MySQL. Explain Access Control Lists. An ACL is a list of permissions that are associated with an object. MySQL keeps the Access Control Lists cached in memory, and whenever the user tries to authenticate or execute a command, MySQL checks the permission required for the object, and if the permissions are available, then execution completes successfully.

MySQL Interview Questions – Set 06

MySQL Interview Questions – Set 06

What is REGEXP? REGEXP is a pattern match using a regular expression. The regular expression is a powerful way of specifying a pattern for a sophisticated search. Basically, it is a special text string for describing a search pattern. To understand it better, you can think of a situation of daily life when you search for .txt files to list all text files in the file manager. The regex equivalent for .txt will be .*.txt. What are the drivers in…

Read More Read More

How to change the column name in MySQL?

How to change the column name in MySQL?

While creating a table, we have kept one of the column names incorrectly. To change or rename an existing column name in MySQL, we need to use the ALTER TABLE and CHANGE commands together. The following are the syntax used to rename a column in MySQL: ALTER TABLE table_name CHANGE COLUMN old_column_name new_column_name column_definition [FIRST|AFTER existing_column]; Suppose the column’s current name is S_ID, but we want to change this with a more appropriate title as Stud_ID. We will use the…

Read More Read More

How to import a CSV file in MySQL?

How to import a CSV file in MySQL?

MySQL allows us to import the CSV (comma separated values) file into a database or table. A CSV is a plain text file that contains the list of data and can be saved in a tabular format. MySQL provides the LOAD DATA INFILE statement to import a CSV file. This statement is used to read a text file and import it into a database table very quickly. The full syntax to import a CSV file is given below: LOAD DATA…

Read More Read More

What is the difference between CHAR and VARCHAR?

What is the difference between CHAR and VARCHAR?

CHAR and VARCHAR have differed in storage and retrieval. CHAR column length is fixed, while VARCHAR length is variable. The maximum no. of character CHAR data types can hold is 255 characters, while VARCHAR can hold up to 4000 characters. CHAR is 50% faster than VARCHAR. CHAR uses static memory allocation, while VARCHAR uses dynamic memory allocation.