- Trending Categories
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
Found 4219 Articles for MySQLi
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
209 Views
Let us first create a table −mysql> create table DemoTable -> ( -> DueDate date -> ); Query OK, 0 rows affected (0.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-11'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable values('2019-04-19'); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+------------+ | DueDate | +------------+ | 2019-01-11 | | 2019-04-19 | +------------+ 2 rows in set (0.00 sec)Following is the query to display ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
460 Views
To find duplicate tuples, use GROUP BY HAVING clause. Let us first create a table −mysql> create table DemoTable -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.80 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(101, 'David'); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable values(101, 'Mike'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(100, 'Carol'); Query OK, 1 row affected (0.17 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
514 Views
Let us first create a table −mysql> create table DemoTable -> ( -> StudentName varchar(20), -> StudentMarks int -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 50); Query OK, 1 row affected (0.61 sec) mysql> insert into DemoTable values('David', 70); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable values('Chris', 80); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('David', 90); Query OK, 1 row affected (0.24 sec)Display all records from the table using select statement −mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
161 Views
Yes, you can store double and date in VARCHAR. Let us first create a table −mysql> create table DemoTable -> ( -> Amount varchar(20), -> JoiningDate varchar(20) -> ); Query OK, 0 rows affected (0.96 sec)Insert some records in the table using insert command. We are inserting varchar double and date values −mysql> insert into DemoTable values('150.50', 'Oct 10, 2019'); Query OK, 1 row affected (0.91 sec) mysql> insert into DemoTable values('173.45', 'Sept 11, 2018'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('173.90', 'Jan 01, 2017'); Query OK, 1 row affected (0.16 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
421 Views
To drop a primary key, use ALTER at first to alter the table. With that, use DROP to drop the key as in the belowSyntaxalter table yourTableName drop primary key;Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL, -> StudentName varchar(20), -> StudentAge int, -> primary key(StudentId) -> ); Query OK, 0 rows affected (0.48 sec)Here is the query to check the description of table −mysql> desc DemoTable;This will produce the following output−+-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
614 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, NULL); Query OK, 1 row affected (0.32 sec) mysql> insert into DemoTable values(NULL, 'David'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(NULL, NULL); Query OK, 1 row affected (0.15 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This will produce the following output−+------+-------+ | Id | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
86 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris Brown'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('Adam Smith'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('John Smith'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Carol Smith'); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
361 Views
Let us first create a table −mysql> create table DemoTable -> ( -> BreakfastTime time -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('7:30:45'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('8:00:30'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('7:55:00'); Query OK, 1 row affected (0.10 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This will produce the following output −+---------------+ | BreakfastTime | +---------------+ | 07:30:45 | | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
281 Views
To get the database name, use the below given syntax −select database();Let us implement the above syntax in the stored procedure −mysql> delimiter // mysql> create procedure get_procedure_database_name() -> begin -> select concat('The database name=',database()); -> end -> // Query OK, 0 rows affected (0.34 sec) mysql> delimiter ;Now you can call a stored procedure using CALL command −mysql> call get_procedure_database_name();This will produce the following output −+-----------------------------------------+ | concat('The database name=',database()) | +-----------------------------------------+ | The database name=web | +-----------------------------------------+ 1 row in set (0.05 sec) Query OK, 0 rows affected (0.08 sec)
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
83 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Value int -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(40); Query OK, 1 row affected (0.26 sec) mysql> insert into DemoTable values(60); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable values(45); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(85); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(78); Query OK, 1 row affected (0.10 sec)Display all records from the table ... Read More