शब्दकोश · डेटाबेस

Database Schema

A database schema is the formal definition of a database structure, including its tables, columns, data types, keys, indexes, and constraints.

अपडेट: अक्टूबर 6, 2026

A database schema is the blueprint of a database: the tables, columns, data types, keys, indexes, views, and constraints that define how data is organized. In some systems, such as PostgreSQL, a schema is also a namespace that groups objects inside a database.

Why it matters

The schema is the contract between your data and your application. A strict schema catches bad data at write time and documents the data model. Changing it on a live system needs care, which is why teams use versioned migrations. Schemaless databases move that contract into application code rather than removing it.

Example

CREATE TABLE products (
  id    BIGINT PRIMARY KEY,
  title TEXT NOT NULL,
  price NUMERIC(10,2) CHECK (price >= 0)
);

This defines the columns, types, a key, and a rule that prices cannot be negative.

Common mistakes

  • Editing the production schema by hand, so environments drift apart and nobody knows the true state.
  • Using overly generic columns like data1, data2 that hide meaning.
  • Confusing the two meanings of the word: the overall design versus a namespace object.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.