Using this tables.. Write in SQL queries to populate the above tables by inserting minimum 4 tuples in each one. 1. Student (studid, email, name) CREATE TABLE Student ( studid char(9) NOT NULL, email varchar2(50) NOT NULL UNIQUE, name varchar2(50) NOT NULL, PRIMARY KEY (studid) ); 2. Club (clubid, telephone, name, #president) CREATE TABLE Club ( clubid int(3) NOT NULL, telephone int(8), name varchar2(20) NOT NULL, president varchar2(20), PRIMARY KEY (studid) ); 3. MemberOf(#clubid, #studid ) CREATE TABLE MemberOf ( clubid int(3) , studid char(9), FOREIGN KEY (clubid) REFERENCESClub(clubid) FOREIGN KEY (studid) REFERENCESStudent(studid) ); 4. Activities(actid, actdt, place) CREATE TABLE Activities ( actid int(3) NOT NULL, actdt Date NOT NULL, place varchar2(50), PRIMARY KEY (actid) ); 5.Organize(#actid , #clubid , fee) CREATE TABLE Organize ( actid int(3) , clubid int(3), fee Number (4,2), FOREIGN KEY (actid) REFERENCESActivities(actid) FOREIGN KEY (clubid) REFERENCESClub(clubid) );
Using this tables.. Write in SQL queries to populate the above tables by inserting minimum 4 tuples in each one.
1. Student (studid, email, name)
CREATE TABLE Student (
studid char(9) NOT NULL,
email varchar2(50) NOT NULL UNIQUE,
name varchar2(50) NOT NULL,
PRIMARY KEY (studid)
);
2. Club (clubid, telephone, name, #president)
CREATE TABLE Club (
clubid int(3) NOT NULL,
telephone int(8),
name varchar2(20) NOT NULL,
president varchar2(20),
PRIMARY KEY (studid)
);
3. MemberOf(#clubid, #studid )
CREATE TABLE MemberOf (
clubid int(3) ,
studid char(9),
FOREIGN KEY (clubid) REFERENCESClub(clubid)
FOREIGN KEY (studid) REFERENCESStudent(studid)
);
4. Activities(actid, actdt, place)
CREATE TABLE Activities (
actid int(3) NOT NULL,
actdt Date NOT NULL,
place varchar2(50),
PRIMARY KEY (actid)
);
5.Organize(#actid , #clubid , fee)
CREATE TABLE Organize (
actid int(3) ,
clubid int(3),
fee Number (4,2),
FOREIGN KEY (actid) REFERENCESActivities(actid)
FOREIGN KEY (clubid) REFERENCESClub(clubid)
);
Trending now
This is a popular solution!
Step by step
Solved in 6 steps