Category Archives: SQ L& MYsql

IN and NOT In using mysql

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ IN and… Read More »

Distinct record selection using mysql

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ For only… Read More »

Selecting single column or some columns using mysql query?

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ For only… Read More »

Selecting a particular record using mysql query?

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ For finding… Read More »

Importance of wild card ‘*’ in mysql

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ For finding… Read More »

Finding how many rows in a table in Mysql?

See the Example Select * from mydoubts_data +———+————————-+——————–+ | EMPCODE | NAME | SALARAY CODE | +———+————————-+——————–+ | 787 | Vasanthan | K | | GORT | Shaji | S | | GKL | James | P | | IND | Abdul | ZO | | VIS | Sunil | F | +———+————————-+——————–+ For finding… Read More »

Indexing in mysql using php

indexes in mysql will increase the speed of your mysql queries. indexes are doing cloumn basis. for example if you have table with following fields ID,jobdescription,salary In this case to speed up the queries with jobdescription. then create an index for jobdescription. CREATE TABLE mydoubts_data ( jobdescription varchar, INDEX (jobdescription), salary INT(50), )

Difference between Delete and Truncate – Drop-Mysql

Delete: ——- 1. Delete operations can be rollback 2. We can use where clause in delete operation 3. Using delete function we can delete row by row 4. It will not reset the autoincrement field- suppose your last record id of autoincrement field is 4, then after delete operaion next entry will be starting with… Read More »

Different Type of Joins in Mysql

1. INNER JOIN 2. LEFT JOIN 3. RIGHT JOIN 4. OUTER JOIN(FULL OUTER JOIN) Example: ——– Use the below tables User table: ———– —————————– id | name | designationid —————————– 1 | Arun | 1 | —————————– 2 | jiju | 1 | —————————– 3 | Martin | 2 | —————————– 4 | Manu |… Read More »