Skip to main content

Some useful commands

How to change the engine type of a table :
>alter table reportsTransfer engine= innodb ;

How to add foreign key to a table :

>ALTER TABLE tbl_name
    ADD [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name, ...)
REFERENCES tbl_name (index_col_name, ...)
[ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
[ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION}]

e.g
>alter table reportsTransfer add foreign key reportsId (reportsInsertedId ) references reportsInserted (id)


Note
> Before adding a foreign key to table make sure both the tables ( Reference table and table having foreign key ) engine type = InnoDb .
>InnoDB
does not check foreign key constraints on those foreign key or referenced key
values that contain a NULL column.
>Currently, triggers are not activated by cascaded foreign key actions.

Explain doesn't works with Delete and Update statement.

Comments

Popular posts from this blog

How to Use Chisanbop (Korean Finger Math) for Basic Addition and Counting | eHow.com

How to Use Chisanbop (Korean Finger Math) for Basic Addition and Counting eHow.com Difficulty: Easy Instructions Step 1 In Chisanbop you'll be using your two hands and ten fingers to represent numbers from 0 to 99. Start out with your hands out in front of you with closed fists. This represents 0. Each finger (not thumb) on your right hand represents 1. To represent 3, just press down three right hand fingers. Your right thumb represents 5. To represent 7, press down your right thumb and 2 right hand fingers. Think of your right hand as the ones or units place (column). Step 2 Your left hand represents the tens place (column). Each finger on your left hand is worth 10. For example, to represent 30, press down three left hand fingers. To represent 38, do the same, but also use your right hand to represent 8 as described above. Your left thumb represents 50. To represent 86, press down your left thumb and three left hand fingers for the 80, and your right thumb and one righ...

SQL, Report Generation Processs

Step 1. Export SQL result in to an csv file Step 2. Report Validation ( Through Excel ) ------------- The lifeline for any business intelligence solution is the process called extract, transform, and load (ETL). According to a recent survey by The Data Warehousing Institute (TDWI), ETL design and development work consumes 60 to 80 percent of the resources of an entire BI project. Selecting an ETL solution that fits your needs is an essential first step in building a successful data warehouse.