Skip to content

Instantly share code, notes, and snippets.

@TGSmith
Last active May 3, 2017 11:36
Show Gist options
  • Select an option

  • Save TGSmith/011039f61a7a8b8f9385 to your computer and use it in GitHub Desktop.

Select an option

Save TGSmith/011039f61a7a8b8f9385 to your computer and use it in GitHub Desktop.

Revisions

  1. TGSmith revised this gist Jul 9, 2013. 1 changed file with 84 additions and 1 deletion.
    85 changes: 84 additions & 1 deletion DB_Drill:_Address_Book_Schema_solution.rb
    Original file line number Diff line number Diff line change
    @@ -1 +1,84 @@
    # Solution for Challenge: DB Drill: Address Book Schema. Started 2013-07-09T21:32:24+00:00
    # Solution for Challenge: DB Drill: Address Book Schema. Started 2013-07-09T21:32:24+00:00
    http://min.us/l0GieGZ7cxACS

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
    <!-- Active URL: http://socrates.devbootcamp.com/sql.html -->
    <sql>
    <datatypes db="mysql">
    <group label="Numeric" color="rgb(238,238,170)">
    <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
    <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
    <type label="Single precision" length="0" sql="FLOAT" quote=""/>
    <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
    </group>
    <group label="Character" color="rgb(255,200,200)">
    <type label="Char" length="1" sql="CHAR" quote="'"/>
    <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
    <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
    <type label="Binary" length="1" sql="BINARY" quote="'"/>
    <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
    <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
    </group>
    <group label="Date &amp; Time" color="rgb(200,255,200)">
    <type label="Date" length="0" sql="DATE" quote="'"/>
    <type label="Time" length="0" sql="TIME" quote="'"/>
    <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
    <type label="Year" length="0" sql="YEAR" quote=""/>
    <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
    </group>
    <group label="Miscellaneous" color="rgb(200,200,255)">
    <type label="ENUM" length="1" sql="ENUM" quote=""/>
    <type label="SET" length="1" sql="SET" quote=""/>
    <type label="Bit" length="0" sql="bit" quote=""/>
    </group>
    </datatypes><table x="158" y="113" name="contacts">
    <row name="id" null="1" autoincrement="1">
    <datatype>INTEGER</datatype>
    <default>NULL</default></row>
    <row name="first_name" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <row name="last_name" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <row name="company" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <row name="phone_number" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <row name="email" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <key type="PRIMARY" name="">
    <part>id</part>
    </key>
    </table>
    <table x="548" y="116" name="groups">
    <row name="id" null="1" autoincrement="1">
    <datatype>INTEGER</datatype>
    <default>NULL</default></row>
    <row name="group_name" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default></row>
    <key type="PRIMARY" name="">
    <part>id</part>
    </key>
    </table>
    <table x="334" y="149" name="contacts_groups">
    <row name="group_id" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default><relation table="groups" row="id" />
    </row>
    <row name="contact_id" null="1" autoincrement="0">
    <datatype>VARCHAR</datatype>
    <default>NULL</default><relation table="contacts" row="id" />
    </row>
    <key type="PRIMARY" name="">
    </key>
    </table>
    </sql>
  2. TGSmith created this gist Jul 9, 2013.
    1 change: 1 addition & 0 deletions DB_Drill:_Address_Book_Schema_solution.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # Solution for Challenge: DB Drill: Address Book Schema. Started 2013-07-09T21:32:24+00:00