Skip to content

Latest commit

 

History

158 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crystal-Clear-Oracle-SQL

Oracle SQL SQL Beginner to Advanced

Repository Size Last Commit GitHub Stars GitHub Forks

Learn SQL • Practice SQL • Understand SQL • Solve SQL Problems

A structured Oracle SQL learning, practice, revision, and interview preparation repository.


📌 About

Crystal-Clear-Oracle-SQL is a structured and comprehensive Oracle SQL learning repository created to provide a clear learning path from database fundamentals to advanced SQL querying, database design, normalization, database objects, best practices, and interview preparation.

The repository is designed with a strong focus on:

  • Understanding concepts clearly
  • Learning SQL syntax
  • Practicing practical queries
  • Understanding how queries work
  • Solving difficult SQL problems
  • Building database design knowledge
  • Understanding normalization
  • Preparing for SQL interviews
  • Developing SQL problem-solving skills
  • Writing readable and maintainable SQL

Instead of treating SQL as a collection of memorized queries, this repository focuses on developing the ability to convert a requirement into SQL logic.

Requirement
     ↓
Understand the Problem
     ↓
Identify Required Data
     ↓
Identify Tables
     ↓
Identify Relationships
     ↓
Build SQL Logic
     ↓
Write Query
     ↓
Execute & Verify
     ↓
Optimize & Explain

🎯 Objectives

The main objectives of this repository are to:

  • Build strong Oracle SQL fundamentals
  • Understand database concepts from the beginning
  • Learn SQL syntax systematically
  • Practice SQL queries extensively
  • Understand different SQL operators and functions
  • Master GROUP BY and HAVING
  • Understand subqueries and nested queries
  • Master different types of joins
  • Understand SQL command categories
  • Learn Oracle database objects
  • Understand ER diagrams and ER schemas
  • Learn database normalization
  • Solve interview-oriented SQL problems
  • Develop a systematic approach to difficult SQL queries
  • Learn SQL best practices
  • Improve SQL explanation skills for technical interviews

📚 Complete Course Coverage

01. Introduction

The repository begins with the fundamental concepts required to understand databases and SQL.

Topics include:

  • Data vs Database
  • Management of Facts and Figures
  • DBMS
  • Databases available in the market
  • History of Oracle
  • Versions of Oracle
  • Introduction to SQL
  • Table Structure
  • Rules for Storing Data

02. Data Types in Oracle SQL

Understanding data types is essential before creating database tables.

Topics include:

  • Data Types Overview
  • Numeric Data Types
  • Alphanumeric Data Types
  • DATE Data Type

03. Retrieving the Data

Learn how to retrieve information from database tables using SQL queries.

Topics include:

  • SELECT
  • Selecting specific columns
  • Selecting multiple columns
  • Retrieving complete table data
  • Query-based data retrieval

04. Case Sensitivity

Understanding how Oracle SQL handles case sensitivity.

Topics include:

  • SQL keywords
  • Table names
  • Column names
  • Character data
  • Case-sensitive comparisons
  • Practical examples

05. Constraints

Learn how constraints maintain data integrity and enforce rules on database tables.

Topics include:

  • UNIQUE
  • NOT NULL
  • PRIMARY KEY
  • FOREIGN KEY
  • DEFAULT
  • CHECK

06. Tables Used for Queries

Reusable tables and SQL scripts are provided for practical query exercises.

DEPT

Department-related information.

EMP

Employee-related information.

J_GRADE

Salary-grade information.

SQL scripts include:

01-DEPT.sql
02-EMP.sql
03-J_GRADE.sql

Recommended execution order:

01-DEPT.sql
      ↓
02-EMP.sql
      ↓
03-J_GRADE.sql

07. Operators in SQL

Learn how operators are used to build SQL conditions and expressions.

Topics include:

  • Arithmetic Operators
  • Relational Operators
  • Concatenation Operator
  • BETWEEN
  • NOT BETWEEN
  • IN
  • NOT IN
  • IS NULL
  • IS NOT NULL
  • LIKE
  • ESCAPE
  • AND
  • OR
  • Operator Precedence

08. ORDER BY Clause

