DEV Community

Cover image for πŸš€ Day 21 of My Data Analytics Journey !
Ramya .C
Ramya .C

Posted on

πŸš€ Day 21 of My Data Analytics Journey !

Today, I focused on SQL concepts and explored important commands in MySQL Workbench.

πŸ“Œ What I Learned

  1. Table Operations CREATE TABLE IF NOT EXISTS β†’ Creates a table only if it doesn’t exist. DROP TABLE IF EXISTS β†’ Removes a table safely (avoids error if it doesn’t exist). SHOW TABLES; β†’ Lists all tables in the database. DESC table_name; β†’ Displays table schema (structure).
  2. Difference Between Commands TRUNCATE β†’ Removes all rows but keeps the table structure. DROP β†’ Deletes the entire table structure. DELETE β†’ Removes specific rows using a condition (WHERE).
  3. Querying Data SELECT * FROM employees; β†’ Fetch all rows. SELECT first_name, last_name FROM employees; β†’ Fetch specific columns. SELECT * FROM employees WHERE emp_id=5; β†’ Filter rows with condition. SELECT * FROM employees WHERE salary > 50000 AND salary < 60000; β†’ Using logical operators.
  4. Using LIKE for Pattern Matching
    LIKE 'John' β†’ Exact match.
    LIKE 'Jo%' β†’ Names starting with "Jo".
    LIKE '_o%' β†’ Second character "o".
    LIKE 'Raj%Gupta' β†’ Matches with prefix and suffix.
    Uploading image

  5. Date Functions
    DAY(hire_date), MONTH(hire_date), YEAR(hire_date) β†’ Extract date parts.
    DAYNAME(hire_date) β†’ Returns weekday.
    FORMAT(hire_date, 'dd') β†’ Custom date format.
    πŸ“š Concepts I Revised
    πŸ”Ή DBMS
    Database Management System – A software to store and manage data (example: MS Access).

πŸ”Ή RDBMS
Relational DBMS – Stores data in tables with relationships (example: MySQL, Oracle, SQL Server).

πŸ”Ή ORDBMS
Object-Relational DBMS – Supports both relational tables and object-oriented features like inheritance (example: PostgreSQL).

πŸ”Ή SQL
Structured Query Language – Standard language for managing and querying databases.

πŸ”Ή MySQL
An open-source RDBMS widely used in applications (websites, ERP, etc.). Uses SQL syntax.

πŸ”Ή PostgreSQL (psql)
An advanced ORDBMS, open-source, supports complex queries, JSON, advanced indexing.

πŸ”— How They Connect
SQL β†’ The language.
MySQL β†’ A software (RDBMS) that uses SQL.
PostgreSQL (psql) β†’ A more advanced ORDBMS that also uses SQL (with extra features).
DBMS, RDBMS, ORDBMS β†’ Categories of database systems where SQL is used.
πŸ‘‰ In simple words:

SQL = Language
MySQL = Tool (RDBMS)
PostgreSQL = Advanced Tool (ORDBMS)

Top comments (0)