Uploaded by phila46th

Demo1 -Defining Tables and Relationships (1)

advertisement
ISTM6202 Demo 1 – Defining Tables and Relationships
1) Create a new database called ISTM6202
2) Use definitions below to define Students, Courses, and Grades tables.
3) Go to Tools  Relationships to show relationships
Students Table Definition
create table Students
(Id integer not null,
Name char(40),
Major char(5),
GPA float,
Primary Key (Id));
Courses Table Definition
create table Courses (
Course
char(7),
Description char(20),
Professor char(10),
Primary Key (Course))
Grades Table Definition
create table Grades (
Id
integer,
Course
char(7),
Year int,
Semester
int,
Grade float,
LetterGrade char(1),
Primary Key (Id, Course),
Foreign Key (Id)
References Students,
Foreign Key (Course)
References Courses)
Download