This are the top 10 MySQL queries are usually written once and then wrapped in class functions to minimize code repetition. 1. Create Table You would not use the create table query every time the script executes in normal scenarios. CREATE TABLE 'emp' ( 'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'name' VARCHAR(45) NOT NULL, 'lastname' VARCHAR(45), 'dept' VARCHAR(45) DEFAULT 'sales', PRIMARY KEY ('id') ) ENGINE = InnoDB; The above query creates a table "emp" in the selected database. We will have an "id" column as auto increment and with a PRIMARY KEY constraint, which ensures an incremented integer value is added every time a new row is inserted; the constraint checks for non-duplicate value. You can specify the "Engine" to be used while creating the table. We used "InnoDB" here because it allows FOREIGN KEY and transactions. 2. Insert Query Now that you have a t...