2
Contributors
26
Replies
27
Views
6 Years
Discussion Span
Last Post by silvercats
Featured Replies
  • You can create a view like this [CODE] CREATE VIEW stu_sub AS SELECT st.studname, su.subjectname, st.marks FROM student st, subject su WHERE st.subjectcode = su.subjectcode[/CODE] OR using your SQL and use that. Read More

  • You can use either of the queries. Read More

  • if you had replied to my question, you would have known the difference between the two. Read More

0

that is a question from a past paper.What did you mean by seeing a query i am working on?the answers for (a) and (b) questions?I have done them but I even don't understand those above questions ?

0

If you are already getting the desired output using your SQL by joining both the tables, simply create a view based on that SQL. Once the view is created no need to write your SQL again and again. You can directly select from the view.

0

join?how to join tables?Can't i just type
Select field1,field2,field3
from table1,table2
and get the combined output? that is what i thought but didn't work

0

Your tables should be joined like this

SELECT st.studname, su.subjectname, st.marks FROM 
student st, subject su
WHERE st.subjectcode = su.subjectcode
0

Is this the SQL query?
how did st. came in front of the studname?can we change them just like that?

what about something like this


SELECT studName, subjectName, marks
FROM Student
JOIN Subject
ON Subject.subjectCode = Student.subjectCode
ORDER BY studName
???? help

0

st. ---- used in query is the table alias. It is a fully qualified name of the field.

Ok, tell me how will you display subjectcode after joining both the tables.

0

From those answers what is the correct one?your or mine?For what question then?these questions are strange

Ok, tell me how will you display subjectcode after joining both the tables.

I dont know anything about displaying rather than inserting,creating....... :O .and lil bit of joining

0

I don't you.aren't you supposed to give answers for mine rather than ASKING from me ? :p

0

You are right . :)

But to understand my answers, you need to have some basic understanding of SQL.

My question is just to test that.

My question is still open to you. The sooner you reply, the sooner you will get reply :) .

Edited by debasisdas: n/a

0

because ,I can see your answer and then refer to the tutorials about each part i can't understand ?or you can refer me to some links (or names of the topics,i will find the tutes)which will help me to answer both of above answers after reading them?both are helpful

0

Ok, to answer your question, you can use either of the queries. Both will give you correct data in the output.

0

you mean for the database view question or the query question ?under what topic should i be looking for tutorials about them ?

1

You can create a view like this

CREATE VIEW stu_sub AS SELECT st.studname, su.subjectname, st.marks FROM
    student st, subject su
    WHERE st.subjectcode = su.subjectcode

OR using your SQL and use that.

0

Both query will fetch same output.

It is up to you to decide whether to use coding standards or not.

If you want that take my SQL else pick yours.

Edited by debasisdas: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.