Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to fetch records from a One to Many relationship table.
eg: wanna get details of all orders for a specific customer.
(do not want repeatation of master table records for child
table records)

Answers were Sorted based on User's Feedback



How to fetch records from a One to Many relationship table. eg: wanna get details of all orders fo..

Answer / syeda

Need to define a relationship to the table and common column
of tables

ex : there is a table called college which contains the
college records like studid, studentname, batch & course.
And other table called student_details which contains
studid, firstName, lastName, fathersName, mothersName, DOB,
ContactNo & address.

Here we are fetching studid, batch, course & studentname
from collete table and DOB, ContactNo & address from
students_details , of all the students whose birth month is
April 1988

Syntax : select
a.studid,a.batch,a.course,a.studentname,b.DOB,b.ContactNo,b.address
from college a, student_details b where a.studid=b.studid
and b.DOB like '%-Apr-1988'

Is This Answer Correct ?    4 Yes 0 No

How to fetch records from a One to Many relationship table. eg: wanna get details of all orders fo..

Answer / jagadeesh

SubQuery

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL Server Interview Questions

What is scd (slowly changing dimension)? : sql server analysis services, ssas

0 Answers  


How to manipulate data from one table to another table ?

0 Answers   MCN Solutions,


What is a system database and what is a user database?

0 Answers  


Can sql servers linked to other servers?

0 Answers  


What are 3 ways to get a count of the number of records in a table?

0 Answers  


What are the joins in sql server? : sql server database administration

0 Answers  


How many types of functions are there in sql server?

0 Answers  


diffrence between function and procedure

5 Answers   Wipro,


What is the difference between Procedure and Function

4 Answers   Accenture, Nagarro, TCS,


What happens if null values are involved in string operations?

0 Answers  


What are indexers?

0 Answers  


How to create a new schema in a database?

0 Answers  


Categories