0% found this document useful (0 votes)
28 views3 pages

SQL Syntax and API Basics Explained

The document outlines basic SQL syntax for select, insert, update, and delete statements related to employee data. It also explains APIs, their functionality, and provides examples of use cases, particularly focusing on REST APIs and their key characteristics such as client-server architecture and statelessness. Additionally, it highlights the importance of uniform interfaces and cacheability in improving performance.

Uploaded by

John
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

SQL Syntax and API Basics Explained

The document outlines basic SQL syntax for select, insert, update, and delete statements related to employee data. It also explains APIs, their functionality, and provides examples of use cases, particularly focusing on REST APIs and their key characteristics such as client-server architecture and statelessness. Additionally, it highlights the importance of uniform interfaces and cacheability in improving performance.

Uploaded by

John
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL Basic Syntax

Select Statement
SELECT * FROM employees WHERE Salary > 55000.00;

Insert Statement
INSERT INTO employees (Employee_Id, Name, Age, Department,
Salary)
VALUES (1, 'John Doe', 30, 'HR', 60000.00);

Update Statement
UPDATE employees SET Salary = 65000.00 WHERE Employee_Id = 1;

Delete Statement
DELETE FROM employees WHERE Employee_Id = 1;
API
An API (Application Programming Interface) is a set of rules and protocols that allows
different software applications to communicate and exchange data, acting as a bridge
between them.
How APIs Work
1. Requests and Responses:
An API defines the specific requests a client application can make to a server and the
format of the responses it will receive.
2. Contract:
You can think of an API as a "contract" or a set of rules defining how two applications
will interact, ensuring they understand each other when sending and receiving
information.
3. Abstraction:
APIs provide a layer of abstraction, meaning they hide the complex internal details of
how a service works, only exposing what's necessary for the integration.
Examples and Use Cases
• Weather Apps: Use APIs from weather services to get real-time data and
forecasts for their users.
• E-commerce: Retailers use APIs for payment gateways like Stripe and PayPal to
process transactions.

REST API:
A REST API is a set of rules and guidelines for building a web-based API that allows
different software applications to communicate with each other over the
internet. These APIs follow the architectural style of Representational State Transfer
(REST).
Key characteristics of REST APIs:
• Client-Server Architecture: Separation of concerns between the client (e.g., web
browser, mobile app) and the server (where resources reside).
• Statelessness: Each request from a client to a server must contain all the
information necessary to understand the request. The server does not store any
client context between requests.
• Cacheability: Responses from the server can be designated as cacheable or non-
cacheable to improve performance.
• Uniform Interface: A consistent way for clients to interact with resources,
typically through standard HTTP methods (GET, POST, PUT, DELETE) and URIs
(Uniform Resource Identifiers) to identify resources.
• Layered System: The architecture can be composed of multiple layers (e.g.,
proxies, load balancers) without affecting the client-server interaction.

You might also like