Which are the most commonly used SQL joins?

Most commonly used SQL joins are INNER JOIN and LEFT OUTER JOIN and RIGHT OUTER JOIN. The most commonly used SQL joins are: INNER JOIN: Retrieves records that have matching values in both tables. It returns only the rows where there is a match in both tables based on the specified condition. LEFT JOIN (or … Read more

What is the SQL query to display the current date?

There is a built-in function in SQL called GetDate() which is used to return the current timestamp. In SQL, you can use the GETDATE() or CURRENT_TIMESTAMP function to retrieve the current date and time. If you only want the current date, you can use the CAST or CONVERT functions to extract the date part. Here … Read more

What is the difference between clustered and non-clustered index in SQL?

There are mainly two type of indexes in SQL, Clustered index and non clustered index. The differences between these two indexes is very important from SQL performance perspective. One table can have only one clustered index, but it can have many non-clustered index. (Approximately 250). A clustered index determines how data is stored physically in … Read more

Is it possible to sort a column using a column alias?

Yes. You can use the column alias in the ORDER BY instead of WHERE clause for sorting. No, it is not possible to sort a column using a column alias directly in SQL. Column aliases are typically used for renaming columns or for creating more readable output in the result set, but they cannot be … Read more

What is the difference between SQL and PL/SQL?

SQL or Structured Query Language is a language which is used to communicate with a relational database. It provides a way to manipulate and create databases. On the other hand, PL/SQL is a dialect of SQL which is used to enhance the capabilities of SQL. It was developed by Oracle Corporation in the early 90’s. … Read more