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
UNION ALL - SQL Further varieties of UNION arise when we replace the key word DISTINCT by ALL in any of the foregoing examples, as in Example. ALL specifies that if row r appe

Ending Transactions A good quality programming practice is to commit or roll back every transaction explicitly. Whether you rollback or issue the commit in your PL/SQL program

Controlling Autonomous Transactions The first SQL statement in an autonomous routine starts a transaction. Whenever one transaction ends, the next SQL statement starts the oth

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

LOB Types The large object (LOB) datatypes like BFILE, BLOB, CLOB, and NCLOB store the blocks of unstructured data (like graphic images, text, video clips, and sound waveforms)

Count Operator in SQL Example: Counting the students who have scored more than 50 in some exam (SELECT COUNT (*) FROM (SELECT DISTINCT StudentId FROM EXAM_MARK WHE

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump i

UTL_FILE: The Package UTL_FILE permits your PL/SQL programs to read & write operating system (OS) text files. It gives a restricted version of the standard OS stream file I/O,

I have a Pascal Source file that needs to be compiled into a Service. In addition, there are various functions (Pascal Procedures I guess) that need to be created to Read and Write

The Package Body The package specification is implemented by the package body. That is, the package body has the definition of every cursor and the subprogram declared in the p