![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
AmitDiwan has Published 11365 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
211 Views
For this, use NOT IN. Let us first create a table −mysql> create table DemoTable(Value int); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1234); Query OK, 1 row affected (0.54 sec) mysql> insert into DemoTable values(2345); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
147 Views
Let us first create a table −mysql> create table DemoTable821(AdmissionDate datetime); Query OK, 0 rows affected (1.24 sec)Insert some records in the table using insert command −mysql> insert into DemoTable821 values('2019-01-21'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable821 values('2018-11-02'); Query OK, 1 row affected (0.10 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
253 Views
To fetch only the last five records below is the syntax −select *from yourTableName order by yourColumnName DESC LIMIT 5;Let us first create a table −mysql> create table DemoTable820( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(100) ); Query OK, 0 rows affected (0.53 sec)Insert some records ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
129 Views
To display grants, the syntax is as follows −show grants for yourUserName;Let us implement the above syntax in order to check user rights before attempting to create database.Case 1 −This is for current user which is root. Following is the syntax −mysql> show grants for current_user;This will produce the following output ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
Let us first create a table −mysql> create table DemoTable819( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100) ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable819(StudentName) values('Chris'); Query OK, 1 row affected (0.20 sec) mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
Let us first create a table −mysql> create table DemoTable845(AdmissionDate date); Query OK, 0 rows affected (1.10 sec)Insert some records in the table using insert command −mysql> insert into DemoTable845 values('2018-01-21'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable845 values('2016-12-12'); Query OK, 1 row affected (0.13 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
Use SHA2() to convert the MD5 password to SHA256. It calculates the SHA-2 family of hash functions i.e. SHA-224, SHA-256, SHA-384, and SHA-512).Let us first create a table −mysql> create table DemoTable818(UserPassword text); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
133 Views
For this, you can use subquery. Let us first create a table −mysql> create table DemoTable844( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Amount int ); Query OK, 0 rows affected (0.95 sec)Insert some records in the table using insert command −mysql> insert into DemoTable844(Amount) values(80); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
120 Views
Use IFNULL to check for NULL values and set a value using the SET command. Let us first create a table −mysql> create table DemoTable817(Value int); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable817 values(10); Query OK, 1 row ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
158 Views
Use INFORMATION_SCHEMA.SCHEMA_PRIVILEGES to display all grants for a user −select *from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES;Let us implement the above syntax to show all grants for a user −mysql> select *from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES;This will produce the following output −+-----------------------------+---------------+--------------------+-------------------------+--------------+ | GRANTEE | TABLE_CATALOG | TABLE_SCHEMA ... Read More