Basic Tables: CRUD Operations
Create Table Statement
Syntax & Example
CREATE TABLE StudentRolls (
id INT PRIMARY KEY AUTO_INCREMENT,
desc VARCHAR(10) NOT NULL UNIQUE
);Syntax here is similar to MySQL. Above given example creates a table named StudentRolls with two columns: id (primary key) and desc (unique) (Strinh).
Insert Statement
Syntax & Example
INSERT INTO StudentRolls (desc)
VALUES ("Hello");This query inserts a record into the "StudentRolls" table. It adds a new row with the value 'Hello' in the 'desc' column.
Update Statement
Syntax & Example
UPDATE StudentRolls SET desc="WH" WHERE desc="Hello";
This query updates the 'desc' column in the 'StudentRolls' table. It changes the value from 'Hello' to 'WH' for the row where the 'desc' column is 'Hello'.
Delete Statement
Syntax & Example
DELETE FROM StudentRolls WHERE roll_no=12;
This query deletes a record from the "StudentRolls" table. It removes the row where the "roll_no" column is 12. If you want to know backend working for above queries kindly visit blog.