Sql queries, PL-SQL Programming

Assignment Help:

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;


Related Discussions:- Sql queries

Map and order methods, Map and Order Methods: The values of the scalar...

Map and Order Methods: The values of the scalar datatype like CHAR or REAL have a predefined order that allows them to be compared. While, the instances of an object type has

Group and having query, Using a join on 2 tables, select all columns and 10...

Using a join on 2 tables, select all columns and 10 rows from the 2 tables without the use of a Cartesian product. Query: SELECT * FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_

Updating variables, Updating Variables For assignment, SQL uses the ke...

Updating Variables For assignment, SQL uses the key word SET, as in SET X = X + 1 (read as "set X equal to X+1") rather than X: = X + 1 as found in many computer languages.

Example of add constraint in sql, Example of ADD CONSTRAINT in SQL Exa...

Example of ADD CONSTRAINT in SQL Example: Alternative formulation for MAX_ENROLMENTS ALTER TABLE IS_ENROLLED_ON ADD CONSTRAINT MAX_ENROLMENTS CHECK ((SELECT COUNT (*)

Closest approximation to relational union - sql, Closest Approximation to R...

Closest Approximation to Relational Union - SQL Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to th

Null statement-sequential control, NULL Statement The NULL statement c...

NULL Statement The NULL statement clearly specifies in action; it does nothing other than to pass control to the next statement. It can, though, improve the readability. In a

Difference between implicit and explicit cursor, Implicit Cursor is declare...

Implicit Cursor is declared and used by the oracle environment internally. while the explicit cursor is declared and used by the external user. more over implicitly cursors are no

Sql is a database language, SQL Is a Database Language: The commands g...

SQL Is a Database Language: The commands given to a DBMS by an application are written in the database language of the DBMS. The term data sublanguage is sometimes used instea

Oracle PL SQL, I need to write one function and one procedure to query a Or...

I need to write one function and one procedure to query a Oracle 10.1 DB using PL SQL. I have the schema and exact queries...along with work Ive started and a template to put the a

Ending transactions, Ending Transactions A good quality programming pr...

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd