Id char9 name char30 login char20 age integer gpa

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CHAR(9), Name CHAR(30), Login CHAR(20), Age INTEGER, gpa DECIMAL(4,2), UNIQUE (Login), PRIMARY KEY (ID)) ENGINE=MyISAM; CREATE TABLE Student ( ID CHAR(9) PRIMARY KEY, Name CHAR(30), Login CHAR(20) UNIQUE, Age INTEGER, gpa DECIMAL(4,2)) ENGINE=MyISAM; 9 Data Definition (continued) 10 Data Definition (continued) For the FinalGrades relation: What information is represented by these relations? CREATE TABLE FinalGrades ( ID CHAR(9), CourseNum CHAR(20), Grade CHAR(2), PRIMARY KEY (ID, CourseNum), FOREIGN KEY (ID) REFERENCES Students (ID), FOREIGN KEY (CourseNum) REFERENCES Courses (CourseNum)) ENGINE=InnoDB; Students (ID, Name, Login, Age, gpa) Courses (CourseNum, CourseName, CreditHours) FinalGrades (ID, CourseNum, Grade) 11 12 More About MyISAM vs. InnoDB CHECK Clause CREATE TABLE Students ( ID CHAR(9), Name CHAR(30), Login CHAR(20), Age INTEGER, gpa DECIMAL(4,2), UNIQUE (Login), PRIMARY KEY (ID), CHECK (Age >= 16 AND Age <= 80)); Suppose you try to insert or update tuple that causes primary key, unique key, or foreign key violation. What will...
View Full Document

This note was uploaded on 10/15/2012 for the course CSE 4503 taught by Professor Edallen during the Fall '12 term at Mississippi State.

Ask a homework question - tutors are online