Showing posts with label students. Show all posts
Showing posts with label students. Show all posts

Monday, March 19, 2012

How can I list the students in the CIS department? (SQL Server Query)

I need to write the SQL script for the above question.

Student table contains students' IDs, names, Addresses.

MajorMinor table contains 4 departments with unique code.
Name is a field and CIS is an attribute. Code(primary key) is a field and CIS is 13.

Student declares major. Declares table has StudentID and MajorMinorCode. The only student, his StudentID is 3579, has MajorMinorCode 13. (Meaning he is the only student who declared CIS as his major.)

I created and populated my database in SQL Server Management.

I am having trouble if I am selecting 2 tables or just one table with any other clauses?
Any help is appreciated! Thanks!That looks like an assignment / home work .

Can you kindly post what you have tried to solve the mentioned problem.|||

Quote:

Originally Posted by debasisdas

That looks like an assignment / home work .

Can you kindly post what you have tried to solve the mentioned problem.


Here you go.
SELECT Student.Name
FROM (Student INNER JOIN Declares ON Student.ID = Declares.StudentID) INNER JOIN MajorMinor ON Declares.MajorMinorCode = MajorMinor.Code
WHERE ((MajorMinor.Name)="CIS"));

Friday, March 9, 2012

How can i import the data from other database into SQL server ?

Hi,
i have developed an web-enabled student database application, where in i'll put all the details of the students from different universities.
while uploading the details of the students, i wanna just import the data given by the universities into the server.
I dont know how exactly the same could be done, also, since each university might be having there own format for the data, how can i import these into singe database?
Any ideas ... Please.Wink [;)]
Thanks in advance

Hi,
you can use DTS (Data Transformation Services) from Enterprise manager of Sql Server.
Regards
|||DTS is the way to go. If you have a standard your format, you can upload the file then launch the DTS package from your web page instead of having to upload the file then go to Ent Mgr, just simplifies things a bit. If that's what you are going to do, I'll provide VB code on how to launch the DTS pkg from you web page.|||Hey thanx,
i cant standardise the format since each university will have there own.And they all cant afford to give the data in the standard format.
anyways, do me the favour by providing me the code.If possible make it in C# since thats the one which i am coding with .
Also, can u plz give me an idea to how exactly i can standardise the format.
thanks in advance