-2

I have created a table using SQL and I forgot to insert the values and I want to know what are the columns so that I can insert the values. How to find column names?

CREATE TABLE Employee1 (
  id INT PRIMARY KEY,
  name VARCHAR(20),
  salary INT,
  location VARCHAR(20),
  gender CHAR(1)
  );
sk jainmiah
  • 53
  • 2
  • 2
  • 10

1 Answers1

2

As you taged MYSQL Database, you can use this command:

SHOW CREATE TABLE Databasename.tablename;

or:

SHOW COLUMNS FROM Databasename.tablename;

or:

describe Databasename.tablename;
TimLer
  • 1,320
  • 2
  • 16