![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
106 Views
For this, use the concept of ZEROFILL. It pads the displayed value of the field with zeros up to the display width set in the column definitionLet us first create a table −mysql> create table DemoTable626 (Value int(5) zerofill); Query OK, 0 rows affected (0.71 sec)Insert some records in the ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
220 Views
Let us first create a table −mysql> create table DemoTable625 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(100), StudentScore int ); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command −mysql> insert into DemoTable625(StudentFirstName, StudentScore) values('John', 98); Query OK, 1 row ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
644 Views
For this, you can use time_format() and time_diff(). To find the time difference, you need to use the time_diff() method. Let us first create a table −mysql> create table DemoTable624 (PunchIn datetime, PunchOut datetime); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
314 Views
Let us first create a table −mysql> create table DemoTable623 (FirstName varchar(100), LastName varchar(100), Age int); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable623 values('John', 'Smith', 23); Query OK, 1 row affected (0.66 sec) mysql> insert into DemoTable623 values('Adam', ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
332 Views
Let us first create a table −mysql> create table DemoTable622 (Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value1 int, Value2 int); Query OK, 0 rows affected (1.08 sec)Insert some records in the table using insert command −mysql> insert into DemoTable622(Value1, Value2) values(1000, 1000); Query OK, 1 row affected (0.23 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
70 Views
Let us first create a table −mysql> create table DemoTable621 (UserName varchar(100), UserEmailId varchar(100), UserLastPost datetime); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable621 values('John', 'John@gmail.com', '2019-04-10 11:01:10'); Query OK, 1 row affected (0.47 sec) mysql> insert into DemoTable621 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
3K+ Views
Let’s say we installed MySQL version is 8.0 on our Windows OS. The bin directory is present at the following location −C:\Program Files\MySQL\MySQL Server 8.0\binLet us check the location. The screenshot is as follows −These are the drives −Go to C: drive and click Program Files −Now, click “MySQL” and ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
343 Views
For this, you can use INSERT INTO….SELECT statement. Let us first create a table −mysql> create table DemoTabe1 (Marks int); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTabe1 values(68); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
7K+ Views
Let us first create a table −mysql> create table DemoTable719 (FirstNumber int, SecondNumber int); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable719 values(20, 10); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable719 values(500, 50); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
72 Views
For this, you can use a subquery. Let us first create a table −mysql> create table DemoTable618 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(100) ); Query OK, 0 rows affected (1.45 sec)Insert some records in the table using insert command −mysql> insert into DemoTable618(StudentFirstName) values('David'); Query ... Read More