SQL column name 1

SQL column name

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'

Here is what the above code is Doing:
1. We’re selecting all the columns from the INFORMATION_SCHEMA.COLUMNS table.
2. We’re filtering the results to only include rows where the TABLE_NAME column is equal to the string ‘Customers’.

The INFORMATION_SCHEMA.COLUMNS table contains one row for each column in each table in the database.

The TABLE_NAME column contains the name of the table that the column belongs to.

The INFORMATION_SCHEMA.COLUMNS table is a great way to get information about the columns in a table.

Let’s practice using the INFORMATION_SCHEMA.COLUMNS table.

Instructions
100 XP

Select all the columns from the INFORMATION_SCHEMA.COLUMNS table.
Filter the results to only include rows where the TABLE_NAME column is equal to the string ‘Albums’.

Similar Posts