Learn how to sort query results.

Topics include:

  • Ascending order
  • Descending order
  • Sorting using columns
  • Sorting using multiple columns
  • Ordering query results

09. Functions

Functions are used to perform operations on individual values or groups of rows.

Single-Row Functions

Topics include:

  • Character Functions
  • Number Functions
  • Date Functions
  • Conversion Functions

Multi-Row Functions

Topics include aggregate functions such as:

  • COUNT()
  • SUM()
  • AVG()
  • MAX()
  • MIN()

10. GROUP BY Clause

Learn how to divide rows into groups and perform aggregate calculations for each group.

Topics include:

  • GROUP BY
  • Grouping data
  • Aggregate functions with GROUP BY
  • Department-wise calculations
  • Group-based reports

11. HAVING Clause

Learn how to filter grouped results.

Topics include:

  • HAVING
  • WHERE vs HAVING
  • Aggregate conditions
  • Group filtering
  • Practical grouping queries

12. Subqueries / Inner Queries / Nested Queries

Learn how one SQL query can be placed inside another SQL query.

Topics include:

  • Subqueries
  • Inner Queries
  • Nested Queries
  • Single-row subqueries
  • Multi-row subqueries
  • Subquery-based filtering
  • Complex SQL problem solving

🔗 13. Joins

Learn how to retrieve related information from multiple tables.

Topics include:

  • Joins Overview
  • Inner Join
  • Equi Join
  • Natural Join
  • Left Outer Join
  • Right Outer Join
  • Full Outer Join
  • Cross Join
  • Cartesian Join
  • Self Join
  • Multiple-table joins
  • Join query practice

🧾 14. SQL Commands

Understand the major categories of SQL commands.

DDL — Data Definition Language

  • CREATE
  • ALTER
  • TRUNCATE
  • DROP

DML — Data Manipulation Language

  • INSERT
  • UPDATE
  • DELETE

DQL — Data Query Language

  • SELECT

DCL — Data Control Language

  • GRANT
  • REVOKE

TCL — Transaction Control Language

  • COMMIT
  • ROLLBACK
  • SAVEPOINT

🧮 15. Miscellaneous Queries

This section provides additional SQL query practice and helps strengthen query-writing and problem-solving skills.


🗄️ 16. Database Objects

Learn important Oracle database objects and their practical usage.

Topics include:

Views

  • Creating views
  • Using views
  • Removing views

Indexes

  • Index concepts
  • Creating indexes
  • Using indexes
  • Removing indexes

Stored Procedures

  • Procedure concepts
  • Creating procedures
  • Executing procedures

Triggers

  • Trigger concepts
  • Events and actions
  • BEFORE INSERT
  • AFTER INSERT
  • BEFORE UPDATE
  • AFTER UPDATE
  • BEFORE DELETE
  • AFTER DELETE
  • :NEW
  • :OLD

Sequences

  • Creating sequences
  • Removing sequences
  • NEXTVAL
  • CURRVAL
  • Using sequences with INSERT

Synonyms

  • Synonym concepts
  • Creating synonyms
  • Using synonyms
  • Removing synonyms

🏗️ 17. ER Diagram

Learn how databases can be represented visually using Entity-Relationship diagrams.

Topics include:

  • Entities
  • Attributes
  • Relationships
  • Primary Keys
  • Foreign Keys
  • Relationship representation
  • Database design concepts

🗺️ 18. ER Schema

Learn how ER concepts are represented as a database schema.

Topics include:

  • Entities
  • Attributes
  • Relationships
  • Tables
  • Primary Keys
  • Foreign Keys
  • Database structure
  • Schema design

🧩 19. Normalisation in Oracle SQL

A complete normalization section covering database design from fundamentals through advanced normal forms.

19.1 Normalisation Overview

  • Definition of normalization
  • Need for normalization
  • Data redundancy
  • Database organization
  • Normal forms

19.2 Database Anomalies

  • Insert Anomaly
  • Update Anomaly
  • Delete Anomaly

