- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHPPhysics
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 10744 Articles
AmitDiwan
823 Views
Let us first create a table −mysql> create table DemoTable1 ( Name varchar(100), Gender ENUM('MALE', 'FEMALE') ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('Chris', 'Male'); Query OK, 1 row affected (0.17 sec) mysql> insert into ... Read More
AmitDiwan
133 Views
Let us first create a table −mysql> create table DemoTable ( Title text ); Query OK, 0 rows affected (0.39 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Introduction to MySQL'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values('Introduction to ... Read More
AmitDiwan
208 Views
To display, use DESC command or information_schema.columns. Let us first create a table and set options −mysql> create table DemoTable ( Color SET('RED', 'GREEN', 'BLUE', 'YELLOW') ); Query OK, 0 rows affected (0.47 sec)Case 1Here is the query to get the list of available options for SET using the ... Read More
AmitDiwan
935 Views
To insert random numbers, use RAND() function from MySQL. Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.15 ... Read More
AmitDiwan
137 Views
To delete a record in the required way, the syntax is as follows −delete from yourTableName where yourTableName .yourColumnName=yourValue;Let us first create a table −mysql> create table DemoTable ( StudentName varchar(100), StudentAge int ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert ... Read More
AmitDiwan
215 Views
Let us first create a table −mysql> create table DemoTable( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100), AdmissionDate date ); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name, AdmissionDate) values('Chris', '2019-11-21'); Query OK, 1 ... Read More
AmitDiwan
367 Views
Let us first create a table −mysql> create table DemoTable ( Name varchar(100), Age int ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 23); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable ... Read More
AmitDiwan
124 Views
For this, you can use COUNT(). Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.14 sec) mysql> insert ... Read More
AmitDiwan
594 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100) ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName) values('Chris'); Query OK, 1 row affected (0.18 sec) ... Read More
AmitDiwan
126 Views
Let us first create a table −mysql> create table DemoTable ( FirstName varchar(100), LastName varchar(100) ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 'Brown'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable ... Read More