FROM
Example
Section titled “Example”SELECT *FROM Employees;Output
Section titled “Output”+--------+-----------+------------+| emp_id | emp_name | emp_email |+--------+-----------+------------+| 1 | Smith | s@xyz.com || 2 | Johnson | j@xyz.com || 3 | Williams | w@xyz.com || 4 | Brown | b@xyz.com || 5 | Jones | j@xyz.com |+--------+-----------+------------+Explanation
Section titled “Explanation”The FROM clause in SQL is used to specify the table from which to retrieve data. In this example, the FROM clause specifies the Employees table. The SELECT * statement is used to select all columns from this table. It retrieves and displays an entire table of data. The output is a list of employees with their respective emp_id, emp_name and emp_email columns.
Example
Section titled “Example”SELECT nameFROM authors;Output
Section titled “Output”name----------J.K. RowlingGeorge R.R. MartinWilliam ShakespeareExplanation
Section titled “Explanation”In the given SQL query, FROM is used to specify the table authors from which to retrieve the data. The SELECT statement is then used to specify the name column to be included in the result set.
Example
Section titled “Example”SELECT FirstName, LastNameFROM Employees;Output
Section titled “Output”FirstName | LastName---------------------John | DoeJane | SmithExplanation
Section titled “Explanation”The example SQL query is pulling the ‘FirstName’ and ‘LastName’ from a table named ‘Employees’. The output is then displaying the first and last names of each record in the ‘Employees’ table as separate columns.
Example
Section titled “Example”SELECT *FROM Employees;Output
Section titled “Output”EMPLOYEE_ID | FIRST_NAME | LAST_NAME1 | Steve | Jobs2 | Bill | Gates3 | Elon | MuskExplanation
Section titled “Explanation”The FROM clause in Oracle SQL is used to specify the table from which to retrieve data. The code “SELECT * FROM Employees;” retrieves all columns (signified by the *) from the table named “Employees”. The resultant table consists of all records from the “Employees” table.
Example
Section titled “Example”SELECT nameFROM student;Output
Section titled “Output”JohnJaneBobExplanation
Section titled “Explanation”The SQL code selects and returns all entries from the ‘name’ column in the ‘student’ table.