19.3 Keys and Functional Dependency

  • Super Key
  • Candidate Key
  • Primary Key
  • Alternate Key
  • Composite Key
  • Functional Dependency
  • Full Functional Dependency
  • Partial Dependency
  • Transitive Dependency

19.4 First Normal Form — 1NF

1NF → Atomic Values

Focus:

  • Atomic values
  • No repeating groups
  • One value per cell

19.5 Second Normal Form — 2NF

2NF → Remove Partial Dependency

Focus:

  • 1NF
  • Composite keys
  • Partial functional dependency
  • Full functional dependency

19.6 Third Normal Form — 3NF

3NF → Remove Transitive Dependency

Focus:

  • 2NF
  • Transitive dependency
  • Dependency between non-key attributes

19.7 BCNF

BCNF → Every Determinant Must Be a Super Key

Focus:

  • Boyce-Codd Normal Form
  • Super keys
  • Determinants
  • Functional dependencies

19.8 Fourth Normal Form — 4NF

4NF → Multivalued Dependency

Focus:

  • Multivalued dependencies
  • Independent multi-valued relationships
  • Decomposition

19.9 Fifth Normal Form — 5NF

5NF → Join Dependency

Focus:

  • Join dependency
  • Lossless decomposition
  • Project-Join Normal Form

19.10 Normalisation vs Denormalisation

Comparison between:

  • Normalization
  • Denormalization
  • Advantages
  • Disadvantages
  • Appropriate use cases

19.11 Complete Normalisation Example

A complete progression through:

Unnormalized Form
       ↓
1NF
       ↓
2NF
       ↓
3NF
       ↓
BCNF
       ↓
4NF
       ↓
5NF

19.12 Advantages and Disadvantages

Includes the benefits and limitations of normalization and denormalization.

19.13 Interview Questions

Interview-oriented questions covering:

  • Normalization
  • Anomalies
  • Functional dependencies
  • 1NF
  • 2NF
  • 3NF
  • BCNF
  • 4NF
  • 5NF
  • Normalization vs Denormalization
  • Scenario-based questions

19.14 Complete Revision

A final revision of the complete normalization section.

Quick Memory

1NF   → ATOMIC
2NF   → PARTIAL
3NF   → TRANSITIVE
BCNF  → SUPER KEY
4NF   → MULTIVALUED
5NF   → JOIN

✨ 20. Best Practices in Oracle SQL

The final section focuses on writing SQL that is clear, maintainable, understandable, and efficient.

Topics include:

  • Meaningful table names
  • Descriptive column names
  • Readable SQL
  • Consistent formatting
  • Uppercase SQL keywords
  • Avoiding unnecessary SELECT *
  • Understanding the purpose of every clause
  • Correct handling of NULL
  • Correct use of operators
  • Proper use of aggregate functions
  • WHERE vs HAVING
  • Effective joins
  • Appropriate use of subqueries
  • Avoiding redundant queries
  • Using constraints
  • Database normalization
  • Query testing
  • SQL debugging
  • Breaking difficult queries into smaller steps
  • Execution-thinking
  • Query optimization
  • Interview-oriented SQL practices

🧭 Learning Roadmap

Database Fundamentals
        ↓
Oracle SQL Fundamentals
        ↓
Data Types
        ↓
Data Retrieval
        ↓
Case Sensitivity
        ↓
Constraints
        ↓
Sample Tables
        ↓
Operators
        ↓
ORDER BY
        ↓
Functions
        ↓
GROUP BY
        ↓
HAVING
        ↓
Subqueries
        ↓
Joins
        ↓
SQL Commands
        ↓
Miscellaneous Queries
        ↓
Database Objects
        ↓
ER Diagram
        ↓
ER Schema
        ↓
Normalization
        ↓
Best Practices
        ↓
Interview Preparation

💻 SQL Problem-Solving Approach

One of the major goals of this repository is to develop the ability to solve SQL problems independently.

For any SQL problem:

1. Read the Question
          ↓
2. Understand What Is Required
          ↓
3. Identify the Expected Output
          ↓
4. Identify Required Tables
          ↓
5. Identify Table Relationships
          ↓
6. Identify Conditions
          ↓
7. Decide Whether JOIN Is Required
          ↓
8. Decide Whether GROUP BY Is Required
          ↓
9. Decide Whether HAVING Is Required
          ↓
10. Decide Whether a Subquery Is Required
          ↓
11. Build the Query
          ↓
12. Execute the Query
          ↓
13. Check the Output
          ↓
14. Debug if Necessary
          ↓
15. Optimize
          ↓
16. Explain the Logic

Core Formula

Question
   ↓
Logic
   ↓
SQL
   ↓
Output
   ↓
Explanation

🎯 Interview Preparation

The repository focuses on SQL concepts and practical problems commonly useful for technical interviews.

Important Query Patterns

  • Second Highest Salary
  • Nth Highest Salary
  • Highest Salary in Each Department
  • Employees Without Managers
  • Duplicate Records
  • Remove Duplicate Records
  • Top-N Records
  • Ranking Employees
  • Employees Joined in a Particular Year
  • Department-wise Salary Report
  • Count Employees Department-wise
  • Maximum Salary
  • Minimum Salary
  • Average Salary
  • Employees Above Average Salary
  • Employees Working in Multiple Departments
  • Multiple Table Joins
  • Correlated Subqueries

🧠 How to Represent SQL Knowledge in an Interview

When explaining a SQL problem:

Understand the Requirement
          ↓
Identify the Tables
          ↓
Identify the Relationship
          ↓
Identify Conditions
          ↓
Choose the SQL Concept
          ↓
Write the Query
          ↓
Explain Each Clause
          ↓
Explain the Result

A strong SQL interview answer should demonstrate:

  • Conceptual understanding
  • Query-writing ability
  • Logical thinking
  • Knowledge of joins
  • Knowledge of subqueries
  • Understanding of aggregation
  • Ability to debug
  • Ability to explain the solution

🗃️ Sample Database

The repository provides reusable SQL scripts for query practice.

DEPT
  │
  └── DEPT_ID
          │
          │
          ↓
         EMP
          │
          └── DEPT_ID

J_GRADE
  │
  └── Salary Grade Information

Main Tables

Table Purpose
DEPT Department information
EMP Employee information
J_GRADE Salary-grade information

🛠️ Tools & Technologies

Oracle SQL Oracle Database SQL Git GitHub

Recommended Oracle SQL Environments

  • Oracle SQL Developer
  • SQL*Plus
  • SQLcl
  • Oracle Live SQL

🚀 How to Use This Repository

1. Clone the Repository

git clone https://github.com/shaikbasha-dev/Crystal-Clear-Oracle-SQL.git

2. Open the Repository

Open the repository in your preferred development environment or directly through GitHub.

3. Follow the Numbered Sections

Start from:

01 Introduction

and progress sequentially through the repository.

4. Create the Practice Tables

Navigate to:

06 Tables Used for Queries/

Run:

01-DEPT.sql
02-EMP.sql
03-J_GRADE.sql

5. Practice Every Concept

For every topic:

Read
  ↓
Understand
  ↓
Execute
  ↓
Modify
  ↓
Experiment
  ↓
Solve
  ↓
Revise

📖 Recommended Learning Method

Read the Concept
       ↓
Understand the Definition
       ↓
Learn the Rules
       ↓
Study the Syntax
       ↓
Study Examples
       ↓
Execute Queries
       ↓
Observe Output
       ↓
Modify Queries
       ↓
Experiment
       ↓
Solve Without Assistance
       ↓
Explain the Solution
       ↓
Revise

Golden Rule

Don't just memorize the query. Understand why the query works.


📊 Repository Statistics

Category Details
Main Learning Sections 20
Markdown Documents 140
SQL Scripts 3
Main Practice Tables 3
Normal Forms 1NF → 5NF + BCNF
SQL Level Beginner → Advanced
Database Objects 6 Major Categories
Interview Preparation
Database Design
SQL Best Practices

👥 Who Is This Repository For?

🎓 Students

Students who want to build Oracle SQL knowledge from fundamentals.

💻 Developers

Developers who want to strengthen their SQL and database skills.

🧑‍💼 Job Seekers

Candidates preparing for SQL and database interview questions.

