Consider the following entities and their
relationship.
Customer (c_no, c_name, c_city, c_ph_no)
Ticket (t_no,
booking_date, fare, traveling_date)
Relationship between Customer and Ticket
is one-to-many.
Constraints: primary key, foreign key
c_name should not be
null,
fare should be greater
than zero.
Answer:
Customer Table
Create table customer(c_no int primary key,c_name varchar(15) NOT NULL,c_city varchar(10),
c_ph_no int);
Ticket Table
Create Table Ticket(t_no int primary key,booking_date date,fare int check(fare>0),traveling_date date,c_no int references customer(c_no));
3 Comments
��
ReplyDeleteVery useful for BCA.
ReplyDeleteIts okk.
ReplyDelete