0% found this document useful (0 votes)
39 views2 pages

DBMS Summary SQL CheatSheet

A Database Management System (DBMS) is software for efficient data storage and retrieval, with popular examples including MySQL and Oracle. It distinguishes between DBMS and RDBMS, highlighting the importance of keys, normalization, and ACID properties in managing data integrity. The document also includes a SQL cheat sheet covering basic queries, joins, and commands for data manipulation and definition.

Uploaded by

13forwork1
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)
39 views2 pages

DBMS Summary SQL CheatSheet

A Database Management System (DBMS) is software for efficient data storage and retrieval, with popular examples including MySQL and Oracle. It distinguishes between DBMS and RDBMS, highlighting the importance of keys, normalization, and ACID properties in managing data integrity. The document also includes a SQL cheat sheet covering basic queries, joins, and commands for data manipulation and definition.

Uploaded by

13forwork1
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

DBMS Summary + SQL Cheat Sheet

1. What is DBMS?

A Database Management System (DBMS) is software for storing, managing, and retrieving data efficiently.

Popular DBMS: MySQL, PostgreSQL, Oracle, SQL Server.

2. DBMS vs RDBMS

- DBMS: Stores data in files, no relations.

- RDBMS: Stores data in tables with relations (keys).

3. Keys in DBMS

- Primary Key: Uniquely identifies a row.

- Foreign Key: Refers to a primary key in another table.

- Composite Key: Multiple columns as a unique key.

- Candidate Key: Eligible to be a primary key.

- Super Key: Any set of attributes that uniquely identifies a row.

4. Normalization (To Remove Redundancy)

- 1NF: Atomic values only.

- 2NF: No partial dependency (non-key depends on part of primary key).

- 3NF: No transitive dependency (non-key depends on non-key).

- BCNF: Every determinant is a candidate key.

5. ACID Properties of Transactions

A - Atomicity: All operations succeed or none.

C - Consistency: DB remains valid before/after transaction.

I - Isolation: Transactions don't interfere.

D - Durability: Changes persist after commit.

6. Views and Indexes

- View: Virtual table from SQL query.

- Index: Speeds up data retrieval.

7. SQL Cheat Sheet

Basic Queries:

SELECT * FROM table;


SELECT col1, col2 FROM table WHERE condition;

INSERT INTO table (col1, col2) VALUES (val1, val2);

UPDATE table SET col = value WHERE condition;

DELETE FROM table WHERE condition;

Joins:

INNER JOIN: Only matched rows.

LEFT JOIN: All from left + matched from right.

RIGHT JOIN: All from right + matched from left.

FULL JOIN: All rows from both sides.

DDL: CREATE, ALTER, DROP

DML: INSERT, UPDATE, DELETE

DCL: GRANT, REVOKE

TCL: COMMIT, ROLLBACK, SAVEPOINT

You might also like