DiplomaIntermediate

DPDT - Diploma in Python & Database Technology

Python programming and OOP, SQL/MySQL, data modelling, CRUD, joins, AI-assisted debugging and a database-backed Python project.

Talk to a counsellor about DPDT - Diploma in Python & Database Technology

Fees, batch dates and timings are shared by a counsellor. No payment is needed to ask.

What you will cover
  • Python programming
  • OOP
  • SQL/MySQL
  • data modelling
  • CRUD
  • joins
  • AI-assisted debugging
  • a database-backed Python project

Topic list from the institute's programme record.

Certification

Certificate terms for this programme are confirmed by the institute at admission. Any ADIVAS course-completion certificate is an institute certificate; it is not a university degree, an externally accredited qualification or a vendor certification (such as AWS or Microsoft) unless the institute states so in writing.

The programme title is as supplied in the institute's list. Please confirm the awarding body and recognition with the institute before enrolling.

Curriculum 0.1 · Draft: written for ADIVAS and awaiting academic review and approval. Topics and weeks may change before your batch starts.

Your skill trail

You move through 6 stations. Each week builds one skill you can show, not just a topic you have heard.

  1. Python fundamentals

    Write and run Python programs that process input, collections and files.

    • Week 1 First steps in Python
    • Week 2 Decisions and loops
    • Week 3 Functions and modules
    • Week 4 Lists, tuples, dictionaries and sets
    • Week 5 Files, CSV, JSON and exceptions
  2. Objects, packages and quality

    Model problems with classes, organise packages and test and debug code.

    • Week 6 Classes and objects
    • Week 7 Inheritance and dataclasses
    • Week 8 Environments, packages and pytest
    • Week 9 Debugging and AI-assisted debugging
  3. Relational databases and SQL

    Design tables and write SQL queries in MySQL.

    • Week 10 Data modelling
    • Week 11 Normalisation and MySQL DDL
    • Week 12 CRUD in SQL
    • Week 13 Joins
    • Week 14 Aggregates, subqueries, indexes and transactions
  4. Python with MySQL

    Build a safe data-access layer in Python.

    • Week 15 Connecting Python to MySQL
    • Week 16 A repository layer for CRUD
    • Week 17 Transactions, errors and SQL injection
    • Week 18 Reports and data import/export
  5. Application layer and testing

    Expose the data through a small web interface and verify it with automated tests.

    • Week 19 A command-line application
    • Week 20 A small Flask web interface
    • Week 21 Testing the database layer
    • Week 22 Performance, backup and security habits
  6. Capstone

    Deliver and present a complete database-backed application.

    • Week 23 Capstone build
    • Week 24 Capstone demonstration
  7. Bookstore Order Manager

    Your project, reviewed by a trainer.

The ADIVAS mastery ladder: how each skill is recognised
  1. Explored You have seen the idea and tried a first example.
  2. Practising You can do it with hints and keep improving.
  3. Proficient You complete the weekly practical task correctly on your own.
  4. Proven You apply it in a project reviewed by your trainer.

Skill-level tracking is being added to the learner workspace. Your trainer already reviews weekly practical work.

What you will be able to do

  • Write Python programs using variables, control flow, functions, collections, files and exception handling.
  • Design classes with encapsulation, inheritance and dataclasses, and organise code into modules and packages.
  • Create a relational data model with keys and normalisation, and implement it in MySQL.
  • Write SQL for CRUD, joins, aggregates, subqueries and transactions.
  • Connect Python to MySQL using parameterised queries and prevent SQL injection.
  • Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion.
  • Build, document and demonstrate a database-backed Python application with a simple web or command-line interface.

Who it suits

  • School Class 11-12 students who enjoy logic and want a practical start in Python and data handling.
  • College Science, engineering and commerce students who need Python and database skills for projects, analytics and internships.
  • Professional Working adults, accountants and analysts who want to automate work and build small database applications.

