Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2020.11.19 1. (20 points) Suppose that one database includes four relations, teaches relation T(Tno, Tname. Title. ID Card), with attributes teacher number Ino), teacher namelirane)
2020.11.19 1. (20 points) Suppose that one database includes four relations, teaches relation T(Tno, Tname. Title. ID Card), with attributes teacher number Ino), teacher namelirane) professional Tile(Title) and IdCard Number(ID Card); relation C(cro. Crame, Tno), with attributes the course number(Cro), course name(Crame) and teacher number of this course(Tno);student relation S(Sno, Firstname, Lastname, Birthday, Sex,ID Card) with Student number(Sno). name . birthday and gender and IdCard Number(ID Card); course selection relation SC(Sno, Cno, Score) with attributes the student number(Sno), course number(Cho) and Score. Accoring to the common situations in the real world: (each 4 points) (1) Please give two reasonable candidate keys, one primary key for teacher relation. Tno, ID Card (2) Write the primary key and a foreign key of SC relation, then exlain the meaning of them respectively. primary key Sno, Cno foreign key:Sno, its value references the value for attribute sno in student relation. (3) Give suitable datatype for attribute Birthday in S relation and Score in relation SC? Datetime float (4) Add constraint with values beween 0 and 100 for attribute Score in SC realtion. Check(score between 0 and 100) (5) Add constraint "Not Null" for Title in relation T. Alter table T add constraint title not null
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started