- 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

An investment in knowledge pays the best interest
About
About Data Not Available/Given
Sharon Christine has Published 450 Articles

Sharon Christine
38K+ Views
The ERROR 1064 (42000) mainly occurs when the syntax isn’t set correctly i.e. error in applying the backtick symbol or while creating a database without them can also create an error, if you will use hyphen in the name, for example, Demo-Table will result in ERROR 1064 (42000).To remove the ... Read More

Sharon Christine
529 Views
For this, you can use GROUP BY clause along with IN(). Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in ... Read More

Sharon Christine
605 Views
You can use IFNULL() for this. Let us first create a table −mysql> create table DemoTable -> ( -> added_date date, -> updated_date date -> ); Query OK, 0 rows affected (0.95 sec)Insert some records in the table ... Read More

Sharon Christine
208 Views
Use DatabaseMetaData class to retrieve MySQL database structure. In this example, we will display all the table names of database “web” using Java with the help of getMetaData().Following is the Java code −Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import com.mysql.jdbc.DatabaseMetaData; public class getDatabaseInformationDemo { public static ... Read More

Sharon Christine
250 Views
To add a new column to an existing table, use ADD. With that, to add a new index, use the ADD INDEX(). Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Name varchar(100), -> PRIMARY KEY(Id) ... Read More

Sharon Christine
434 Views
For this, use BETWEEN operator in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Start int, -> End int -> ); Query OK, 0 rows affected (0.91 sec)Insert some records in ... Read More

Sharon Christine
98 Views
MySQL evaluates “TRUE or TRUE and FALSE” to true because AND has the highest priority than OR i.e. AND is evaluated before OR.The MySQL evaluates the above statement like this. The AND operator gets evaluated first −(TRUE or (TRUE AND FALSE))The statement (TRUE AND FALSE) gives the result FALSE. Then ... Read More

Sharon Christine
110 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Number int -> ); Query OK, 0 rows affected (0.83 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(20); Query OK, 1 row ... Read More

Sharon Christine
80 Views
Instead of IN(), use FIND_IN_SET to search between comma separated values within one field. Let us first create a table −mysql> create table DemoTable -> ( -> ListOfValues text -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in ... Read More

Sharon Christine
176 Views
Achieve this using ALTER TABLE. Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(100) -> ); Query OK, 0 rows affected (0.86 sec)Let us check the description of the table −mysql> desc ... Read More