Schematodoc - Pubs
Total Page:16
File Type:pdf, Size:1020Kb
SchemaToDoc - pubs
Table of Contents Publishers...... 1 pub_info...... 1 publishers...... 2 Authors...... 3 authors...... 3 roysched...... 3 Titles...... 5 titleauthor...... 5 titles...... 5 Sales...... 7 discounts...... 7 sales...... 7 stores...... 7 Workforce...... 9 employee...... 9 jobs...... 9 Publishers pub_info Primary Key(s): pub_id Field Type Size Default Nulls? pub_id char 4 No logo image Yes pr_info text Yes
Index Name Unique Clustered Fields UPKCL_pubinfo Yes Yes pub_id
No Check Constraints
Internal Foreign Key Constraint Affected Field Source Table FK__pub_info__pub_id__173876EA pub_id publishers
No External Foreign Keys publishers Primary Key(s): pub_id Field Type Size Default Nulls? pub_id char 4 No pub_name varchar 40 Yes city varchar 20 Yes state char 2 Yes country varchar 30 ('USA') Yes
Index Name Unique Clustered Fields UPKCL_pubind Yes Yes pub_id
Check Constraint Name Text CK__publisher__pub_i__7C8480AE ([pub_id] = '1756' or ([pub_id] = '1622' or ([pub_id] = '0877' or ([pub_id] = '0736' or [pub_id] = '1389'))) or [pub_id] like '99[0-9][0-9]')
No Internal Foreign Keys
Primary Key as Foreign Key Constraint Affected Table Affected Field FK__employee__pub_id__1ED998B2 employee pub_id FK__pub_info__pub_id__173876EA pub_info pub_id FK__titles__pub_id__014935CB titles pub_id Authors authors Primary Key(s): au_id Field Type Size Default Nulls? au_id varchar 11 No au_lname varchar 40 No au_fname varchar 20 No phone char 12 ('UNKNOWN') No address varchar 40 Yes city varchar 20 Yes state char 2 Yes zip char 5 Yes contract bit No
Index Name Unique Clustered Fields UPKCL_auidind Yes Yes au_id aunmind No No au_lname, au_fname
Check Constraint Name Text CK__authors__au_id__77BFCB91 ([au_id] like '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]') CK__authors__zip__79A81403 ([zip] like '[0-9][0-9][0-9][0-9][0-9]')
No Internal Foreign Keys
Primary Key as Foreign Key Constraint Affected Table Affected Field FK__titleauth__au_id__0519C6AF titleauthor au_id roysched Primary Key(s): Field Type Size Default Nulls? title_id varchar 6 No lorange int Yes hirange int Yes royalty int Yes
Index Name Unique Clustered Fields titleidind No No title_id
No Check Constraints
Internal Foreign Key Constraint Affected Field Source Table FK__roysched__title___0DAF0CB0 title_id titles No External Foreign Keys Titles titleauthor Primary Key(s): au_id, title_id Field Type Size Default Nulls? au_id varchar 11 No title_id varchar 6 No au_ord tinyint Yes royaltyper int Yes
Index Name Unique Clustered Fields UPKCL_taind Yes Yes au_id, title_id auidind No No au_id titleidind No No title_id
No Check Constraints
Internal Foreign Key Constraint Affected Field Source Table FK__titleauth__au_id__0519C6AF au_id authors FK__titleauth__title__060DEAE8 title_id titles
No External Foreign Keys titles Primary Key(s): title_id Field Type Size Default Nulls? title_id varchar 6 No title varchar 80 No type char 12 ('UNDECIDED') No pub_id char 4 Yes price money Yes advance money Yes royalty int Yes ytd_sales int Yes notes varchar 200 Yes pubdate datetime (getdate()) No
Index Name Unique Clustered Fields UPKCL_titleidind Yes Yes title_id titleind No No title
No Check Constraints Internal Foreign Key Constraint Affected Field Source Table FK__titles__pub_id__014935CB pub_id publishers
Primary Key as Foreign Key Constraint Affected Table Affected Field FK__roysched__title___0DAF0CB0 roysched title_id FK__sales__title_id__0BC6C43E sales title_id FK__titleauth__title__060DEAE8 titleauthor title_id Sales discounts Primary Key(s): Field Type Size Default Nulls? discounttype varchar 40 No stor_id char 4 Yes lowqty smallint Yes highqty smallint Yes discount decimal No
No Indexes
No Check Constraints
Internal Foreign Key Constraint Affected Field Source Table FK__discounts__stor___0F975522 stor_id stores
No External Foreign Keys sales Primary Key(s): stor_id, ord_num, title_id Field Type Size Default Nulls? stor_id char 4 No ord_num varchar 20 No ord_date datetime No qty smallint No payterms varchar 12 No title_id varchar 6 No
Index Name Unique Clustered Fields UPKCL_sales Yes Yes stor_id, ord_num, title_id titleidind No No title_id
No Check Constraints
Internal Foreign Key Constraint Affected Field Source Table FK__sales__stor_id__0AD2A005 stor_id stores FK__sales__title_id__0BC6C43E title_id titles
No External Foreign Keys stores Primary Key(s): stor_id Field Type Size Default Nulls? stor_id char 4 No stor_name varchar 40 Yes stor_address varchar 40 Yes city varchar 20 Yes state char 2 Yes zip char 5 Yes
Index Name Unique Clustered Fields UPK_storeid Yes Yes stor_id
No Check Constraints
No Internal Foreign Keys
Primary Key as Foreign Key Constraint Affected Table Affected Field FK__discounts__stor___0F975522 discounts stor_id FK__sales__stor_id__0AD2A005 sales stor_id Workforce employee Primary Key(s): emp_id Field Type Size Default Nulls? emp_id char 9 No fname varchar 20 No minit char 1 Yes lname varchar 30 No job_id smallint (1) No job_lvl tinyint (10) Yes pub_id char 4 ('9952') No hire_date datetime (getdate()) No
Index Name Unique Clustered Fields employee_ind No Yes lname, fname, minit PK_emp_id Yes No emp_id
Check Constraint Name Text CK_emp_id ([emp_id] like '[A-Z][A-Z][A-Z][1-9][0-9][0-9][0-9][0-9][FM]' or [emp_id] like '[A-Z]-[A-Z][1-9][0-9][0-9][0-9][0-9][FM]')
Internal Foreign Key Constraint Affected Field Source Table FK__employee__job_id__1BFD2C07 job_id jobs FK__employee__pub_id__1ED998B2 pub_id publishers
No External Foreign Keys jobs Primary Key(s): job_id Field Type Size Default Nulls? job_id smallint No job_desc varchar 50 ('New Position - title not No formalized yet') min_lvl tinyint No max_lvl tinyint No
Index Name Unique Clustered Fields PK__jobs__117F9D94 Yes Yes job_id
Check Constraint Name Text CK__jobs__min_lvl__1367E606 ([min_lvl] >= 10) CK__jobs__max_lvl__145C0A3F ([max_lvl] <= 250) No Internal Foreign Keys
Primary Key as Foreign Key Constraint Affected Table Affected Field FK__employee__job_id__1BFD2C07 employee job_id