Python Classroom notes 07/May/2025

Databases

  • On a larger note we have two types of databases in terms of how they handle schema (structure)
    • Strict on Structure (Relational databases)
    • Minimal restrictions (NOSQL)
  • Relational database:

    • Data is tabular in nature.
    • Each column has a field and each row is a record
    • In a database i can have multiple tables
    • Tables can have relations between them
  • Relational database have a formal language which is based on standard (Strucutred Query Language)
  • Each DBMS adopts the standard and create their own query language
    • orcale => pl/sql
    • SQL Server => t-sql
    • mysql
    • postgres
  • SQL

    • Create:

      • create a books table
        “`sql
      • </ul>
        <h1>mysql</h1>
        CREATE TABLE books (
        id INT AUTO_INCREMENT PRIMARY KEY,
        title VARCHAR(255) NOT NULL,
        author VARCHAR(100) NOT NULL,
        description TEXT
        );
        <h1>microsoft sql server</h1>
        CREATE TABLE books (
        id INT IDENTITY(1,1) PRIMARY KEY,
        title VARCHAR(255) NOT NULL,
        author VARCHAR(100) NOT NULL,
        description TEXT
        );
        <h1>mysql</h1>
        INSERT INTO books (title, author, description) VALUES
        ('The Great Gatsby', 'F. Scott Fitzgerald', 'A novel set in the Roaring Twenties.'),
        ('To Kill a Mockingbird', 'Harper Lee', 'A novel about racial injustice in the Deep South.');
        <h1>microsoft sql server</h1>
        INSERT INTO books (title, author, description) VALUES
        ('The Great Gatsby', 'F. Scott Fitzgerald', 'A novel set in the Roaring Twenties.'),
        ('To Kill a Mockingbird', 'Harper Lee', 'A novel about racial injustice in the Deep South.');
        <code>* Retrieve</code>sql
        SELECT * FROM books;
        SELECT title, author FROM books;
        SELECT * FROM books WHERE author = 'Harper Lee';
        SELECT * FROM books ORDER BY title ASC;
        </li>
        </ul>
        <code>* Update</code>sql
        UPDATE books
        SET description = 'A classic American novel set in the 1920s.'
        WHERE title = 'The Great Gatsby';
        <code>* Delete</code>sql
        DELETE FROM books WHERE id = 1;
        “`

      Relational Database for Library

      Preview

      ORM (object relational mapping) libraries

      • ORM frameworks map table to a class
      • we can write the code where we deal with objects (records)
      • The advantage of using orm framework is your code works with any relational database.
      • Examples
        • Java: Hibernate
        • .net: EntityFramework
        • python: SQL Alchemy

      Application Types

      • Commandline
      • Desktop/Mobile Apps
      • Web:
        • Web Apps
        • Web APIs

      WebSite (WebApps)

      • Generation 1: Readonly
        • Technologies:
          • html, css, javascript
          • server: apache, iis
      • Generation 2: Interactivity
        • Technologies:
          • PHP, ASP, Servlets
          • Databases:
      • Generation 3: Improvements
        • Technologies
          • Asp.net, JSP, Python Django …, bootstrap (css)
          • Databases
      • Generation 4: Mobile Apps , Desktop Apps with Web
        Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube