- 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
George John has Published 1167 Articles
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
200 Views
Yes, we can order with mathematical operations using ORDER BY clause. Let us first create a table:mysql> create table orderByMathCalculation -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Quantity int, -> Price int -> ); Query OK, 0 rows affected (0.57 sec)Following ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
141 Views
Following is the syntax to add column using alter in MySQL:alter table yourTableName add column yourColumnName yourDataType default yourValue;Let us first create a table:mysql> create table alterTableDemo -> ( -> Id int, -> Name varchar(10) -> ); Query OK, 0 rows affected (0.69 sec)Let us check ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
839 Views
To suppress MySQL stored procedure output, you can use variable. Let us first create a table.mysql> create table person_information -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.50 sec)Following is the query to insert some records in the table ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
81 Views
Use INFORMATION_SCHEMA.TABLES to display tables in sorted order. The below syntax will give sorted list of tables in ascending order:select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA= 'yourDatabaseName' order by TABLE_NAME;Following is the query to implement the equivalent to SHOW TABLES:mysql> select TABLE_NAME from INFORMATION_SCHEMA.TABLES -> where TABLE_SCHEMA= 'sample' order by ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
331 Views
The codePoint() method is used to display a stream of code point values from the given sequence.The syntax is as followsIntStream codePoints()To work with Java IntStream class, you need to import the following packageimport java.util.stream.IntStream;Here is our stringString myStr = "Example!";Now, get the code point valuesIntStream intStream = myStr.codePoints();The following ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
57 Views
To get the count of rows in which two or more specified values appear, let us first create a sample table:mysql> create table specifiedValuesDemo -> ( -> Value int, -> Value2 int, -> Value3 int ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
274 Views
To create a double nested array in MongoDB, let us implement the query to create a collection with documents. Within that, we have created a double nested array that displays Student Details, with the project name and technologies used to develop the same project:> db.doubleNestedArrayDemo.insertOne( ... { ... "StudentId" ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
3K+ Views
To sort by character length in MySQL use the ORDER BY LENGTH(). Let us first create a table:mysql> create table orderingAADemo -> ( -> Value varchar(100) -> ); Query OK, 0 rows affected (1.30 sec)Following is the query to insert some records in the table using insert ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
1K+ Views
To convert bool to int in MySQL, you can use CAST(). Let us first create a table:mysql> create table convertBoolToIntDemo -> ( -> isYoung bool -> ); Query OK, 0 rows affected (0.69 sec)Following is the query to insert some records ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
538 Views
To get total number of fields in all tables in database, you can use information_schema.columns along with aggregate function count(*).We are using ‘sample’ database which consists of a lot of tables with fields. Following is the query to get total number of fields in all tables in database:mysql> SELECT COUNT(*) ... Read More