Let us consider the following table named “Geeks” :
SQL query to write “FIRSTNAME” from Geeks table using the alias name as NAME.
Select FIRSTNAME AS NAME from Geeks;
SQL query to write “FIRSTNAME” from Geeks table in upper case.
Select upper(FIRSTNAME) from Geeks;
|(No column name)|
SQL query to find the first three characters of FIRSTNAME from Geeks table.
Select substring(FIRSTNAME, 1, 3) from Geeks;
|(No column name)|
SQL query to write the FIRSTNAME and LASTNAME from Geeks table into a single column COMPLETENAME with a space char should separate them.
Select CONCAT(FIRSTNAME, ' ', LASTNAME) AS 'COMPLETENAME' from Geeks;
Write an SQL query to print all Worker details from the Geeks table order by FIRSTNAME Ascending.
Select * from Geeks order by FIRSTNAME asc;
- Difference between Structured Query Language (SQL) and Transact-SQL (T-SQL)
- SQL | SELECT Query
- SQL query to find unique column values from table
- PHP | MySQL Select Query
- SQL query using COUNT and HAVING clause
- SQL Query to find the Nth Largest Value in a Column using Limit and Offset
- Query to find 2nd largest value in a column in Table
- SQL query to find second highest salary?
- Structured Query Language (SQL)
- SQL | Query Processing
- What are the Best Ways to Write a SQL Query?
- Features of Structured Query Language (SQL)
- SQL Query Complexity
- SQL | SELECT TOP Clause
- Performing Database Operations in Java | SQL CREATE, INSERT, UPDATE, DELETE and SELECT
- SELECT INTO statement in SQL
- Select statement in MS SQL Server
- Select top in MS SQL Server
- Insert Into Select statement in MS SQL Server
- SQL | SELECT data from Multiple Tables
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.