Giter Site home page Giter Site logo

sgouda0412 / database-schema-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awesomejt/database-schema-examples

0.0 0.0 0.0 148 KB

Relational database schema examples, including table creation scripts (DDL SQL) for popular database systems (MySQL, Derby, H2, etc).

License: Apache License 2.0

database-schema-examples's Introduction

Database Schema Examples

This project is an open-source (Apache License 2.0) collection of data models and SQL scripts for creating sample database schemas. This project was started after a bit of searching for an existing project without much success.

Project Benefits

  • SQL scripts for creating schemas and sample data for testing or proof-of-concept applications
  • A way to teach developers how to write DDL/SQL
  • A database schema design starting point

Database examples should contain the following:

  • README file to discribe the purpose of the example, how to use the SQL scripts, and anything else required.
  • ER diagram or other database model PNG image
  • ER diagram source file (optional)
  • Schema creation SQL (DDL) scripts
  • Sample data insertion scripts (optional)
  • Schema removal scripts
  • Database system specific scripts (create database, schema, users/permissions, constraints, etc)

Getting Started

To use the existing examples, clone the entire project or use GitHub to navigate down into the appropriate folder and copy specific scripts as needed. Each folder should have a description regarding the example's purpose and design.

Scripts are organized by database system (MySQL, Derby, DB2, etc) and purpose (create, data, drop). Example authors are encouraged to create a database-independent version (ANSI/ISO SQL) if possible (generic_create.sql), but many times this is not practical.

Contributing

We welcome contributions! All contributions must be original work and willing to be released under the Apache License 2.0 (liberal open source).

Common SQL Syntax (When Possible)

Most modern database systems understand some level of ANSI or ISO SQL standard syntax. However most databases stray from the standard in some unforgivable way. Still, it may be possible to build a schema in a common syntax that is understood by many systems.

Common or generic database scripts should be named with the "generic" prefix in the filename. Example: generic_schema_create.sql.

Database Specific Syntax

There are many cases when database specific syntax is required or strongly desired. The preferred approach is to use database-specific scripts to alter an existing schema already created with generic scripts. As a last resort, a completely database specific approach may be used. Either way, document the approach taken with each schema example.

Name database-specific files with a reasonable prefix. Example: mysql_schema_create_alter.sql.

Database Models

Creating database models (Entity-Relationship (ER) Diagrams) are useful when provided. Please use a freely available tool for creating a saving ER diagram files. Also, always export the ER diagram as a PNG image file so others can view the diagram without using a specific tool.

database-schema-examples's People

Contributors

awesomejt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.