Prerequisites: Basic computer skills. No prior programming needed; the first weeks teach Python from scratch. Tools: Current Python 3 release, Visual Studio Code, MySQL Community Server and MySQL Workbench (or DBeaver), mysql-connector-python, pytest, Flask, Git and a GitHub account, A reputable AI coding assistant for guided practice.

Weekly plan

Python fundamentals Weeks 1–5

Week 1: First steps in Python

Theory
  • Running Python, the REPL and scripts
  • Variables, int, float, str, bool and type conversion
  • input(), print() and f-strings
Lab
Install Python and VS Code, then write a bill calculator that reads quantity and price, adds 18% GST and prints the total with two decimals.
Homework
Write programs for simple interest, BMI and converting minutes to hours and minutes.
Deliverable
A folder of three scripts with comments, saved in Git.
Weekly checkpoint
Predict output of five short snippets, including one type-conversion error.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling.

Week 2: Decisions and loops

Theory
  • if, elif, else and comparison operators
  • for and while loops, range, break and continue
  • Tracing a program by hand
Lab
Build a number guessing game with limited attempts and a multiplication table printer.
Homework
Print all numbers below 100 divisible by 3 or 5 and their sum.
Deliverable
A game with clear messages and a trace table for one sample run.
Weekly checkpoint
Trace a nested loop on paper; find an infinite loop.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling.

Week 3: Functions and modules

Theory
  • def, parameters, default values and return
  • Scope and why to avoid global variables
  • Importing the standard library: math, random and datetime
Lab
Refactor the grade program into functions for validation, average and grade lookup, and put them in a separate module.
Homework
Write is_leap_year() with five test inputs and explain the edge cases.
Deliverable
A two-file program with docstrings.
Weekly checkpoint
Read a function and state its inputs, output and side effects.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling.

Week 4: Lists, tuples, dictionaries and sets

Theory
  • Lists, slicing and sorting
  • Dictionaries and sets, when to choose each
  • List comprehensions
Lab
Store student marks in a dictionary of lists and report class topper, subject averages and duplicate roll numbers using a set.
Homework
Rewrite two for-loops as comprehensions and compare readability.
Deliverable
A marks analysis program.
Weekly checkpoint
Choose the right collection for four scenarios; fix a KeyError.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling.

Week 5: Files, CSV, JSON and exceptions

Theory
  • Reading and writing text files with with open()
  • csv and json modules
  • try/except/else/finally and raising errors
Lab
Read a CSV of shop sales, skip bad rows with a clear message, write a JSON summary and a cleaned CSV.
Homework
Add a log file that records every skipped row with its line number.
Deliverable
A sales cleaner that never crashes on bad input.
Weekly checkpoint
Predict what each except block catches; fix a file-not-closed bug.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling.
Objects, packages and quality Weeks 6–9

Week 6: Classes and objects

Theory
  • Classes, __init__ and instance attributes
  • Methods, __str__ and __repr__
  • Encapsulation with properties and validation
Lab
Model an Account class with validated deposit and withdraw methods and a transaction list.
Homework
Add a monthly interest method and three test cases.
Deliverable
An accounts module with a demo script.
Weekly checkpoint
Code reading: explain what happens to shared mutable state in a class.
You will be able to
Design classes with encapsulation, inheritance and dataclasses, and organise code into modules and packages.

Week 7: Inheritance and dataclasses

Theory
  • Inheritance, super() and method overriding
  • Composition versus inheritance
  • @dataclass, equality and ordering
Lab
Create a Person base class with Student and Trainer subclasses and a dataclass for Course; print a polymorphic report.
Homework
Replace an inheritance misuse in your sample code with composition.
Deliverable
An institute model with a short design note.
Weekly checkpoint
Predict output with overriding and super(); choose inheritance or composition for given cases.
You will be able to
Design classes with encapsulation, inheritance and dataclasses, and organise code into modules and packages.

Week 8: Environments, packages and pytest

