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
916 Views
Let us first create a −mysql> create table DemoTable1407 -> ( -> Name text -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert −mysql> insert into DemoTable1407 values('John, Bob'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1407 ... Read More
AmitDiwan
164 Views
Let us see an example and create a −mysql> create table DemoTable1406 -> ( -> Value int -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert −mysql> insert into DemoTable1406 values(10); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More
AmitDiwan
111 Views
To remove unnecessary whitespaces, use TRIM() in MySQL. Let us first create a −mysql> create table DemoTable1405 -> ( -> FirstName varchar(20), -> LastName varchar(20) -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert −mysql> insert into DemoTable1405 values(' ... Read More
AmitDiwan
504 Views
Let us first create a −mysql> create table DemoTable1619 -> ( -> ArrivalTime datetime -> ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert −mysql> insert into DemoTable1619 values(now()); Query OK, 1 row affected (0.40 sec) mysql> insert into DemoTable1619 values(curdate()); ... Read More
AmitDiwan
268 Views
For this, you can use INET_ATON(). Let us first create a −mysql> create table DemoTable1404 -> ( -> IpAddress varchar(40) -> ); Query OK, 0 rows affected (1.02 sec)Insert some records in the table using insert −mysql> insert into DemoTable1404 values('192.168.120.0'); Query OK, 1 row affected (0.43 ... Read More
AmitDiwan
429 Views
You cannot use UPDATE command with ORDER BY clause, but you can use SELECT statement with ORDER BY DESC.Let us first create a −mysql> create table DemoTable1403 -> ( -> DueDate timestamp -> ); Query OK, 0 rows affected (1.26 sec)Insert some records in the table using ... Read More
AmitDiwan
195 Views
For this, you can use substring() function in MySQL. For conditions, use MySQL CASE statement. Let us first create a −mysql> create table DemoTable1402 -> ( -> EmployeeName varchar(40) -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert −mysql> insert ... Read More
AmitDiwan
204 Views
Backticks would work if written correctly as in the below syntax −update `yourTableName` set `yourTableName`.`yourColumnName`='yourNewValue' where yourCondition;Let us first create a −mysql> create table `DemoTable_1401` -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert −mysql> ... Read More
AmitDiwan
3K+ Views
Each relation may have one or more candidate key. One of these candidate keys is called Primary Key. Each candidate key qualifies for Primary Key. Therefore, candidates for Primary Key is called Candidate Key. To implement candidate key in MySQL, set more than one column as unique key. These keys ... Read More
AmitDiwan
106 Views
No, it is possible to get the next primary key without adding a new record. Let us first create a −mysql> create table DemoTable1399 -> ( -> StudentId int NOT NULL AUTO_INCREMENT, -> PRIMARY KEY(StudentId) -> ); Query OK, 0 rows affected (0.53 sec)Insert some records ... Read More