- 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
Sharon Christine has Published 436 Articles
Sharon Christine
59 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Number int -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(9); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More
Sharon Christine
163 Views
The TYPE=HEAP deprecated in newer MySQL versions. You can use ENGINE=HEAP instead of TYPE. Following is the syntax −ENGINE=HEAP;Let us first create a table. Here, we have set Engine=HEAP −mysql> create TEMPORARY table DemoTable -> ( -> StudentId int, -> StudentName varchar(30) -> )Engine = HEAP; ... Read More
Sharon Christine
186 Views
Let us first create a table −mysql> create table DemoTable -> ( -> FirstName varchar(100), -> LastName varchar(100) -> ); Query OK, 0 rows affected (1.39 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Sam', 'Brown'); Query OK, 1 row affected (0.25 sec) mysql> ... Read More
Sharon Christine
562 Views
Let us first create a table with one of the columns as DueDate and another one “RepeatTime, which displays how many times, let’s say a user was reminded to submit the payment −mysql> create table DemoTable -> ( -> DueDate date, -> RepeatTime int -> ); ... Read More
Sharon Christine
521 Views
To update the constraint, use the MODIFY command. Following is the syntax −alter table yourTableName modify yourExistingColumnName yourExistingDataType NOT NULL; Let us first create a table −mysql> create table DemoTable -> ( -> UserId int NOT NULL AUTO_INCREMENT, -> UserFirstName varchar(100), -> UserLastName varchar(100), -> ... Read More
Sharon Christine
165 Views
There is no default ORDER BY value in MySQL. You need to specify ORDER BY clause explicitly. Following is the syntax −ORDER BY ASC; OR ORDER BY DESC;Let us first create a table −mysql> create table DemoTable -> ( -> StudentName varchar(100) -> ); Query OK, 0 ... Read More
Sharon Christine
69 Views
To fetch a single date from a column, use “LIMIT 1. To order it, use ORDER BY clause. Let us first create a table −mysql> create table DemoTable -> ( -> DueDate varchar(100) -> ); Query OK, 0 rows affected (1.16 sec)Insert some records in the table using insert command ... Read More
Sharon Christine
50 Views
Use zerofill for this in MySQL. Zerofill pads the displayed value of the field with zeros up to the display width specified in the column definition. For example, if column is set int(8), therefore the width is 8. If the number is let’s say 29654, then zero will be padded ... Read More
Sharon Christine
911 Views
Let us first create a table −mysql> create table DemoTable -> ( -> AdmissionDate date -> ); Query OK, 0 rows affected (1.38 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-05-12'); Query OK, 1 row affected (0.52 sec) mysql> insert into DemoTable values('2019-05-18'); ... Read More
Sharon Christine
215 Views
For this, use CASE statement. This will work even without using temporary tables. Let us first create a table −mysql> create table DemoTable -> ( -> UserName varchar(100), -> UserStatus varchar(100) -> ); Query OK, 0 rows affected (0.74 sec)Insert some records in the table using ... Read More