SQL Recipes
A FREE cookbook for SQL queries and examples
Register FAQ Search Today's Posts Mark Forums Read

SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it.

Go Back   SQL Recipes a FREE cookbook of SQL queries and examples > SQL queries and examples > SQL - Questions and Answers

Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 05-19-2008, 11:30 AM
Unregistered
 
Posts: n/a
Lightbulb ANY dialect question:

sql queries for RCA .... pls help us


hello there,

how r u doing? hope u all r doing well

well i need ur help, i've tried hard to find out the answers but i failed :-(

RCE means "Renting Car Agency"

the tables are

create table Renter
(RNO varchar2(5) primary key,
RName varchar2(10),
INCOME number,
CITY varchar2(10));

insert into Renter values('R1', 'NASSER', 12000, 'PARIS');
insert into Renter values('R2', 'NASSIM', 13000, 'LONDON');
insert into Renter values('R3', 'RABIH', 12400, 'LONDON');
insert into Renter values('R4', 'AHLAM', 11500, 'PARIS');
insert into Renter values('R5', 'RIYAD', 9500, 'DUBAI');


create table Car
(CNO varchar2(5) primary key,
CName varchar2(10),
AGE number,
CITY varchar2(10));

insert into Car values('C1', 'NISSAN', 1, 'LONDON');
insert into Car values('C2', 'HONDA', 1, 'PARIS');
insert into Car values('C3', 'MAZDA', 3, 'LONDON');
insert into Car values('C4', 'MERCDES', 4, 'OSLO');
insert into Car values('C5', 'BMW', 5, 'PARIS');
insert into Car values('C6', 'TOYOTA', 1, 'LONDON');

create table Contract
(
RNO varchar2(5) not null references Renter,
CNO varchar2(5) not null references Car,
DNO varchar2(5) REFERENCES DRIVER,
AMT number);
alter table contract add constraint contrcat_pk primary key (RNO,CNO, DNO);


insert into Contract values('R1','C1','D1',40);
insert into Contract values('R1','C2','D1',30);
insert into Contract values('R1','C3','D2',20);
insert into Contract values('R1','C4','D2',30);
insert into Contract values('R1','C5','D2',40);
insert into Contract values('R1','C6','D2',50);
insert into Contract values('R2','C1','D2',10);
insert into Contract values('R2','C2','D3',10);
insert into Contract values('R3','C3','D3',10);
insert into Contract values('R4','C4','D4',20);
insert into Contract values('R4','C5','D5',10);
insert into Contract values('R4','C6','D5',10);


and the questions are:

1. get renter number for renters who rent at least one car rented by Renter R2

2. get renter names for renters who rent car no C2

3. get the age of the car that rented by renter R1

4. get renter names for renter who does not rent car C2

5. get the car name that has 2 contracts

6. get renter numbers for renter who rent at least all those car rented by renter R2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

ANSWER(S):

  #2 (permalink)  
Old 05-20-2008, 05:14 PM
Unregistered
 
Posts: n/a
Default ANY answer. Re: sql queries for RCA .... pls help us

cross posting homework questions isn't cool

SQL Server Forums - RCA system...pls help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:06 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright (c) 2006-2008 SQL Recipes

1 2 3 4 5 6 7 8