SQL FOREIGN KEY Constraint

CREATE TABLE product ( category INT NOT NULL, id INT NOT NULL, price DECIMAL, PRIMARY KEY(category, id) ) ENGINE=INNODB; CREATE TABLE customer ( id INT NOT NULL, PRIMARY KEY (id) ) ENGINE=INNODB; CREATE TABLE product_order ( no INT NOT NULL AUTO_INCREMENT, product_category INT NOT NULL, product_id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY(no), … Read more

Creating a table with auto_increment

CREATE TABLE example_autoincrement ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, data VARCHAR(100) ); CREATE TABLE example_innodb ( id INT, data VARCHAR(100) ) TYPE=innodb;

copy a folder under linux server to windows server

MS-Windows shared folder: You can share data between windows and linux system for such use : For example you would like to access MS-Windows share called //windowsserver/sharename by mounting to /mnt/win directory under Linux system. So execute these commands: mkdir -p /mnt/win mount -t smbfs -o username=winntuser,password=mypassword //windowsserver/sharename /mnt/win Next create the password file /etc/sambapasswords: … Read more

Kill Command in Linux

kill is a shell builtin in most Bourne-derived shells such as Bash and Zsh. The command behavior is slightly different between the shells and the standalone /bin/kill executable. Use the type command to display all locations on your system containing kill: type -a kill