29 NOV 2019

sql2

We got familiar with Data Base Management System (DBMS) and the Relational Data Base Management System (RDBMS). we explored what is SQL? and what is its purpose. we talked about the difference between SQL and noSQL databases. we downloaded the SQLite DB Browser and created our first DB using SQL queries.

nosql

SQL commands

  • Create Table:
    CREATE TABLE COMPANY(
       ID INT PRIMARY KEY     NOT NULL,
       NAME           TEXT    NOT NULL,
       AGE            INT     NOT NULL,
       ADDRESS        CHAR(50),
       SALARY         REAL
    );
  • Insert Row:
    INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
    VALUES (1, 'Paul', 32, 'California', 20000.00 );
  • Update Row(s):
    UPDATE COMPANY SET ADDRESS = 'Texas' WHERE ID = 6;
  • Delete Row(s):
    DELETE FROM COMPANY WHERE ID = 7;

    More SQLite – Tutorials point

sqlite.png

DB browser for SQLite – download link

More topics covered:

  • Advantages of using DBMS
  • Advantages of using RDBMS
  • DB in JSON format   { key : value }
  • DB normalization rules
  • Additional data bases: MySQL, MongoDB, PostgreSQL, etc.
  • noSQL usages
  • Auto Increment
  • Not-Null
  • SQLite data types

Links:

 

22 NOV 2019

rest.PNG

REST- Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services (RWS), provide interoperability between computer systems on the Internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations.
In a RESTful Web service, requests made to a resource’s URI will elicit a response with a payload formatted usually in JSON. The response can confirm that some alteration has been made to the stored resource, and the response can provide hypertext links to other related resources or collections of resources. When HTTP is used, as is most common, the operations (HTTP methods) available are GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS and TRACE
By using a stateless protocol and standard operations, RESTful systems aim for fast performance, reliability, and the ability to grow by reusing components that can be managed and updated without affecting the system as a whole, even while it is running.

Postman is one of the most popular tools used in API testing. it can simulate a GET POST PUT DELETE request in a single button click

JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It’s great for tutorials, testing new libraries, sharing code examples

Flask

  • Creating web service in flask
  • Implementing REST in flask

More topics covered:

  • using postman with flask
  • @app.route methods
  • flask debug
  • get method type
  • consuming web service in python code
  • making POST request in python code

Links:

15 NOV 2019

flask.png

What is Flask?

Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions. However, Flask supports extensions that can add application features as if they were implemented in Flask itself. Extensions exist for object-relational mappers, form validation, upload handling, various open authentication technologies and several common framework related tools. Extensions are updated far more frequently than the core Flask program.
Applications that use the Flask framework include Pinterest, LinkedIn, and the community web page for Flask itself.

More topics covered:

  • @app.route
  • parameters
  • template + static
  • html from template
  • redirect
  • url_for
  • render_template
  • python code inside HTML
  • form submitting
  • input type number, text, date, etc.

Links: