Questions tagged [schema]

Schema means shape, or more generally, plan. It may be XML schema or Database schema.

XML schema

An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself.

These constraints are generally expressed using some combination of grammatical rules governing the order of elements, Boolean predicates that the content must satisfy, data types governing the content of elements and attributes, and more specialized rules such as uniqueness and referential integrity constraints.

There are languages developed specifically to express XML schemas. The Document Type Definition (DTD) language, which is native to the XML specification, is a schema language that is of relatively limited capability, but that also has other uses in XML aside from the expression of schemas. Two more expressive XML schema languages in widespread use are XML Schema (with a capital S) and RELAX NG.

The mechanism for associating an XML document with a schema varies according to the schema language. The association may be achieved via markup within the XML document itself, or via some external means.

More info about XML schema

Database schema

A database schema of a database system is its structure described in a formal language supported by the database management system (DBMS) and refers to the organization of data to create a blueprint of how a database will be constructed (divided into database tables).

The formal definition of database schema is a set of formulas (sentences) called integrity constraints imposed on a database. These integrity constraints ensure compatibility between parts of the schema. All constraints are expressible in the same language. A database can be considered a structure in realization of the database language. The states of a created conceptual schema are transformed into an explicit mapping, the database schema. This describes how real world entities are modeled in the database.

A schema can contain formulas representing integrity constraints specifically for an application and the constraints specifically for a type of database, all expressed in the same database language.

In a relational database, the schema defines the tables, fields, relationships, views, indexes, packages, procedures, functions, queues, triggers, types, sequences, materialized views, synonyms, database links, directories, Java, XML schemas, and other elements.

More info about Database schema

References:

7547 questions
1032
votes
19 answers

How can I rollback a specific migration?

I have the migration file db\migrate\20100905201547_create_blocks.rb. How can I specifically rollback that migration file?
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
661
votes
3 answers

Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?

What are the differences between PRIMARY, UNIQUE, INDEX and FULLTEXT when creating MySQL tables? How would I use them?
Sam
447
votes
30 answers

SQL statement to get column type

Is there a SQL statement that can return the type of a column in a table?
daniely
  • 7,313
  • 5
  • 29
  • 46
443
votes
5 answers

How do I show the schema of a table in a MySQL database?

From the MySQL console, what command displays the schema of any given table?
dlamblin
  • 43,965
  • 20
  • 101
  • 140
380
votes
10 answers

Difference Between Schema / Database in MySQL

Is there a difference between a schema and a database in MySQL? In SQL Server, a database is a higher level container in relation to a schema. I read that Create Schema and Create Database do essentially the same thing in MySQL, which leads me to…
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248
358
votes
15 answers

Difference between a user and a schema in Oracle?

What is the difference between a user and a schema in Oracle?
sengs
  • 6,647
  • 6
  • 30
  • 24
303
votes
2 answers

How do I move a table into a schema in T-SQL

I want to move a table into a specific Schema using T-SQL? I am using SQL Server 2008.
Lukasz
  • 8,710
  • 12
  • 44
  • 72
300
votes
5 answers

Version of SQLite used in Android?

What is the version of SQLite used in Android? Reason: I'm wondering how to handle schema migrations. The newer SQLite versions support an "ALTER TABLE" SQL command which would save me having to copy data, drop the table, recreate table and…
Eno
  • 10,730
  • 18
  • 53
  • 86
274
votes
14 answers

XML Schema (XSD) validation tool?

At the office we are currently writing an application that will generate XML files against a schema that we were given. We have the schema in an .XSD file. Are there tool or libraries that we can use for automated testing to check that the…
Jason Dagit
  • 13,684
  • 8
  • 33
  • 56
250
votes
11 answers

First-time database design: am I overengineering?

Background I'm a first year CS student and I work part time for my dad's small business. I don't have any experience in real world application development. I have written scripts in Python, some coursework in C, but nothing like this. My dad has a…
bob esponja
  • 4,093
  • 3
  • 31
  • 29
243
votes
12 answers

Change Schema Name Of Table In SQL

I want to change schema name of table Employees in Database. In the current table Employees database schema name is dbo I want to change it to exe. How can I do it ? Example: FROM dbo.Employees TO exe.Employees I tried with this query: ALTER…
theChampion
  • 4,207
  • 7
  • 28
  • 35
222
votes
4 answers

What does GRANT USAGE ON SCHEMA do exactly?

I'm trying to create a Postgres database for the first time. I assigned basic read-only permissions to the DB role that must access the database from my PHP scripts, and I have a curiosity: If I execute GRANT some_or_all_privileges ON ALL TABLES IN…
Marco Sulla
  • 15,299
  • 14
  • 65
  • 100
219
votes
18 answers

What is the difference between a schema and a table and a database?

This is probably a n00blike (or worse) question. But I've always viewed a schema as a table definition in a database. This is wrong or not entirely correct. I don't remember much from my database courses.
anbanm
  • 13,425
  • 5
  • 22
  • 17
202
votes
12 answers

What good are SQL Server schemas?

I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and I've always been confused by schemas in 2005+. Yes, I know the basic definition of a schema, but what are they really used for in…
Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
201
votes
12 answers

What is difference between XML Schema and DTD?

I have googled this question, but I do not understand clearly what is an XML schema and DTD (document type definition), and why the XML schema is more powerful compared to DTD. Any guidance would be highly appreciated.
Rachel
  • 100,387
  • 116
  • 269
  • 365
1
2 3
99 100