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
Ensuring Backward Compatibility   The PL/SQL Version 2 permits some abnormal behavior which Version 8 disallows. Particularly, Version 2 permits you to (i) Make the forw

Expression: This is a randomly complex combination of constants, variables, literals, operators, & function calls. The simplest expression consists of a single variable. If th

Parameter and Keyword Description:   table_reference: This keyword identifies the table or view that should be accessible when you execute the UPDATE statement, and for wh

Procedures   The procedure is a subprogram which performs a specific action. You write procedures using the syntax as shown below: PROCEDURE name [(parameter[, parameter, .

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

query to Find the account numbers of all customers whose balance is more than 10,000 $

Use the NOCOPY Compiler Hint By default, the OUT and IN OUT parameters are passed by the value i.e. the value of an IN OUT actual parameter is copied into the corresponding fo

Calling Constructors: The Calls to a constructor are allowed wherever the function calls are allowed. Similarly to the functions, a constructor is called as a section of an ex

ROWID and UROWID Internally, every database table has a ROWID pseudo column that stores binary values known as rowids. Each rowid shows the storage address of a row. A physical

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a