Theory
  • Virtual environments and pip with requirements.txt
  • Packages and project layout
  • pytest basics, assertions and fixtures
Lab
Create a package with two modules, install pytest in a virtual environment and write 10 tests for the Account class.
Homework
Add tests for invalid inputs and measure which lines are untested.
Deliverable
A tested package with a requirements file.
Weekly checkpoint
Write two tests for a given function; explain what a fixture does.
You will be able to
Design classes with encapsulation, inheritance and dataclasses, and organise code into modules and packages. Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion.

Week 9: Debugging and AI-assisted debugging

Theory
  • Reading tracebacks from bottom to top
  • Using the VS Code debugger and logging
  • Prompting an AI for explanations and verifying its suggestions
Lab
Fix five seeded bugs in a provided program; for two of them ask an AI assistant for help and test its suggested fix before accepting.
Homework
Write a debugging journal: symptom, hypothesis, evidence, fix, and whether the AI advice was right.
Deliverable
A debugging journal with five entries.
Weekly checkpoint
Given a traceback and an AI explanation, decide which parts are reliable.
You will be able to
Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion.
Relational databases and SQL Weeks 10–14

Week 10: Data modelling

Theory
  • Entities, attributes and relationships
  • Primary keys, foreign keys and cardinality
  • Drawing an ER diagram
Lab
Model a bookstore with Customers, Books, Orders and OrderItems and draw the ER diagram.
Homework
Model a school library and justify each key.
Deliverable
An ER diagram with cardinality labelled.
Weekly checkpoint
Identify the relationship type in four scenarios.
You will be able to
Create a relational data model with keys and normalisation, and implement it in MySQL.

Week 11: Normalisation and MySQL DDL

Theory
  • First, second and third normal form
  • CREATE TABLE, data types, constraints and AUTO_INCREMENT
  • Installing and using MySQL Workbench
Lab
Normalise a flat order sheet and create the tables in MySQL with proper constraints.
Homework
Insert 20 sample rows and prove that constraints reject bad data.
Deliverable
A schema.sql file that rebuilds the database from scratch.
Weekly checkpoint
Find update, insert and delete anomalies in a flat table.
You will be able to
Create a relational data model with keys and normalisation, and implement it in MySQL.

Week 12: CRUD in SQL

Theory
  • INSERT, SELECT, UPDATE and DELETE
  • WHERE, ORDER BY, LIMIT, LIKE and NULL handling
  • Safe updates: always preview with SELECT first
Lab
Run a CRUD workbook on the bookstore database, including three deliberately failing statements and an explanation of each error.
Homework
Write the statements to apply a 10% discount to one category only and verify the count of changed rows.
Deliverable
A commented CRUD script.
Weekly checkpoint
Predict the affected rows of five statements.
You will be able to
Write SQL for CRUD, joins, aggregates, subqueries and transactions.

Week 13: Joins

Theory
  • INNER, LEFT and self joins
  • Join conditions and duplicate rows
  • Table aliases and readable queries
Lab
Write queries for orders with customer names, customers with no orders and the books never ordered.
Homework
Explain in words why a missing ON clause creates a huge result.
Deliverable
A query pack of eight join queries.
Weekly checkpoint
Count rows for joins on small tables.
You will be able to
Write SQL for CRUD, joins, aggregates, subqueries and transactions.

Week 14: Aggregates, subqueries, indexes and transactions

Theory
  • GROUP BY, HAVING and aggregate functions
  • Subqueries and common table expressions
  • Indexes, EXPLAIN and ACID transactions
Lab
Report monthly sales and top customers, add an index and compare EXPLAIN before and after; demonstrate a rolled-back transaction.
Homework
Write a query to find customers who spent above the average order value.
Deliverable
A report script and an index comparison note.
Weekly checkpoint
Fix a wrong HAVING versus WHERE query; explain what a transaction ensures.
You will be able to
Write SQL for CRUD, joins, aggregates, subqueries and transactions.
Python with MySQL Weeks 15–18

