Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Delete

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]

Go to Top of Page

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]

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-04-14 : 01:22:54
[code]
3a) SELECT Lname, Fname, Dog_Tag_Num
FROM Student
ORDER 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.Grade
FROM Course JOIN Enrollment ON Course.Course_Num = Enrollment.Course_Num
WHERE 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]

Go to Top of Page

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 like

CREATE 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]

Go to Top of Page

sqlraj
Starting Member

3 Posts

Posted - 2011-04-14 : 05:45:38
can some body help me with some queries
Go to Top of Page

sqlraj
Starting Member

3 Posts

Posted - 2011-04-14 : 05:46:35
i mean sql queries to retrive data from multiple tables
Go to Top of Page

sqlraj
Starting Member

3 Posts

Posted - 2011-04-14 : 05:51:11
there are three tables
Part (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 parts
qn 2) get the part id and name for those parts where thye price is more than 3000 and is supplied by more thanj 3 suppliers
qn 3) get the supplier id and name for those suppliers who are not supplying any part and are from the city of Delhi

it would be appreciated if somebody could help me with these queries (sql & if possible in relational algebra also)
Go to Top of Page

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]

Go to Top of Page

monopolyman
Starting Member

4 Posts

Posted - 2011-04-14 : 11:37:17
great help thanks
Go to Top of Page
   

- Advertisement -