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:

6710 questions
880
votes
14 answers

How to rollback a specific migration?

I have the following migration file db\migrate\20100905201547_create_blocks.rb How can I specifically rollback that migration file?
AnApprentice
  • 97,752
  • 174
  • 583
  • 971
625
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
409
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
  • 40,676
  • 19
  • 92
  • 127
348
votes
26 answers

SQL statement to get column type

Is there a SQL statement that can return the type of a column in a table?
daniely
  • 5,467
  • 3
  • 27
  • 40
323
votes
8 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
  • 32,108
  • 50
  • 143
  • 228
283
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,382
  • 11
  • 42
  • 69
280
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,300
  • 18
  • 51
  • 83
270
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,034
  • 8
  • 31
  • 54
246
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
  • 3,933
  • 3
  • 28
  • 29
198
votes
10 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
  • 3,567
  • 6
  • 24
  • 35
193
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
  • 90,480
  • 27
  • 178
  • 274
188
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
  • 91,207
  • 112
  • 255
  • 361
174
votes
15 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
  • 11,961
  • 5
  • 20
  • 17
151
votes
3 answers

What does GRANT USAGE ON SCHEMA do exactly?

I'm trying to create a Postgres database for the first time. So this is probably a stupid question. 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…
Marco Sulla
  • 13,595
  • 12
  • 50
  • 83
149
votes
10 answers

Any tools to generate an XSD schema from an XML instance document?

I am looking for a tool which will take an XML instance document and output a corresponding XSD schema. I certainly recognize that the generated XSD schema will be limited when compared to creating a schema by hand (it probably won't handle optional…
Matt Dillard
  • 14,229
  • 7
  • 48
  • 60
1
2 3
99 100