Week 15: Connecting Python to MySQL

Theory
  • Database drivers and connection settings
  • Cursors, execute and fetch
  • Parameterised queries and why not to build SQL with f-strings
Lab
Connect with mysql-connector-python, read credentials from environment variables and list books by category using a parameterised query.
Homework
Write a function that returns a list of dictionaries from a query.
Deliverable
A connection module with no passwords in code.
Weekly checkpoint
Spot the SQL injection risk in a code listing.
You will be able to
Connect Python to MySQL using parameterised queries and prevent SQL injection.

Week 16: A repository layer for CRUD

Theory
  • Separating data access from business logic
  • Mapping rows to dataclasses
  • Connection and cursor lifecycle with context managers
Lab
Create BookRepository with add, get, list, update and delete methods returning dataclass objects.
Homework
Add search by title with LIKE and pagination.
Deliverable
A repository module with docstrings.
Weekly checkpoint
Explain why SQL does not belong in the menu code.
You will be able to
Connect Python to MySQL using parameterised queries and prevent SQL injection. Design classes with encapsulation, inheritance and dataclasses, and organise code into modules and packages.

Week 17: Transactions, errors and SQL injection

Theory
  • commit and rollback from Python
  • Handling duplicate key and connection errors
  • Demonstrating and preventing SQL injection
Lab
Implement place_order that inserts an order and items inside one transaction and rolls back when stock is insufficient; show an injection attempt failing.
Homework
Write five test inputs that try to break the order function.
Deliverable
A safe order function with failure tests.
Weekly checkpoint
Order the steps of a safe transaction; explain a rollback scenario.
You will be able to
Connect Python to MySQL using parameterised queries and prevent SQL injection. Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion.

Week 18: Reports and data import/export

Theory
  • Bulk insert with executemany
  • Importing CSV with validation
  • Producing a summary report with CSV output
Lab
Import 500 rows of book data from CSV, reject invalid rows into an errors file and export a sales summary.
Homework
Compare the time of single inserts versus executemany for 1000 rows.
Deliverable
An importer with an error report.
Weekly checkpoint
Interpret a small import report and identify the cause of rejected rows.
You will be able to
Write Python programs using variables, control flow, functions, collections, files and exception handling. Connect Python to MySQL using parameterised queries and prevent SQL injection.
Application layer and testing Weeks 19–22

Week 19: A command-line application

Theory
  • Menu design and argparse
  • Separating the UI from services
  • Logging and user-friendly errors
Lab
Build a CLI for the bookstore with commands to add a book, list books and place an order.
Homework
Write a usage guide with three example sessions.
Deliverable
A working command-line application.
Weekly checkpoint
Demonstrate three commands live.
You will be able to
Build, document and demonstrate a database-backed Python application with a simple web or command-line interface.

Week 20: A small Flask web interface

Theory
  • HTTP requests, routes and templates
  • Forms, GET versus POST and JSON responses
  • Calling the repository from routes
Lab
Create Flask pages to list, search and add books and a /api/books JSON endpoint.
Homework
Add form validation and friendly error messages.
Deliverable
A Flask app on localhost with a screenshot set.
Weekly checkpoint
Trace a browser form post through the code.
You will be able to
Build, document and demonstrate a database-backed Python application with a simple web or command-line interface.

Week 21: Testing the database layer

Theory
  • Test databases and fixtures
  • Testing success, failure and edge cases
  • Test coverage and what it does not prove
Lab
Write pytest tests for BookRepository and place_order using a separate test schema that resets for each test.
Homework
Add tests for the Flask routes using the test client.
Deliverable
A suite of at least 15 passing tests.
Weekly checkpoint
Write a failing test first for a given bug.
You will be able to
Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion.

Week 22: Performance, backup and security habits

