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

SQL · Theory

Create Index

← All stacks

Theory

77/439

Create Index

Asha only reaches for Create Index when lookup by roll has to stay correct in a big table.

Keep Create Index small. Asha should finish lookup by roll in a few lines, not a 40-line dump.

Skip Create Index and indexing a low-cardinality flag only shows up in a big table.

Create Index shows up in a big table. Name lookup by roll, not “a real-world scenario”.

Create Index miss — indexing a low-cardinality flag only. Fix it before you talk about advanced SQL.

After Create Index, Asha should still remember indexing a low-cardinality flag only.

One breath for Create Index, then lookup by roll, then indexing a low-cardinality flag only. Sit down.

Exam tip

For Create Index: definition + a big table + one failure.

Create Index — sample query

CREATE TABLE authors (
  id INTEGER PRIMARY KEY,
  email TEXT UNIQUE NOT NULL
);
CREATE TABLE books (
  id INTEGER PRIMARY KEY,
  author_id INTEGER NOT NULL,
  title TEXT NOT NULL,
  FOREIGN KEY (author_id) REFERENCES authors(id)
);
INSERT INTO authors VALUES (1, 'a@x.com');
INSERT INTO books VALUES (1, 1, 'SQL Basics');
SELECT * FROM books;

Create Index — keys and constraints protect data integrity; indexes speed lookups.

Short notes

  • DefCreate Index — Asha uses it for lookup by roll in a big table.
  • RuleCreate Index → PRIMARY KEY(roll) + INDEX.
  • RememberCreate Index + the query planner (a big table).
  • UseCreate Index in a big table (lookup by roll).
  • TrapCreate Index — indexing a low-cardinality flag only.
  • ExCreate Index → lookup by roll.

Questions

1

What is Create Index? Teach it with lookup by roll.

2

Where does Create Index show up in a big table?

3

How do you catch indexing a low-cardinality flag only?

4

Show Create Index in the query planner terms — three lines max.

Previous← Revoke PrivilegeNextDrop Index →
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.