NotethattheCREATETABLEsyntaxusescommastoseparatecertainCREATETABLEoptions.Also,theNULL,NOTNULL,CHECK,DEFAULT,PRIMARYKEYandUNIQUEclausemustbeplacedwithintheparenthesescontainingthecolumndefinitions.
Example
ThefollowingexamplecreatesanewdatabasenamedMydata1.CREATETABLEisusedtocreatethreetables(Salesman,Customer,andOrders).TheFOREIGNKEYandREFERENCESclausesinthesecondCREATETABLEcommandcreateapersistentone-to-manyrelationshipbetweentheSalesmanandCustomertables.TheDEFAULTclausesinthethirdCREATETABLEcommandestablishdefaultvalues,andtheCHECKandERRORclausesestablishbusinessrulesforenteringdataintospecificfields.TheMODIFYDATABASEisusedtodisplaytherelationshipbetweenthethreetables.