Ankith Reddy has Published 870 Articles

Is it possible to have a function-based index in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

290 Views

Function-based index wasn’t possible in MySQL versions below 5.6. Firstly, to create function-based index in MySQL, we will create a table. mysql> create table FunctionIndexDemo - > ( - > FirstName varchar(100) - > ); Query OK, 0 rows affected ... Read More

MySQL's DESCRIBE command?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

9K+ Views

The MySQL’s DESCRIBE or DESC both are equivalent. The DESC is the short form of DESCRIBE command and used to dipslay the information about a table like column names and constraints on column name. The DESCRIBE command is equivalent to the following command − SHOW columns from yourTableName command. ... Read More

How to create a MySQL table with MyISAM engine table?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

3K+ Views

To create a MySQL table with MyISAM engine, we can use ENGINE command. Let us first create a table using CREATE command. mysql> create table StudentRecordWithMyISAM -> ( -> Id int, -> StudentName varchar(100), -> StudentAge int ... Read More

How do I modify a MySQL column to allow NULL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

6K+ Views

For our example, let us create a table with NOT NULL constraint. After that, we will modify a column to allow NULL. The following is the query to create a table with NOT NULL constraint. mysql> create table AllowNullDemo -> ( -> id ... Read More

How to get the size of the tables of a MySQL database?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

449 Views

To get the size of the tables of a MySQL database, you can use the “information_schema.tables”. Here is the syntax to know the size of all tables. SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "yourDatabaseName" ... Read More

Why doesn't MySQL support millisecond / microsecond precision?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

668 Views

The millisecond/ microsecond precision wasn’t supported in previous versions like 5.6.4. But now MySQL supports millisecond/ microsecond precision with timestamp, datetime, and time. The official statement. “MySQL now supports fractional seconds for TIME, DATETIME, and TIMESTAMP values, with up to microsecond precision”. You can check the MySQL version on your ... Read More

How to display current connection info in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

3K+ Views

MySQL provides many functions that give the current connection information. For instance, to know about the current user, use the user() function. Syntax mysql> SELECT CURRENT_USER(); Here is the output that displays the name of the current user. +----------------+ | CURRENT_USER() | +----------------+ | root@% ... Read More

How to create boolean column in MySQL with false as default value?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

7K+ Views

To create a column with ‘false’ as the default value, we can use the concept of “default” at the time of creation of the table. Note − 0 represents false and 1 represents true. Creating a table using “default” false. mysql> create table TrueFalseTable -> ( ... Read More

Counters in C#

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:23

2K+ Views

Counters in C# are performance counters that lets you know about your applications performance. When you will build an application, whether it is a web app, mobile app or even desktop app, you would definitely need to monitor the performance. For performance counters in C#, use the System.Diagnostics.PerformanceCounter class. Set ... Read More

Difference between 'struct' and 'typedef struct' in C++?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:22

950 Views

In C++, there is no difference between 'struct' and 'typedef struct' because, in C++, all struct/union/enum/class declarations act like they are implicitly typedef'ed, as long as the name is not hidden by another declaration with the same name.Though there is one subtle difference that typedefs cannot be forward declared. So ... Read More

Advertisements