- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Smita Kapse has Published 558 Articles
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
97 Views
You can use ORDER BY RIGHT() for this. Let us first create a table −mysql> create table DemoTable ( UserId varchar(100) ); Query OK, 0 rows affected (0.33 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('User1234'); Query OK, 1 row affected ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
123 Views
Let us first create a collection with documents −> db.queryMongoValueDemo.insertOne( { _id:101, "ScoreDetails":[{Score:80}, {Score:45}, {Score:25}, {Score:70}] } ); { "acknowledged" : true, "insertedId" : 101 } > db.queryMongoValueDemo.insertOne( { _id:102, "ScoreDetails":[{Score:80}, {Score:24}, {Score:34}] } ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
18 Views
The getMaxColumnsInGroupBy() method of the DatabaseMetaData interface is used to find out the maximum number of columns that the underlying database allows in a GROUP BY clause.This method returns an integer value, representing the maximum number of columns allowed in a GROUP BY clause. If this value is 0 it ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
514 Views
You can use GROUP_CONCAT() function from MySQL to display result as a comma separated list. Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.26 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
28 Views
The getMaxColumnsInTable() method of the DatabaseMetaData interface is used to find out the maximum number of columns that the underlying database allows in a table.This method returns an integer value, representing the maximum number of columns allowed in a table. If this value is 0 it indicates that there is ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
78 Views
Use CHAR_LENGTH(yourColumnName) at the time of table creation. Let us first see an example and create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Title varchar(200), `Number_of_characters` int as (char_length(Title)) ); Query OK, 0 rows affected (0.18 sec)Insert some ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
340 Views
To count common elements, use COUNT() and GROUP BY. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Number int ); Query OK, 0 rows affected (0.20 sec)Insert some records in the table using insert command −mysql> ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
56 Views
The getMaxStatements() method of the DatabaseMetaData interface is used to find out the maximum number of open statements (objects) that the underlying database allows at one time.This method returns an integer value, representing the maximum number of statements that are allowed to be open at a time. If this value ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
670 Views
Let us first create a table −mysql> create table DemoTable ( UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserFirstName varchar(20), UserLastName varchar(20), UserAge int, UserCountryName varchar(20) ); Query OK, 0 rows affected (0.27 sec)Now check the description of table.mysql> desc DemoTable;This will produce ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
273 Views
To avoid repair with keycache in MySQL, you need to follow the below syntax −create table yourNewTableName as (select *from yourOldTableName); alter table yourNewTableName add index(yourCoumnName);Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(20), StudentLastName ... Read More