Ageless Dynasty
Published in

Ageless Dynasty

A SQL Cheat Sheet For 2022

Let’s Start!

Photo by Sunder Muthukumaran on Unsplash

What are the CRUD Commands?

Create” Operations

The create statement is called to create new tables in SQL.

CREATE TABLE your_table_name (your_column_name_ your_column_type_ constraints);
INSERT INTO table_name (column1, column2, column3 ) VALUES (value1, value2, value3);

Read” Operations

The read statement is called when reading rows from the table from a specific database.

SELECT column1, column2 FROM table_name;
SELECT * from table_name;

Update” Operations

The update statement is called when updating a row in a table.

UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;
ALTER TABLE studentMODIFY name varchar(100) not null;
UPDATE student
SET marks = 100, grade = "A*", subject = "Maths"
WHERE name = "Peter";

Delete” Operations

The delete statement is called when deleting a record from the table.

DELETE FROM table_name WHERE condition;
DELETE FROM student WHERE marks >= 100;
DROP TABLE student;

SUMMARY

SQL provides the CRUD functionality for creating: reading, updating, and deleting data. Get a head start with the specifics of SQL using TutorialZine which has a short to-the-point introduction to the basics of SQL.

Source | SQLTutorial.org

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
HRブログ

Talks about #realworld, #finance , #economics, #crypto and #technology.