- 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
2K+ Views
For this, use the join concept. Let us first create a −mysql> create table DemoTable1389 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentMarks int -> ); Query OK, 0 rows affected (2.73 sec)Insert some records in the table using insert command. Here, ... Read More
AmitDiwan
1K+ Views
Following is the syntax −select * from yourViewName;Let us first create a table −mysql> create table DemoTable1388 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(40) -> ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert ... Read More
AmitDiwan
161 Views
To obtain multiple rows in a single MySQL query, use LIKE operator. Let us first create a table −mysql> create table DemoTable1385 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.90 sec)Insert some records ... Read More
AmitDiwan
380 Views
Let us first create a table −mysql> create table DemoTable1384 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(20), -> StudentAge int -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command. Here, we ... Read More
AmitDiwan
452 Views
For this, use aggregate function MAX(). Let us first create a table −mysql> create table DemoTable1383 -> ( -> Id int, -> PlayerScore int -> ); Query OK, 0 rows affected (0.90 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1383 values(200, ... Read More
AmitDiwan
339 Views
To swap two values in a column, use CASE WHEN statement. Let us first create a table −mysql> create table DemoTable1382 -> ( -> StudentName varchar(20) -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1382 ... Read More
AmitDiwan
515 Views
For maximum value, use MAX() along with CAST() for conversion. Since we want maximum value from string-numbers beginning with specific characters, use RLIKE. Let us first create a table −mysql> create table DemoTable1381 -> ( -> DepartmentId varchar(40) -> ); Query OK, 0 rows affected (0.48 sec)Insert ... Read More
AmitDiwan
167 Views
Let us first create a table −mysql> create table DemoTable1 -> ( -> StudentId int, -> StudentName varchar(20) -> ); Query OK, 0 rows affected (1.24 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(210, 'Adam'); Query OK, 1 row affected ... Read More
AmitDiwan
118 Views
To view cascades, use SHOW CREATE TABLE in MySQL. Let us first create a table −mysql> create table DemoTable1378 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> EmployeeId varchar(20), -> EmployeeFirstName varchar(20), -> EmployeeLastName varchar(20), -> EmployeeCountryName varchar(40), -> EmployeeAge ... Read More
AmitDiwan
109 Views
For this, use INTERVAL in MySQL. Let us first create a table −mysql> create table DemoTable1376 -> ( -> AdmissionDate date -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1376 values('2018-01-21'); Query OK, 1 row ... Read More