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

Should we allow our staff to use social networking sites? Some people say they are dangerous but I can't see how. Can you explain the dangers? > EXPERT RESPONSE There's nothing wrong with using Facebook, other than the potential impact on working time, but that's not a security matter! The issue is in how your staff configures Facebook, and what information they place on it. A few tips to pass on to your staff: Don't allow anyone that isn't part of your network of 'friends' to see your profile. Don't allow non-friends to see your friends. Why? I could easily impersonate one of your friends, fake a new profile, and send you an invite. You accept, thinking a genuine friend has created a new profile, then I'm in your network of friends and can see your profile. Think about what information is in your profile. What would be useful in stealing your identity? Date of birth, address, email address, employer, interests. why does this type of information n...

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...

Back to roots ....

While surfing came across this , back to basics : A programming language such as C , FORTRAN , or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer . Such languages are considered high-level because they are closer to human languages and further from machine languages . In contrast, assembly languages are considered low-level because they are very close to machine languages. The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter . The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Ada , Algol, BASIC , COBOL , C, C++ , FORTRAN, LISP , Pascal, and Prolog SOURCE : http://www.webopedia.com/TERM/H/high_level_language.html