Sep 18, 2024
Create Table
CREATE TABLE students (ID INT PRIMARY KEY, name VARCHAR(255));Insert Data
INSERT INTO students (ID, name) VALUES (1, 'Alex');Update Data
UPDATE students SET name = 'Alice' WHERE ID = 1;Delete Data
DELETE FROM students WHERE ID = 1;Select with Condition
SELECT * FROM students WHERE ID > 5;Count Total Students
SELECT COUNT(*) FROM students;Joining Tables
SELECT s.name, g.grade FROM students s JOIN grades g ON s.ID = g.student_id;Subquery
SELECT name FROM students WHERE ID = (SELECT MAX(ID) FROM students);Create View
CREATE VIEW student_view AS SELECT * FROM students WHERE ID > 5;*Basic Commands:
ls: List files and directoriescd: Change directoryrm: Remove filespwd: Print working directorytouch: Create a new fileSpecial Symbols:
~: Represents the current user's home directoryShell Scripting:
# for comments in scripts