Theory
  • Choosing indexes and reading EXPLAIN
  • Backups with mysqldump and restore drills
  • Least-privilege database users and secret handling
Lab
Create a read-only reporting user, back up and restore the database to a new schema and verify row counts.
Homework
Write a one-page checklist for handing an app to a client.
Deliverable
A backup and restore log with verification.
Weekly checkpoint
Diagnose a slow query from an EXPLAIN output.
You will be able to
Write SQL for CRUD, joins, aggregates, subqueries and transactions. Connect Python to MySQL using parameterised queries and prevent SQL injection.
Capstone Weeks 23–24

Week 23: Capstone build

Theory
  • Planning milestones and acceptance tests
  • Code review checklist
  • Using AI assistants responsibly in a project
Lab
Build the capstone in pairs with a review session: every AI-suggested block must be read, run and tested before it is committed.
Homework
Prepare a README with setup steps and a data model diagram.
Deliverable
A feature-complete capstone in Git.
Weekly checkpoint
Mid-point review against the acceptance checklist.
You will be able to
Write pytest tests, debug systematically and use AI assistants to explain errors while verifying every suggestion. Build, document and demonstrate a database-backed Python application with a simple web or command-line interface.

Week 24: Capstone demonstration

Theory
  • Demonstration structure
  • Explaining design decisions
  • Next steps in data and backend learning
Lab
Present the application, run the tests live and answer questions on the schema, a query and one failure case.
Homework
Write a reflection on what you would improve.
Deliverable
The final repository, README and five-minute demo.
Weekly checkpoint
Panel evaluation with the capstone rubric.
You will be able to
Create a relational data model with keys and normalisation, and implement it in MySQL. Connect Python to MySQL using parameterised queries and prevent SQL injection. Build, document and demonstrate a database-backed Python application with a simple web or command-line interface.

Sample lessons

Week 15

Parameterised queries and SQL injection

When you build an SQL string by joining user input into the text, an attacker can type SQL instead of a name and change what the query does. This is SQL injection. A parameterised query sends the SQL and the values separately, so the database treats the value only as data. In Python connectors you write placeholders such as %s and pass the values as a tuple to execute().

Unsafe: string joining

  • User text becomes part of the SQL
  • Attacker can change the meaning
  • Data may leak or be deleted

Safe: parameters

  • SQL and values travel separately
  • Value is always treated as data
  • Same code, safe for any input
Keep SQL and data separate.

Step by step

  1. Write the SQL with placeholders: SELECT * FROM books WHERE category = %s.
  2. Pass values in a tuple: cur.execute(sql, (category,)).
  3. Never use f-strings or + to put user input into SQL.
  4. Test with a hostile input such as x' OR '1'='1 and confirm it returns nothing.

In real life

A college result portal that builds queries with string joining could let a student view every other student's marks by typing a crafted roll number.

Worked example

Problem. Why is cur.execute(f"SELECT * FROM users WHERE name = '{name}'") unsafe?

Solution. If name is x' OR '1'='1 the final SQL becomes WHERE name = 'x' OR '1'='1', which is always true and returns every user. With cur.execute("SELECT * FROM users WHERE name = %s", (name,)) the whole text is treated as one value.

Common mistakes

  • Believing that checking for quote characters is enough.
  • Parameterising values but still joining table or column names from user input without a whitelist.

Try it yourself

  • Convert three string-built queries in a sample file to parameterised queries.
  • Write a test that proves a hostile input is treated as plain text.

Week 14

Transactions: all or nothing

A transaction groups several SQL statements into one unit of work. Either all of them succeed and are committed, or any failure causes a rollback and the database returns to its earlier state. This protects data when a task needs more than one change, such as reducing stock and creating an order record. Databases that follow ACID rules give atomicity, consistency, isolation and durability.

  1. 1Start
  2. 2Insert order
  3. 3Reduce stock
  4. 4All OK? commit
  5. 5Error? rollback
Commit only when every step worked.

