MySQL:Hire Co:DDL

From virtualMV2015wiki
Jump to: navigation, search
MySQL <

Sales, Hire and Repair Company - Creating the database and tables (DDL)

Icon Objective.png

Objective

  • Create the Sales, Hire and Repair Company database

Create the Enterprise database

The enterprise database is the container for all the sub-systems in the organisation, so will contain the entities(tables), their attributes (fields) and relationships for the sales, hire and repair sub-systems including all the data.

CREATE DATABASE dbHire;
USE dbHire;

Or if you want to automate the process create an sql file dbHire00.sql

# Create database
DROP DATABASE IF EXISTS dbHire;
SELECT Database();
CREATE DATABASE dbHire;
USE dbHire;
SELECT DATABASE();


Icon Notes.png

Notes

  • There is lots of unnecessary stuff but helps to show what is going on. Indeed you probably shouldn't have the Drop database in a file as you delete the entire database and all the contents with this command!!

Icon References.png References


MySQL:Hire Co:DDL. (2017). In virtualMV's ( Michael Verhaart ) wiki. Retrieved December 18, 2017, from http://www.virtualmv.com/wiki/index.php?title=MySQL%3AHire_Co%3ADDL    (zotero)