ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 20 Aug 2010 12:11:57 -0500Database Schemas?http://ask.sagemath.org/question/7602/database-schemas/There are a number of [databases][1] in sage, for curves or graphs or what have you. Where can I find the [schemas][2] for these?
[1]: http://www.sagemath.org/doc/reference/databases.html
[2]: http://en.wikipedia.org/wiki/Database_schemaFri, 20 Aug 2010 11:04:37 -0500http://ask.sagemath.org/question/7602/database-schemas/Answer by William Stein for <p>There are a number of <a href="http://www.sagemath.org/doc/reference/databases.html">databases</a> in sage, for curves or graphs or what have you. Where can I find the <a href="http://en.wikipedia.org/wiki/Database_schema">schemas</a> for these?</p>
http://ask.sagemath.org/question/7602/database-schemas/?answer=11489#post-id-11489
* The elliptic curves database is not a SQL database, so it doesn't have a "schema" as such -- it's just a bunch of Python objects.
* for any database that is a sqlite3 database, you could just use sqlite3 (the command line tool) to output the schema for the database (by doing `sage -sh` then `sqlite3 databasefile`). You'll have to find the database file in the `SAGE_ROOT/data/` directory.
sage -sh
cd $SAGE_ROOT/data/graphs/
sqlite3 graphs.db
sqlite> select * from sqlite_master;
table|degrees|degrees|2|CREATE TABLE degrees(
...
Fri, 20 Aug 2010 11:57:49 -0500http://ask.sagemath.org/question/7602/database-schemas/?answer=11489#post-id-11489Comment by Mike Hansen for <ul>
<li><p>The elliptic curves database is not a SQL database, so it doesn't have a "schema" as such -- it's just a bunch of Python objects.</p></li>
<li><p>for any database that is a sqlite3 database, you could just use sqlite3 (the command line tool) to output the schema for the database (by doing <code>sage -sh</code> then <code>sqlite3 databasefile</code>). You'll have to find the database file in the <code>SAGE_ROOT/data/</code> directory.</p>
<pre><code>sage -sh
cd $SAGE_ROOT/data/graphs/
sqlite3 graphs.db
sqlite> select * from sqlite_master;
table|degrees|degrees|2|CREATE TABLE degrees(
...
</code></pre></li>
</ul>
http://ask.sagemath.org/question/7602/database-schemas/?comment=22972#post-id-22972You can also run ".schema" from the sqlite command line to get an SQL description of the database schema.Fri, 20 Aug 2010 12:11:57 -0500http://ask.sagemath.org/question/7602/database-schemas/?comment=22972#post-id-22972