Relational DB Design, SQL DDL, DML, DQL Queries, Inner/Outer Joins, Aggregation & Indexing.
MySQL is an open-source Relational Database Management System (RDBMS) that stores structured data in tables consisting of rows and columns. Relationships between tables are enforced via Primary Keys and Foreign Keys.
| SQL Sublanguage | Commands | Purpose |
|---|---|---|
| DDL | CREATE, ALTER, DROP, TRUNCATE | Defines schema structure and tables |
| DML | INSERT, UPDATE, DELETE | Manipulates data records inside tables |
| DQL | SELECT | Queries and retrieves formatted data |
| TCL | COMMIT, ROLLBACK, SAVEPOINT | Manages database transaction boundaries |
-- Create Database & Students Table
CREATE DATABASE IF NOT EXISTS kkcc_institute;
USE kkcc_institute;
CREATE TABLE students (
student_id INT PRIMARY KEY AUTO_INCREMENT,
full_name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE,
course VARCHAR(50) DEFAULT 'C Language',
joined_date DATE
);
-- Insert Records
INSERT INTO students (full_name, email, course, joined_date)
VALUES ('Ramu K.', 'ramu@kkccinfo.com', 'Python', '2026-01-15'),
('Meena T.', 'meena@kkccinfo.com', 'Core Java', '2026-02-01');
-- INNER JOIN: Fetch Student details along with Course Fee Info
SELECT s.student_id, s.full_name, c.course_name, c.fee
FROM students s
INNER JOIN courses c ON s.course = c.course_name
WHERE c.fee > 3000
ORDER BY s.full_name ASC;
GROUP BY and HAVING to calculate total revenue per course.LEFT JOIN between students and project allocations.