PGoCareerGoCareer prep tools
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

SQL · Theory

Describe Table

← All stacks

Theory

18/439

Describe Table

DESCRIBE students; or DESC students; prints columns, types, NULL, key, default. Same idea: SHOW COLUMNS FROM students; or SHOW CREATE TABLE students; (full CREATE text including keys).

Use this when you forgot whether marks is INT or VARCHAR. Don’t guess types in an interview — DESCRIBE.

Trap — DESCRIBE on a view still works, but you won’t see indexes the same way as a base table.

On the example next to this theory: Describe Table: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Exam tip

DESC students; and SHOW CREATE TABLE students;

Describe Table — sample query

-- Describe Table
CREATE TABLE demo (
  id INTEGER PRIMARY KEY,
  label TEXT NOT NULL,
  qty INTEGER DEFAULT 0
);
INSERT INTO demo (id, label, qty) VALUES
  (1, 'alpha', 2),
  (2, 'beta', 5);
SELECT label, qty FROM demo WHERE qty >= 2 ORDER BY qty DESC;

Describe Table: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Short notes

  • DefDESCRIBE table; shows columns and types.
  • RuleSHOW CREATE TABLE for keys and engine.
  • TrapGuessing types instead of DESC.

Questions

1

How do you see column types?

18 / 439

P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.