image not found

PHP: MySQL Database

Example Structure of the SQL

CREATE TABLE employees ( id INT PRIMARY KEY, first_name VARCHAR(50), last_name VARCHAR(50), department VARCHAR(50), salary DECIMAL(10, 2));
INSERT INTO employees (id, first_name, last_name, department, salary) VALUES (1, 'ram', 'Gupta', 'Engineering', 75000.00);
UPDATE employees SET salary = 80000.00 WHERE id = 1;
DELETE FROM employees WHERE id = 1;
SELECT * FROM employees;

SELECT * FROM users WHERE status = 'active';
SELECT * FROM users WHERE status = 'inactive';
SELECT * FROM users WHERE status = 1;

Explanation
INSERT: Adds a new row to the employees table with the specified values.
UPDATE: Modifies the salary of the employee with id 1.
DELETE: Removes the row of the employee with id 1.
SELECT: Fetches all rows from the employees table.


empty

empty


Comments (0 )

Leave A Comment

Click for Ad