
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
320 Views
For this, you can use round() along with avg(). Let us first create a table −mysql> create table DemoTable ( Score int ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(98); Query OK, 1 row affected (0.22 ... Read More

AmitDiwan
3K+ Views
There is no difference between TINYINT(1) and Boolean. The keyword Bool or Boolean internally converts into TINYINT(1) or we can say Bool or Boolean are synonymous with TINYINT(1).Let us first create a table −mysql> create table DemoTable ( isMarried Boolean ); Query OK, 0 rows affected (1.77 sec)Let us ... Read More

AmitDiwan
160 Views
For this, use AS select statement. Let us first create a table −mysql> create table DemoTable1 ( Score int ); Query OK, 0 rows affected (1.22 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(89); Query OK, 1 row affected (0.14 sec) mysql> insert ... Read More

AmitDiwan
134 Views
To find a minimum score from the entire four columns, use MySQL LEAST() function. Let us first create a table −mysql> create table DemoTable( Score1 int, Score2 int, Score3 int, Score4 int ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using ... Read More

AmitDiwan
170 Views
To select four random tables, use ORDER BY RAND(). Following is the syntax −select TABLE_NAME AS anyAliasName from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = ‘yourDatabaseName’; order by rand() limit yourLimitNumber;Let us implement the above syntax in order to select four random tables from a MySQL database that has thousands of tables.Here, LIMIT ... Read More

AmitDiwan
212 Views
To get the maximum value of a column, MySQL has a predefined aggregate function MAX(). Let us first create a table −mysql> create table DemoTable ( Id int ); Query OK, 0 rows affected (0.96 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100); ... Read More

AmitDiwan
577 Views
To fetch records from a specific column, use the following syntax. Just select that specific column for which you want the records −select yourColumnName from yourTableName;Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Score int ); Query OK, ... Read More

AmitDiwan
250 Views
Yes, use the AS keyword to create a MySQL alias. Let us first create a table −mysql> create table DemoTable ( FirstName varchar(100) ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris'); Query OK, 1 row affected ... Read More

AmitDiwan
4K+ Views
For this, you can use the ORDER BY CASE statement. Let us first create a table −mysql> create table DemoTable order by with vas Color varchar(100) ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Red'); Query OK, 1 ... Read More

AmitDiwan
2K+ Views
Let us first create a table −mysql> create table DemoTable ( Number int ); Query OK, 0 rows affected (0.80 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(189); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(178); Query OK, 1 ... Read More