Step by step

  1. Start the transaction (connections usually start one automatically).
  2. Run the first statement: insert the order row.
  3. Run the second statement: insert items and reduce stock.
  4. If every step works, call commit().
  5. If any step raises an error, call rollback().

In real life

When you pay by UPI, money must leave your account and reach the shop together. If the second part fails, the first must be undone.

Worked example

Problem. Stock is 2. An order for 3 copies reduces stock after inserting the order header. The stock check then fails. What should happen?

Solution. Call rollback. The order header disappears, stock stays 2 and the customer sees an error. Without a transaction, an order row would exist with no items.

Common mistakes

  • Calling commit after each statement, so partial work is saved.
  • Catching an exception and forgetting to roll back.

Try it yourself

  • Write the pseudocode of a transfer between two accounts using a transaction.
  • List two failures that a rollback protects against.

Try the questions

The same skills are asked at three levels: School (Classes 6–12), College and Professional. Switch the level and the language (English or Tamil), and say how sure you are before you check: knowing what you are unsure about is part of learning.

Classes 6–12: everyday examples, no prior knowledge. Practice only. Nothing here is graded or saved.

Question 1 / 4 · Understand repetition in a program

A teacher wants to print the same greeting for each of 30 students. Which programming idea saves the most typing?

A teacher wants to print the same greeting for each of 30 students. Which programming idea saves the most typing?
How sure are you?

Projects

Bookstore Order Manager

Build a Python application backed by MySQL for a small Madurai bookshop to manage books, customers and orders. It must prevent selling more stock than available, use parameterised queries only, produce a sales report and include automated tests.

Tasks

  1. Design and create a normalised schema with keys and constraints.
  2. Implement a repository layer for books, customers and orders with parameterised queries.
  3. Write place_order using a transaction that rolls back on insufficient stock.
  4. Provide a CLI or Flask interface to add, search and order.
  5. Write at least 15 pytest tests, including failure cases.

Sample input

place_order(customer_id=2, items=[(book_id=5, qty=3)]) when only 2 copies are in stock

Expected output

The function raises a clear InsufficientStock error, no order rows are saved and stock remains 2.

How it is assessed

CriterionWeight
Schema design and normalisation20%
Correct, safe SQL and transactions25%
Python code quality and structure20%
Automated tests20%
Documentation and demo15%

Stretch challenge: Add a monthly top-sellers report and a CSV export.

Marks Analyser

Write a Python program that reads student marks from a CSV file, validates every row, stores valid rows in MySQL and prints subject averages and the class topper. Bad rows must go to an error file with reasons.

Tasks

  1. Parse and validate the CSV rows.
  2. Insert valid rows with executemany.
  3. Query averages per subject with GROUP BY.
  4. Write the error file and tests for the validator.

Sample input

101,Anu,Maths,92
102,Bala,Maths,abc

Expected output

Row 1 saved, row 2 written to errors.csv with reason 'marks not a number'.

How it is assessed

CriterionWeight
Validation correctness35%
Database usage30%
Tests20%
Clear output15%

Stretch challenge: Add a chart image of subject averages.

How you are assessed

Each week: a short quiz with code reading, output prediction and one debugging or SQL item; a lab submission committed to Git; and a trainer review. Modules end with an integrated checkpoint that includes a diagram or table question.

Practical work. Learners are assessed on running code and SQL scripts in a repository, on pytest results, and on a live capstone demonstration in which they explain the schema, a join and a failure case.

What trainers look forWeight
Working, correct Python and SQL35%
Testing and debugging evidence20%
Data model and query quality20%
Safe practice: parameters, secrets and backups10%
Explanation and responsible AI use15%

Where this can lead

  • Prepares you for junior Python developer and data-handling roles.
  • Prepares you for database-backed application and reporting work.
  • Builds a base for further study in data analysis, backend frameworks and cloud databases.

These describe skills you will build. ADIVAS does not guarantee jobs, placement or salary.