Skip to content

Instantly share code, notes, and snippets.

@sakakendo
Created January 15, 2020 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakakendo/f4d1a07083aea682a1536281327394df to your computer and use it in GitHub Desktop.
Save sakakendo/f4d1a07083aea682a1536281327394df to your computer and use it in GitHub Desktop.
create database OrderDB;
show databases;
use OrderDB;
use OrderDB;
create table OrderT(
OrderID char(5) primary key,
OData date not null,
OCorpID char(4) not null
);
create table CorpT(
CorpID char(4) primary key,
CorpName varchar(20) not null,
CorpAddr varchar(100)
);
create table DetailT(
OrderID char(5),
Item varchar(20) not null,
Price int unsigned not null,
Qty smallint unsigned not null,
primary key(OrderID, Item)
);
show columns from OrderT;
show columns from CorpT;
show columns from DetailT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment