LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 03-17-2008, 04:16 PM   #1
aq_mishu
Member
 
Registered: Sep 2005
Location: Bangladesh
Distribution: RH 7.2, 8, 9, Fedora
Posts: 216

Rep: Reputation: 30
Exclamation Urgent help on MySQL... please


Given the following relational schema:

tbl_Student(snum int, sname varchar(50), major varchar(30), standing varchar(10), age int);
tbl_class(cname varchar(), meets_at time, room varchar(), fid int);
tbl_enrolled(snum int, cname varchar());
tbl_faculty(fid int, fname varchar(), deptid int);

For simplicity, i'm not writyng the size, primarykey foreign key etc. but snum, fid are primary key and tbl_enrolled has no key. tbl_class has fid as foriegn key referencing to tbl_taculty.

I need SQL for the following:

a) List the major and age for the student named "Hasan Mashuk".
b) List the faculty if for all faculties that do not teach a class.
c) Lit the class names meeting in either room "R128" or room "R15".
d) List the student id that are enrolled in both "Database Systems" and "Operating System Design".
e) show the faculty name, class name and time (fname, cname, meets_at) for all classes with student "Juan Rodriguez".
f) show the list of distinct student names, where the student is registered for two or more different classes that meet at the same time.
g) Find the names of students not enrolled in any class.
h) Return the avg age of all students enrolled in "Database Systems";
i) Return the class name for all classes with more than 2 students and classes name starts with the letter 'D'
j) Return the age of the oldest student enrolled in a course taught by "Ivana Teach".
k) Find the names of all classes that either meet in room R128 or have five or more students enrolled.
l) Return the distinct faculty name and id for each faculty member that teaches only one class.
m) List the students by name that major in "Computer Science" in ascending orger of age.
 
Old 03-17-2008, 04:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
haha, nice try. you could at least try to pretend it's not course work. and you do clearly acutally need a data set to match the table formats. and urgent - this is *NOT* urgent? maybe if you didn't spend so much time drinking or whatever, and study instead you'd know what this meant?

Last edited by acid_kewpie; 03-17-2008 at 04:41 PM.
 
Old 03-17-2008, 06:14 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
And a closure. That's quite a blatant attempt to get others to do the stuff
that you're supposed to be doing to LEARN, and UNDERSTAND what you're doing.

Do it yourself.



Cheers,
Tink
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT : mySQL -> 'ssl_cipher' thibz21 Linux - General 2 06-25-2006 10:39 PM
help with installation of mysql-URGENT binary_dreamer Red Hat 1 03-15-2006 08:26 AM
MySQL Help... Urgent thachp Linux - Software 15 05-14-2005 10:04 AM
mysql problem, urgent chadi Linux - General 2 12-08-2004 06:46 PM
mysql error, urgent please help chadi Linux - General 1 11-12-2004 07:56 AM


All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration