| Author |
Topic |
|
monopolyman
Starting Member
4 Posts |
Posted - 2011-04-13 : 21:14:47
|
| (delete) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-13 : 21:38:37
|
please post your query that you tried KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-13 : 22:14:39
|
How about 3a & 3b ? Give it a try and post your query here KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-14 : 01:22:54
|
[code]3a) SELECT Lname, Fname, Dog_Tag_NumFROM StudentORDER by Lname DESC, Fname DESC, Dog_Tag_Num;[/code]it didn't say in descending order[code]3b) SELECT Course.Course_Num, Course.Course_Name, Grade.Enrollment Enrollment.GradeFROM Course JOIN Enrollment ON Course.Course_Num = Enrollment.Course_NumWHERE Enrollment.Dog_Tag_Num='555555555';[/code]- when you are joining to table together use the JOIN and specify the join condition- it should be <table name> <dot> <column name> not the other way round ie. Enrollment.Grade KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-14 : 01:33:38
|
Another point, you didn't create your table with a primary key. You can define a primary key for the table likeCREATE TABLE Course ( Course_Num VARCHAR(7), Course_Name VARCHAR(15), Description VARCHAR(50), primary key (Course_Num)); KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sqlraj
Starting Member
3 Posts |
Posted - 2011-04-14 : 05:45:38
|
| can some body help me with some queries |
 |
|
|
sqlraj
Starting Member
3 Posts |
Posted - 2011-04-14 : 05:46:35
|
| i mean sql queries to retrive data from multiple tables |
 |
|
|
sqlraj
Starting Member
3 Posts |
Posted - 2011-04-14 : 05:51:11
|
| there are three tablesPart (pid,pname,price)Supplier(sid,sname,city)Part_Supplier(sid,pid)qn 1) get the supplier id and name for those suppliers who supply all partsqn 2) get the part id and name for those parts where thye price is more than 3000 and is supplied by more thanj 3 suppliersqn 3) get the supplier id and name for those suppliers who are not supplying any part and are from the city of Delhiit would be appreciated if somebody could help me with these queries (sql & if possible in relational algebra also) |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-14 : 06:18:20
|
quote: Originally posted by sqlraj can some body help me with some queries
Please start a new thread for your question KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
monopolyman
Starting Member
4 Posts |
Posted - 2011-04-14 : 11:37:17
|
great help thanks |
 |
|
|
|