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
Keyword and Parameter Description: label_name: This is an undeclared identifier which optionally labels the PL/SQL block. When used, label_name should be enclosed by the do

Use the RETURNING Clause Frequently, the application requires information about the row affected by a SQL operation, for illustration, to produce a report or take a subsequent

Using the Collection Methods The collection methods below help to generalize the code and make collections easier to use and also make your applications easier to maintain:

Albeit simple method : These all the truth tables give us our first as albeit simple method for proving a theorem: where check whether it can be written in propositional logic

Why Use Cursor Variables ? Primarily, you use the cursor variables to pass the query result sets between the PL/SQL stored subprograms and different clients. Neither PL/SQL nor

I need SQL Data Base Project Description: Network SQL database and SQL Setup two 4 workstation Skills required are Data Entry, MySQL, SQL

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

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

Example of COALESCE operator Example: Give the total of marks for each exam (simplified solution) SELECT CourseId, COALESCE ((SELECT SUM (Mark) FROM EXAM_MARK AS EM

Advantages of Packages The benefits of the Packages are as shown below: Modularity The Packages encapsulate logically associated items, types, and subprograms in the