Schema

A schema is an outline, diagram, or model. In computing, schemas are often used to describe the structure of different types of data. Two common examples include database and XML schemas.

1. Database Schema

A database schema describes the tables and corresponding fields contained in a database. It may be displayed as a list of tables that each contain a sublist of fields along with the associated data type. More commonly, however, database schemas are displayed as visual diagrams. Boxes represent individual tables and lines show how the tables are connected. In some cases, these lines may include arrowheads to indicate the flow of data. Database schemas may also include comments that describe the purpose of each table and individual fields.

2. XML Schema

An XML schema defines the elements that an XML file may contain. It provides a specific structure for XML data, which is important when sharing XML files between multiple systems. Defining an XML schema ensures an XML document or feed will not contain unknown values, which may cause parsing errors. Below is an example of an XML schema, or XML schema definition (XSD).

<?xml version="1.0"?>
<xs:schema xmlns:xs="[url of a webpage that describes the schema]">

  <xs:element name="email">
    <xs:complexType>,
      <xs:sequence>
        <xs:element name="to" type="xs:string"/>
        <xs:element name="from" type="xs:string"/>
        <xs:element name="subject" type="xs:string"/>
        <xs:element name="body" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Schemas are most commonly used to describe databases and XML files, but they can also be used to describe other types of data. For example, a game developer may define a schema to describe 3D objects used in a video game. A software developer may use a schema to describe the structure of a file format used by an application.

Updated September 26, 2018 by Per C.

quizTest Your Knowledge

Which of the following is a programming language?

A
Leo
0%
B
Lai
0%
C
Lua
0%
D
Lou
0%
Correct! Incorrect!     View the Lua definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Schema on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.