Gossamer Forum
Home : General : Databases and SQL :

About The Oracle Queries

Quote Reply
About The Oracle Queries
I have table created with the following information
-- Creating Tables

create table City_Table(CityName Char(20) NOT NULL,
PopulationNo Number(5) NOT NULL,
Primary Key (CityName));

Create Table Company_Table(CompanyCode Char(20) NOT NULL,
CompanyName Char(20) NOT NULL,
CompanyLocation Char(20) NOT NULL,
Primary Key (CompanyCode),
Foreign Key (CompanyLocation) REFERENCES CITY_TABLE);

Create Table Employee_Table(EmpNo Number(5) NOT NULL,
EmpName Char(20) NOT NULL,
EmpPhone Char(20) NOT NULL,
EmpBornCity Char(20) NOT NULL,
EmpFirstSchoolCity Char(20) NOT NULL,
CompanyCode Char(20) NOT NULL,
Primary Key (EmpNo),
Foreign Key (EmpBornCity) References City_Table,
Foreign Key (EmpFirstSchoolCity) References City_Table,
Foreign Key(Companycode) References Company_Table);

and i want the following query to be exectued with following data
data is
--Insertion into City Table
Insert Into City_Table values('MELBOURNE',6000);
Insert Into City_Table values('SYDNEY',8000);
Insert Into City_Table values('PERTH',3000);
Insert Into City_Table values('GOLDCOAST',4000);
Insert Into City_Table values('QUEENSLAND',5000);

-- Insertion into Company Table
Insert Into Company_Table values('C11','INDIGIT','PERTH');
Insert Into Company_Table values('C22','LOGITECH','SYDNEY');
Insert Into Company_Table values('C33','BANNY','MELBOURNE');
Insert Into Company_Table values('C44','TECHOTECH','GOLDCOAST');
Insert Into Company_Table values('C55','INTEL','QUEENSLAND');
Insert Into Company_Table values('C66','MICROSOFT','GOLDCOAST');

-- Insertion into Employee Table

Insert Into Employee_Table values(1,'KIRAN',7122,'SYDNEY','SYDNEY','C11');
Insert Into Employee_Table values(2,'KUMAR',8822,'PERTH','SYDNEY','C22');
Insert Into Employee_Table values(3,'ANIL',9922,'MELBOURNE','MELBOURNE','C44');
Insert Into Employee_Table values(4,'NAVEEN',2224,'PERTH','MELBOURNE','C55');
Insert Into Employee_Table values(5,'KIRSH',6522,'SYDNEY','QUEENSLAND','C33');
Insert Into Employee_Table values(6,'ADAM',9522,'GOLDCOAST','GOLDCOAST','C66');
Insert Into Employee_Table values(7,'BECK',9722,'QUEENSLAND','PERTH','C11');
Insert Into Employee_Table values(8,'GAB',6524,'SYDNEY','MELBOURNE','C55');
Insert Into Employee_Table values(9,'YASHICA',8542,'PERTH','QUEENSLAND','C33');
Insert Into Employee_Table values(10,'SUE',3654,'QUEENSLAND','GOLDCOAST','C66');
Insert Into Employee_Table values(11,'JUSTIN',8547,'QUEENSLAND','SYDNEY','C11');

and the query is

--2) c. List the Company Name and the total number of all employees who work for the company.
-- Only include companies where the total number of employees is greater than or equal to 2.
-- The list must be in company name sequence.
can u please help me out in finding the solution for that please
Quote Reply
Re: [kirsup] About The Oracle Queries In reply to
I've moved your thread to a more appropriate forum. The one you placed it in, was put there to talk about Gossamer Threads as a company Wink


Andy (mod)
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!