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 10740 Articles
AmitDiwan
164 Views
For this, use AVG(). To find the maximum average value, use MAX() and group by id. Let us first create a table −mysql> create table DemoTable -> ( -> PlayerId int, -> PlayerScore int -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in ... Read More
AmitDiwan
609 Views
For this, use INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1 -> ( -> PersonId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> PersonName varchar(20), -> PersonAge int, -> PersonCountryName varchar(20) -> ); Query OK, 0 rows affected (0.55 ... Read More
AmitDiwan
249 Views
Let us first create a table −mysql> create table DemoTable -> ( -> ClientId int, -> Value int -> ); Query OK, 0 rows affected (0.79 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 678); Query OK, 1 row affected ... Read More
AmitDiwan
296 Views
Let us first create a table −mysql> create table DemoTable1528 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(20), -> StudentSubject varchar(20) -> ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert ... Read More
AmitDiwan
3K+ Views
To insert records with double quotes, use the backslash (\) as in the below syntax −Syntaxinsert into yourTableName values('\"yourValue\"');Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table ... Read More
AmitDiwan
3K+ Views
To display only hour and minutes, use DATE_FORMAT() and set format specifiers as in the below syntax −select date_format(yourColumnName, '%H:%i') as anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable1527 -> ( -> ArrivalDatetime datetime -> ); Query OK, 0 rows affected (0.76 sec)Insert ... Read More
AmitDiwan
404 Views
Let us first create a table −mysql> create table DemoTable1526 -> ( -> CustomerName varchar(20), -> PurchaseDate date -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command. Here, we have inserted 2019 dates −mysql> insert into DemoTable1526 values('Adam', ... Read More
AmitDiwan
225 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Value int -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(78); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More
AmitDiwan
291 Views
Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentMarks int -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command. We have also inserted duplicate records ... Read More
AmitDiwan
1K+ Views
To insert data from one table to another, use the INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1 -> ( -> Id int, -> FirstName varchar(20) -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table ... Read More