GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 128 of 132    Print  
List all customer (user id, name, and e-mail), number of charging
List all customer (user id, name, and e-mail), number of charging, total charging,
number of transaction and total number of transaction value?

If u have these tables:

1- 'Credit_card'
columns: credit_number,type,value,Customer_ID.

2-'Coupon'
columns: Coupon_number,value,password,Customer_ID

3-'Customer'
columns: Customer_ID,Fname,Mname,lname,E_mail,password,bdate,tot_trans,mobil_no,
hom_no,ex_id_date,current_Balance.



  
Total Answers and Comments: 1 Last Update: February 19, 2008     Asked by: mnmlove 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 19, 2008 01:17:53   #1  
friends_mukesh Member Since: February 2008   Contribution: 1    

RE: List all customer (user id, name, and e-mail), number of charging

Hi One of the solution is as follow:
select cust.customer_id fname mname lname e_mail credit.tot_credit+coupan.tot_coup no_of_recharge

credit.tot_credit_val+coupan.tot_coup_val tot_recharging tot_trans credit.tot_credit_val+coupan.tot_coup_val-current_balance transaction_val cust.current_balance

from Customer cust

(select customer_id count(value) tot_credit sum(value) tot_credit_val from credit_card group by customer_id) credit

(select customer_id count(value) tot_coup sum(value) tot_coup_val from coupan group by coupan.customer_id) coupan

where coupan.customer_id cust.customer_id and cust.customer_id credit.customer_id;


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Select ROWNUM, col1, col2 from tablename; ...

Display the records between two range I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text “Not Applicable” want to display, instead of blank space. How do I write the query

Latest Answer : The number which have precesion can be spelled in words by this way..SELECT DECODE(SUBSTR(LPAD('1256932.1',DECODE(INSTR('1256932.1','.'),0,11,DECODE(LENGTH('1256932.1')-INSTR('1256932.1','.'),1,13,14)),'0'),1,4),'0000','',TO_CHAR(TO_DATE('01-12-'||SUBSTR(LPAD('1256932.1',DECODE(INSTR('1256932.1','.'),0,11,DECODE(LENGTH('1256932.1')-INSTR('1256932.1','.'),1,13,14)),'0'),1,4),'DD-MM-YYYY'),'YYYYSP')||' ...

Latest Answer : These are the querys:- FOR Odd number of records: select * from emp where (rowid ,1) in (select rowid, mod(rownum,2) from emp);   FOR Even number of records: select * from emp where (rowid ,0) in (select rowid, mod(rownum, 2) from emp); try......................... ...

Latest Answer : months_between(date1,date2) returns the number valueno other date functions return number value ...

Latest Answer : Till Oracle 7.0, only 12 triggers could be defined per table. In later versions there is no such limitation. ...

CHAR,VARCHAR2,NUMBER,DATE,RAW,LONG and LONG RAW. 
Latest Answer : CHAR,VARCHAR2,NUMBER,DATE,RAW,LONG and LONG RAW,BLOB, CLOB,NCLOBFOR ORACEL 9I AND ABOVE.TIMESTAMP, TIMESTAMP WITH TIME ZONE, YEAR TO DAY, DAY TO SECOND ...

How to decrypt the password on oracle 8/8i in system/scott user?what is the query fired to see the password?
Read Answers (2) | Asked by : Ashish

Latest Answer : SELECT 'GRANT ' ||privilege ||' ON '||table_schema||'.'||table_name ||' TO '||USER ||' ;' FROM ALL_TAB_PRIVSWHERE grantee ='TILITS' -- user name that has already access  ...

Latest Answer : There is no restiction on number of datatypes allowed except for long and LOB.I table can contain only one long column. ...


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

PHP Oracle Web Development Review

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books The author is also an expert in open source technologies and SOA Service Oriented Architecture But besides
 

Step by Step Oracle PL-SQL Tutorial

This introductory tutorial to PL SQL will help you to understand the basic concepts of PL SQL Please review the following tutorials and practice the sample SQL Statements on your local Oracle Database Please note that you must learn these basic things before we actually start getting in to Advanced
 

Working with XML in Oracle

Working with XML in Oracle Introduction to XML Extensive markup language is the language which presents data in a human readable form of text The data can be anything from a purchase order or a stock quote or weather radar or a flight schedule it can be represented using XML XML is very similar to H
 

What is Oracle Net Service

Oracle Net Services provides enterprise-wide connectivity solutions in distributed, heterogeneous computing environments. Oracle Net Services eases the complexities of network configuration and management, maximizes performance, and improves network diagnostic capabilities. Oracle Net, a component
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape