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

MySQL Exam Notes

The document provides comprehensive notes on MySQL, covering its features, data types, and key concepts like primary and foreign keys. It also discusses database design principles, SQL queries, joins, data manipulation, advanced features, and security measures. Each section highlights essential elements for understanding and working with MySQL effectively.

Uploaded by

jagrwagh
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)
3 views2 pages

MySQL Exam Notes

The document provides comprehensive notes on MySQL, covering its features, data types, and key concepts like primary and foreign keys. It also discusses database design principles, SQL queries, joins, data manipulation, advanced features, and security measures. Each section highlights essential elements for understanding and working with MySQL effectively.

Uploaded by

jagrwagh
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

MySQL Exam Notes

1. Basics of MySQL

• Features: Open-source RDBMS, fast, secure, multi-user support, cross-platform.


• Data Types: INT, FLOAT, CHAR, VARCHAR, TEXT, DATE, DATETIME.
• Primary Key: Unique, Not NULL, one per table.
• Foreign Key: Links tables, maintains referential integrity.
• SQL vs MySQL: SQL is a query language, MySQL is database software.

2. Database Design & Normalization

• 1NF: Atomic values, no repeating groups.


• 2NF: No partial dependency.
• 3NF: No transitive dependency.
• Relationships: One-to-One, One-to-Many, Many-to-Many.
• Constraints: NOT NULL, UNIQUE, CHECK, PRIMARY KEY, FOREIGN KEY.

3. SQL Queries

• SELECT statement to retrieve data.


• WHERE clause with LIKE, BETWEEN, IN.
• ORDER BY for sorting data.
• GROUP BY for grouping records.
• HAVING for condition on grouped data.
• Aggregate Functions: COUNT, SUM, AVG, MIN, MAX.

4. Joins & Subqueries

• INNER JOIN: Returns matching records.


• LEFT JOIN: All left table records.
• RIGHT JOIN: All right table records.
• FULL JOIN: Use UNION in MySQL.
• Self Join: Table joined with itself.
• Subqueries: Single-row, Multi-row, Correlated.

5. Data Manipulation
• INSERT: Add new records.
• UPDATE: Modify records.
• DELETE: Remove records.
• Transactions: COMMIT, ROLLBACK, SAVEPOINT.
• AUTO_INCREMENT: Auto increases primary key value.

6. Advanced Features

• Views: Virtual tables based on queries.


• Indexes: Improve search performance.
• Stored Procedures: Reusable SQL code blocks.
• Triggers: Auto-executed on INSERT/UPDATE/DELETE.

7. Security & Administration

• User Management: CREATE USER, GRANT, REVOKE.


• Backup using mysqldump command.
• Restore using mysql command with backup file.

You might also like