C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
SQL SELECT StatementIn SQL, the SELECT statement is used to query or retrieve data from a table in the database. The returns data is stored in a table, and the result table is known as result-set. Syntax SELECT column1, column2, ... FROM table_name; Here, the expression is the field name of the table that you want to select data from. Use the following syntax to select all the fields available in the table: SELECT * FROM table_name; Example: EMPLOYEE
To fetch the EMP_ID of all the employees, use the following query: SELECT EMP_ID FROM EMPLOYEE; Output
To fetch the EMP_NAME and SALARY, use the following query: SELECT EMP_NAME, SALARY FROM EMPLOYEE;
To fetch all the fields from the EMPLOYEE table, use the following query: SELECT * FROM EMPLOYEE Output
Next TopicDBMS SQL Insert
|