Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



Databases Interview Questions
Questions Answers Views Company eMail

What are the operators used in select statements?

1109

What is set transaction?

1096

What is nvl?

1119

What is minus?

1057

What are the most important ddl statements in sql?

1204

Explain the the delete statements in sql?

1125

What is sql*plus?

1122

What is character functions?

1119

What is multiple columns?

1122

What is rollback?

1193

Explain the order of sql statement execution?

1094

What is sql integrity?

1266

What is break?

1269

What is csv?

1022

How to concatenate two character strings?

1097


Un-Answered Questions { Databases }

Hi, I am new in oracle(SQL), could anyone help me in writing a correct SQL. Below is the table structure. Table: Subsc Fields: 1. Sub_no (this field will hold values of subscriber nos, for e.g. S111111, S222222, S333333, S444444, etc.) 2. s_status (this field will hold values for different status of subscriber, for e.g. 'A', 'S', 'C', etc.) 3. cus_id (this field will hold values of bill nos for e.g. 11111111, 22222222, 33333333, 44444444, etc.) Table: Bill Fields: 1. Bill_no this field will hold values of bill nos for e.g. 11111111, 22222222, 33333333, 44444444, etc.) 2. b_status = (this field will hold values for different status of bill for e.g. 'O', 'C', 'S', etc.) Note: 1. The Sub_no is a Primary key of Subsc table. 2. The cus_id is a foreign in Subsc table (referred from Bill_no field of Bill table) 3. The Bill_no field is the Primary key of Bill table. Query A --> I wrote a query to select cus_id/Bill_no which is in status open (b_status = 'O') and having more than two active subscriber (i.e. S_status = 'A') in it ( i.e. more the two subscribers in same bill). select s.cus_id from subsc s where exists (select 1 from bill where bill_no = s.cus_id and b_status = 'O') and s_status = 'A' group by s.cus_id having count(sub_no) = 2 Problem : The above query will give the cus_id (or rather bill_no) which are in open status (b_status ='O) and which are having TWO ACTIVE Subscribers (s_status ='A') in it. However, this query will also lists the cus_id/bill_no which are having more than TWO subscribers in it (but only two subscriber will be in Active status (s_status = 'A') and the others will be in s_status = 'C' or s_status = 'S'. Help needed: I want to write a query which will fetch ONLY the cus_id/bill_no which are in open status (b_status ='O') and which are having ONLY TWO ACTIVE subscribers (s_status ='A') in it. B--> If I include the sub_no in the above query then NO row are returned. select s.cus_id, s.sub_no from subsc s where exists (select 1 from bill where bill_no = s.cus_id and b_status = 'O') and s_status = 'A' group by s.cus_id, s.sub_no having count(sub_no) = 2 Help needed: I want to modify the above query which will fetch ONLY the cus_id/bill_no which are in open status (b_status ='O') and which are having ONLY TWO ACTIVE subscribers (s_status ='A') in it ALONG with the sub_no. Thanks a lot in advance. Regards, Nitin

2411


How to assign null values to variables or columns?

1032


what are the advantages a stored procedure? : Sql dba

1025


What is a null value?

1195


How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

1980


If you had a tablespace, test_tablespace, which consists of three files:test01.dbf, test02.dbf, and test03.dbf, and someone accidentally used the unix command"rm" to delete the file test02.dbf, what else would you need in order to recover all the data thatwas present in test_tablespace at the time that test02.dbf was deleted?

632


How can we expand Parameter Form Canvas on Reports 6i?

2479


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

2212


Explain the usage of floor function in sql server.

1033


What do you mean by e-r model & object-oriented model?

983


what is the command line end user interface - mysql? : Sql dba

1042


Why mongodb is faster?

1


How do you remove duplicates without using distinct in sql?

1028


What do you understand by replication in sql server?

1138


What are the characteristics of dbms?

953