GET
Example
Section titled “Example”SELECT * FROM Employees WHERE EmployeeID = 1;Output
Section titled “Output”| EmployeeID | FirstName | LastName | JobTitle ||------------|-----------|----------|------------|| 1 | John | Doe | Developer |Explanation
Section titled “Explanation”The SELECT statement displayed retrieves all columns (*) for the employee with an EmployeeID of 1 in the Employees table. The output then shows the record of this employee with their ID, first name, last name, and job title.
Example
Section titled “Example”SELECT * FROM employees WHERE id = 1;Output
Section titled “Output”id | name | position----+------+--------- 1 | John | ManagerExplanation
Section titled “Explanation”The given SQL command retrieves all columns(*) for the record from the ‘employees’ table where the ‘id’ is 1. The returned output shows that there is an employee named ‘John’ who has the position ‘Manager’ and an ‘id’ value of 1.
Example
Section titled “Example”SELECT FirstName, LastNameFROM EmployeesWHERE EmployeeID = 1;Output
Section titled “Output”| FirstName | LastName ||-----------|----------|| John | Doe |Explanation
Section titled “Explanation”The example query fetches the first and last name from the Employees table where the EmployeeID is 1.
Oracle SQL does not have a GET method since it’s not REST-based. Instead, it uses SELECT statements to fetch data. Let’s show an example of how to retrieve data:
Example
Section titled “Example”SELECT first_name, last_nameFROM employeesWHERE employee_id = 100;Output
Section titled “Output”FIRST_NAME LAST_NAME------------ ------------Steven KingExplanation
Section titled “Explanation”In the given example, the SELECT statement is used to fetch the first_name and last_name of the employee from the ‘employees’ table where the employee_id is 100. The output shows that the employee with ID 100 is Steven King.
Example
Section titled “Example”SELECT * FROM Employees WHERE Age > 25;Output
Section titled “Output”| ID | NAME | AGE ||----|------------|-----|| 2 | Tom | 32 || 4 | Jerry | 27 || 6 | Mick | 28 |Explanation
Section titled “Explanation”The SQL statement selects all the records from the table “Employees” where “Age” is greater than 25. The output table displays the ID, name, and age of employees that meet the condition.