![]() |
SearchWiki NoSQL.RecentChanges Edit Page Page Revisions |
| A DatabaseSchema is a set of two files containing certain pieces of meta-information regarding the tables that comprise a NoSQL database. Such two files can take any names, but I will refer to them as the file schema and the field schema. Such schema files are just like any other NoSQL table, and can be manipulated with all the standard NoSQL commands and operators. In the explanations that follow I will make use of an hypotetical "school management" database. Our school has courses, and each course is followed by a certain number of students. We will therefore have three tables in the database:
Course Credit Room Day Time Teacher ------ ------ ----- ---------- ----- ------- chem-1 2 HA-18 2003-10-12 14:00 1 cs-101 3 DB-1 2003-10-11 10:00 2 econ-1 1 RB-8 2003-10-10 09:00 2 his-10 3 HA-18 2003-11-12 15:00 3
Student First Last Year Phone
------- ------- ---------- ---- -------
1 Thomas Jefferson 1 9876
2 George Washington 1 87654
3 Ronald Reagan 1 7654210
4 William Clinton 1 6542109
Course Student ------ ------- chem-1 1 chem-1 2 chem-1 3 cs-101 2 cs-101 4 econ-1 1 econ-1 2 econ-1 3 his-10 1And here's what a file schema table for our "school management" database will look like, as displayed by the NoSQL justify command:
Table Path Edit -------------- ---------------- ---------------------- course ./course course_student ./course.student ./course.student-edits student ./studentSuch a schema shows a typical many-to-many database relation (one student can take many courses and one course involves many students). Here's what the table columns mean:
Column Table Flags ------- -------------- ----- Course course K Course course_student k Credit course Day course h First student Last student Phone student Room course Student student K Student course_student k Teacher course Time course h Year studentAs you can see, fields that occur in multiple tables are listed multiple times, one time per table, and thus the fieldlist table key is the concatenation of Column and Table values.
The DatabaseSchema files can contain additional, application-specific columns beside the basic ones explained above; all such columns should have names that begin with one upper-case letter followed by lower-case letters.
The Flags field in the fieldlist table provides further properties concerning each field, namely:
Flags field may contain multiple flags, such as kh, Kh, etc.
<< FastAccessMethods | NoSQL.DocumentationIndex | NoSQLBrokeringLanguage >>
|