0% found this document useful (0 votes)
4 views1 page

Essential MySQL Syntax Guide

The document outlines basic MySQL syntax for database management, including commands to create a database, use it, create and manage tables, and perform CRUD operations (Create, Read, Update, Delete). It provides specific examples for inserting, selecting, updating, filtering, ordering, and dropping data within a table. This serves as a quick reference for fundamental MySQL commands.

Uploaded by

xabiibmhtt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Essential MySQL Syntax Guide

The document outlines basic MySQL syntax for database management, including commands to create a database, use it, create and manage tables, and perform CRUD operations (Create, Read, Update, Delete). It provides specific examples for inserting, selecting, updating, filtering, ordering, and dropping data within a table. This serves as a quick reference for fundamental MySQL commands.

Uploaded by

xabiibmhtt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Basic MySQL Syntax

1. Create a Database
CREATE DATABASE my_database;

2. Use a Database
USE my_database;

3. Create a Table
CREATE TABLE employees (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
position VARCHAR(100),
salary DECIMAL(10,2)
);

4. Insert Data
INSERT INTO employees (name, position, salary)
VALUES ('Abdirahman', 'Developer', 5000.00);

5. Select Data
SELECT * FROM employees;
SELECT name, salary FROM employees;

6. Update Data
UPDATE employees
SET salary = 5500.00
WHERE name = 'Abdirahman';

7. Delete Data
DELETE FROM employees
WHERE id = 1;

8. Filter with WHERE


SELECT * FROM employees
WHERE salary > 4000;

9. Order Results
SELECT * FROM employees
ORDER BY salary DESC;

10. Drop Table


DROP TABLE employees;

You might also like