AmitDiwan has Published 10744 Articles

Overview of MySQL Programs

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:37:03

342 Views

There are many programs in a MySQL installation. Let us see an overview of some of the programs. Some programs are platform−specific, which means they are not present in all of MySQL distributions.Every MySQL program takes different options. There is a ‘- - help’ option that can be used to ... Read More

How to set initial value and auto increment in MySQL?

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:34:51

3K+ Views

The AUTO_INCREMENT attribute is used to generate a unique identify for new rows. If a column is declared as ‘NOT NULL’, it is possible to assign NULL to that column to generate a sequence of numbers.When any value is inserted into an AUTO_INCREMENT column, the column gets set to that ... Read More

Working with AUTO_INCREMENT Columns in MySQL

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:34:27

164 Views

Let us understand how to work with AUTO_INCREMENT columns in MySQL −The AUTO_INCREMENT attribute is used to generate a unique identify for new rows. Let us see how this statement works. Before that, consider the below query −QueryCREATE TABLE tableName (    id MEDIUMINT NOT NULL AUTO_INCREMENT,    name CHAR(30) ... Read More

MySQL AUTO_INCREMENT with Examples

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:30:30

472 Views

Let us understand how ATUO_INCREMENT works −The AUTO_INCREMENT attribute is used to generate a unique identify for new rows. Let us see how this statement works. Before that, consider the below query −QueryCREATE TABLE tableName (    id MEDIUMINT NOT NULL AUTO_INCREMENT,    name CHAR(30) NOT NULL,    PRIMARY KEY ... Read More

SQL queries for counter web visits per day, month, year and totals

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:26:53

561 Views

Let us understand how to form the query to find the number of web visits per day, per month, per year, and the total in MySQL:Note: We assume we have created a database named ‘DBNAME’ and a table named ‘tableName’.Let us see the MySQL query which can be used to ... Read More

How can I count visitors per page per day using MySQL?

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:26:14

445 Views

Note: We assume we have created a database named ‘DBNAME’ and a table named ‘tableName’.Let us understand how the count of visitors per day per page can be queried using MySQL. This can be done using the bit group function −QuerySELECT DATE(date) Date, page_id, COUNT(*) colName FROM tableName GROUP BY ... Read More

Making slow queries fast using composite indexes in MySQL

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:24:41

569 Views

Let us first see what is Composite Index −A composite index is an index that is used on multiple columns.It is also known as a multiple-column index.MySQL allows the user to create a composite index which can consist of up to 16 columns.The query optimizer uses the composite indexes for ... Read More

MySQL Composite Index

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:22:31

9K+ Views

A composite index is an index that is used on multiple columns. It is also known as a multiplecolumn index.FeaturesLet us see the features −MySQL allows the user to create a composite index which can consist of up to 16 columns.The query optimizer uses the composite indexes for queries which ... Read More

How to search multiple columns in MySQL?

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:20:27

2K+ Views

Let us understand how to search multiple columns in MySQL −Note: We assume we have created a database named ‘DBNAME’ and a table named ‘tableName’.The ‘AND’ and ‘OR’ operators can be used, depending on what the user wants the search to return.Let us see that with the help of an ... Read More

Searching on Two Keys in MySQL

AmitDiwan

AmitDiwan

Updated on 09-Mar-2021 13:18:53

183 Views

Let us understand how to search on two keys in MySQLSearching on two keys can be achieved using the ‘OR’ with the help of single key which is well optimized or using ‘AND’ which is well optimized. Let us see how searching on two different keys can be done combining ... Read More

Advertisements