🔄 Learners Revising SQL

Anyone who wants a structured Oracle SQL revision path.

🗄️ Database Learners

Learners interested in database design, relationships, ER diagrams, and normalization.


⭐ Why Crystal-Clear-Oracle-SQL?

This repository brings together:

Concepts
   +
Syntax
   +
Queries
   +
Practice
   +
Database Design
   +
Normalization
   +
Problem Solving
   +
Interview Preparation
   +
Best Practices

The focus is on developing understanding and problem-solving ability, rather than simply collecting SQL commands.


📌 Key Learning Map

SQL Fundamentals
       │
       ├── Data Types
       ├── Data Retrieval
       ├── Operators
       ├── ORDER BY
       └── Functions
       
       ↓

Data Analysis
       │
       ├── GROUP BY
       └── HAVING
       
       ↓

Advanced Querying
       │
       ├── Subqueries
       └── Joins
       
       ↓

Database Management
       │
       ├── DDL
       ├── DML
       ├── DQL
       ├── DCL
       └── TCL
       
       ↓

Database Objects
       │
       ├── Views
       ├── Indexes
       ├── Procedures
       ├── Triggers
       ├── Sequences
       └── Synonyms
       
       ↓

Database Design
       │
       ├── ER Diagram
       ├── ER Schema
       ├── Keys
       └── Relationships
       
       ↓

Normalization
       │
       ├── 1NF
       ├── 2NF
       ├── 3NF
       ├── BCNF
       ├── 4NF
       └── 5NF
       
       ↓

Interview Preparation
       │
       ├── Difficult Queries
       ├── Common Patterns
       ├── Query Explanation
       └── Problem Solving
       
       ↓

Best Practices

🤝 Contributing

Contributions, suggestions, corrections, and improvements are welcome.

If you find:

  • A SQL error
  • A documentation issue
  • An incorrect explanation
  • A missing concept
  • A query that can be improved
  • A formatting issue
  • A useful learning improvement

you can contribute by opening an issue or submitting a pull request.

Contribution Flow

Fork
  ↓
Create Branch
  ↓
Make Changes
  ↓
Test Changes
  ↓
Commit
  ↓
Push
  ↓
Create Pull Request

⭐ Support the Project

If Crystal-Clear-Oracle-SQL helps you learn, practice, revise, or prepare for interviews:

  • ⭐ Star the repository
  • 🍴 Fork the repository
  • 📢 Share it with other learners
  • 💬 Provide feedback
  • 🤝 Contribute improvements

Your support helps the repository reach more learners and developers.


📄 License

This project is licensed under the MIT License.

The MIT License allows users to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software, subject to the conditions of the license.

See the LICENSE file for the complete license terms.


👨‍💻 Author

Shaik Mahaboob Basha

B.Tech — Electronics & Communication Engineering

Aspiring Java Full Stack Developer

Passionate about software development, programming, databases, and continuous learning.

This repository is part of my technical learning and development journey, with a focus on building strong Oracle SQL and database fundamentals through structured learning, practical queries, problem solving, and interview preparation.


🔗 Connect With Me

💼 LinkedIn

LinkedIn Profile

🐙 GitHub

GitHub Profile

🌐 Developer Portfolio

Developer Portfolio

📚 Repository

Crystal-Clear-Oracle-SQL


🌟 Final Learning Philosophy

Learn the Concept
       ↓
Understand the Logic
       ↓
Write the Query
       ↓
Execute the Query
       ↓
Analyze the Result
       ↓
Modify the Query
       ↓
Solve New Problems
       ↓
Explain the Solution
       ↓
Revise
       ↓
Improve

Good Queries Create Better Solutions.


☕ Learn SQL Today


💻 Practice Every Day


🧠 Build Strong Problem-Solving Skills


🚀 Build a Better Tomorrow


Crystal-Clear-Oracle-SQL

Learn SQL • Practice SQL • Understand SQL • Solve SQL Problems

```

About

A structured, beginner-to-advanced Oracle SQL learning and revision repository covering SQL concepts, queries, joins, subqueries, database objects, database design, normalization, best practices, and interview preparation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages