ITEC 3220 Lecture Notes - Lecture 4: Unique Key, Decimal Mark, Foreign Key

15 views4 pages

Document Summary

Logical database schema: descript of the structure of db using db language such as commands or constructs. Create table name(field1name datatype [limitation], . , ) so this basically creates table it is a sample of ddl . Some integrity constraints: primary key, not null, unique, foreign key (list_of_fields) refrences table_name, check. By default it is restict, if we don"t provide any special. : primary key could only appear once ! in sql lang. Create table instructor(eid, char(9) primary key, sin char(9) unique, lname varchar2(15) not. Note that its eid instead of eid cuz its case insensitive. See practice pic i took from slides, solution to the example below: Create table teaches(eid char(9), sid char(9), cid char(8), grade char(2), primary key(eid, sid, Cid), foreign key(eid) reference instructor, foreign key(sid) reference student, foreign. That 1 and n represents that every school could be appear only once, but many instructors could teach at same 1 school.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents