Temporary tables are used to store the intermediate results so that they can be accessed multiple times. We can create temporary tables using SELECT INTO statement and the name of the temporary table must start with #. Here is the syntax to create a temporary table in SQL:
Here is the example to create a temporary table in SQL:
WHERE salary > 20000
In the above example, we are creating a temporary table named temp_table with the details of the employees whose salaries are greater than 20000.
In case you want to learn SQL, then sign up for this SQL training course by Intellipaat that provides instructor-led training, certification, and also job assistance.