Sql queries, PL-SQL Programming

SELECT a.child_fname,a.child_lname,concat(b.parent_title,b.parent_fname),
b.parent_lname,b.parent_tphone
FROM child a,parent b WHERE a.parent_id=b.parent_id
ORDER BY a.child_fname,a.child_lname;

SELECT c.act_name 'Activity',concat(a.child_fname,a.child_lname) 'Child Name'
FROM child a,attendence b,activity c
WHERE a.child_id=b.child_id and b.act_id=c.act_id
AND b.act_id=4;

SELECT c.act_name 'Activity',a.child_gender  'Gender',
count(a.child_gender) 'No of Registered Children'
FROM child a,attendence b,activity c
WHERE c.act_id=b.act_id and b.child_id=a.child_id
group by c.act_id,a.child_gender;

SELECT child_fname ‘First Name’,child_lname ‘Sur Name’,
floor(datediff(curdate(),child_dob)/365) 'Age (Yrs)'
FROM child
ORDER BY floor(datediff(curdate(),child_dob)/365) DESC,
child_lname,child_fname;

Posted Date: 3/11/2013 6:19:29 AM | Location : United States







Related Discussions:- Sql queries, Assignment Help, Ask Question on Sql queries, Get Answer, Expert's Help, Sql queries Discussions

Write discussion on Sql queries
Your posts are moderated
Related Questions
PITS Depressions in secondary cell wall is called pit. A pit present on the free cell wall surface without its partner is called Blind pit. It consists of 2 parts -

Projection and Existential Quantification - SQL Intuitively it might seem that projection in SQL is simply a matter of specifying the required columns in the SELECT clause, a

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Relational Operators The relational operators permit you to compare randomly complex expressions. The list below provides the meaning of each operator:

FORALL Statement The FORALL statements instruct the PL/SQL engine to bulk-bind the input collections before sending them to the SQL engine. Though the FORALL statement consists

Cursor Variables:   To execute the multi-row query, the Oracle opens an unnamed work region that stores the processing information. You can use an explicit cursor that names

Challenge 1 You are required to do the project and write a test plan for it. Demo 4 is a check writer program for employees. In it, the user enters all information about the

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op

Methods: In normal, a method is a subprogram declared in an object type specification using the keyword MEMBER or STATIC. The method cannot have similar name as the object typ