pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedcan someone jelp me on this?
3+ messages / 3 participants
[nested] [flat]
* can someone jelp me on this?
@ 2005-04-26 20:18 Lord Knight of the Black Rose <xdarknessx82@hotmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Lord Knight of the Black Rose @ 2005-04-26 20:18 UTC (permalink / raw)
To: pgsql-sql
hey guys I have a question that I couldnt maneged to solve for the last 4
days. Im kinda new to these stuff so dont have fun with me if it was so
easy. Ok now heres the question.
create table student
(student_id int not null,
student_name varchar(25),
student_affiliation int,
student_password varchar(20),
student_email varchar(30),
student_phone varchar(12),
student_address varchar(50));
create table instructor
(instructor_id int not null,
instructor_name varchar(25),
instructor_affiliation int,
instructor_password varchar(20),
instructor_email varchar(30),
instructor_phone varchar(12),
instructor_address varchar(50));
create table course
(course_id int not null,
course_name varchar(25),
course_sections int,
course_description varchar(50));
create table class
(course_id int not null,
class_section int not null,
class_strength int,
class_date date,
class_time time);
create table student_class
(course_id int not null,
class_section int,
student_id int not null);
create table instructor_class
(course_id int not null,
class_section int,
instructor_id int not null);
insert into student (student_id, student_name) Values (1, 'Marge Trechle');
insert into student (student_id, student_name) Values (2, 'Todd Relve');
insert into student (student_id, student_name) Values (3, 'Beth
Schavinsky');
insert into student (student_id, student_name) Values (4, 'Thomas
Newburry');
insert into student (student_id, student_name) Values (5, 'Geoff Hamilton');
insert into student (student_id, student_name) Values (6, 'Cindy Crumple');
insert into student (student_id, student_name) Values (7, 'Keith Snyder');
insert into student (student_id, student_name) Values (8, 'Belinda Myers');
insert into student (student_id, student_name) Values (9, 'Hope Wilson');
insert into student (student_id, student_name) Values (10, 'Icculus McMan');
insert into student (student_id, student_name) Values (11, 'Mary Calahan');
insert into instructor (instructor_id, instructor_name) values (1, 'Norm
Salvadori');
insert into instructor (instructor_id, instructor_name) values (2, 'Terry
Smith');
insert into course (course_id, course_name) values (1, 'Wetlands Critters');
insert into course (course_id, course_name) values (2, 'Ocean Ecosystems');
insert into course (course_id, course_name) values (3, 'Endangered
Habitats');
insert into class (course_id, class_section) values (1,1);
insert into class (course_id, class_section) values (1,2);
insert into class (course_id, class_section) values (2,1);
insert into class (course_id, class_section) values (3,1);
The values inserted into the database can change and more entries can be
inserted and in this situation I have to write the constraints according to
these criteria:
1. A COURSE may consist of one or more CLASSes
2. An INSTRUCTOR may teach one or more CLASSes
3. A STUDENT may enroll in many CLASSes
4. A STUDENT can take more than one CLASS, and each CLASS contains many
STUDENTS
5. A CLASS is taught by only one INSTRUCTOR, but an INSTRUCTOR can teach
many CLASSes
6. A COURSE consists many CLASSes, while each CLASS is based on one
COURSE, so there is a one-to-many relationship between COURSE and
CLASS
7. A STUDENT may not enroll himself/herself for two CLASSes of the same
course
8. An INSTRUCTOR may not teach two CLASSes of the same COURSE
Ýf someone can help me about these stuff I will really apreciate.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: can someone jelp me on this?
@ 2005-05-01 09:15 Ragnar Hafstað <gnari@simnet.is>
parent: Lord Knight of the Black Rose <xdarknessx82@hotmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Ragnar Hafstað @ 2005-05-01 09:15 UTC (permalink / raw)
To: Lord Knight of the Black Rose <xdarknessx82@hotmail.com>; +Cc: pgsql-sql
On Tue, 2005-04-26 at 20:18 +0000, Lord Knight of the Black Rose wrote:
> hey guys I have a question that I couldnt maneged to solve for the last 4
> days. Im kinda new to these stuff so dont have fun with me if it was so
> easy. Ok now heres the question.
>
> [snip class assignment]
we'd all love to help you to do your assignment.
how far have you got?
what is your main stumbling-block ?
show us what you have done so far, and point out
what the problems with it are
gnari
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: can someone jelp me on this?
@ 2005-05-02 05:00 Ramakrishnan Muralidharan <ramakrishnanm@pervasive-postgres.com>
0 siblings, 0 replies; 3+ messages in thread
From: Ramakrishnan Muralidharan @ 2005-05-02 05:00 UTC (permalink / raw)
To: Lord Knight of the Black Rose <xdarknessx82@hotmail.com>; pgsql-sql
Hi,
Your mail just contain the database studcture and project spec. and nothing about the problem. Please let me know what help you are looking for?
Regards,
R.Muralidharan
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Lord Knight of the
Black Rose
Sent: Wednesday, April 27, 2005 1:48 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] can someone jelp me on this?
hey guys I have a question that I couldnt maneged to solve for the last 4
days. Im kinda new to these stuff so dont have fun with me if it was so
easy. Ok now heres the question.
create table student
(student_id int not null,
student_name varchar(25),
student_affiliation int,
student_password varchar(20),
student_email varchar(30),
student_phone varchar(12),
student_address varchar(50));
create table instructor
(instructor_id int not null,
instructor_name varchar(25),
instructor_affiliation int,
instructor_password varchar(20),
instructor_email varchar(30),
instructor_phone varchar(12),
instructor_address varchar(50));
create table course
(course_id int not null,
course_name varchar(25),
course_sections int,
course_description varchar(50));
create table class
(course_id int not null,
class_section int not null,
class_strength int,
class_date date,
class_time time);
create table student_class
(course_id int not null,
class_section int,
student_id int not null);
create table instructor_class
(course_id int not null,
class_section int,
instructor_id int not null);
insert into student (student_id, student_name) Values (1, 'Marge Trechle');
insert into student (student_id, student_name) Values (2, 'Todd Relve');
insert into student (student_id, student_name) Values (3, 'Beth
Schavinsky');
insert into student (student_id, student_name) Values (4, 'Thomas
Newburry');
insert into student (student_id, student_name) Values (5, 'Geoff Hamilton');
insert into student (student_id, student_name) Values (6, 'Cindy Crumple');
insert into student (student_id, student_name) Values (7, 'Keith Snyder');
insert into student (student_id, student_name) Values (8, 'Belinda Myers');
insert into student (student_id, student_name) Values (9, 'Hope Wilson');
insert into student (student_id, student_name) Values (10, 'Icculus McMan');
insert into student (student_id, student_name) Values (11, 'Mary Calahan');
insert into instructor (instructor_id, instructor_name) values (1, 'Norm
Salvadori');
insert into instructor (instructor_id, instructor_name) values (2, 'Terry
Smith');
insert into course (course_id, course_name) values (1, 'Wetlands Critters');
insert into course (course_id, course_name) values (2, 'Ocean Ecosystems');
insert into course (course_id, course_name) values (3, 'Endangered
Habitats');
insert into class (course_id, class_section) values (1,1);
insert into class (course_id, class_section) values (1,2);
insert into class (course_id, class_section) values (2,1);
insert into class (course_id, class_section) values (3,1);
The values inserted into the database can change and more entries can be
inserted and in this situation I have to write the constraints according to
these criteria:
1. A COURSE may consist of one or more CLASSes
2. An INSTRUCTOR may teach one or more CLASSes
3. A STUDENT may enroll in many CLASSes
4. A STUDENT can take more than one CLASS, and each CLASS contains many
STUDENTS
5. A CLASS is taught by only one INSTRUCTOR, but an INSTRUCTOR can teach
many CLASSes
6. A COURSE consists many CLASSes, while each CLASS is based on one
COURSE, so there is a one-to-many relationship between COURSE and
CLASS
7. A STUDENT may not enroll himself/herself for two CLASSes of the same
course
8. An INSTRUCTOR may not teach two CLASSes of the same COURSE
Ýf someone can help me about these stuff I will really apreciate.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-05-02 05:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-26 20:18 can someone jelp me on this? Lord Knight of the Black Rose <xdarknessx82@hotmail.com>
2005-05-01 09:15 ` Ragnar Hafstað <gnari@simnet.is>
2005-05-02 05:00 Re: can someone jelp me on this? Ramakrishnan Muralidharan <ramakrishnanm@pervasive-postgres.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox