File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Please solve this query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Please solve this query" Watch "Please solve this query" New topic

Please solve this query

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear ranchar first of all sorry to ask this oracle question on this forum. But if possible the please give me the answer of the following query please sir as soon as i have a assignment ahead

Create table client_master with following constraints:

a) Client_no must be the primary key.

b) Data variable being inserted into the coloumns Client_no must start with capital letter 'C'

c) Data value being insertd into the coloumn NAME should be upper case only.

d) Only allow "BOMBAY","DELHI","MADRAS", and "CALCUTTA" as legitmate value for the column city.

structure of file as follow

Client_NO VARCHAR2 06
Name VARCHAR2 20
Address VARCHAR2 30
City VARCHAR2 15
State VARCHAR2 15
Balance NUMBER 10,2

Insert at least 5 data

Write the query as for following

1) Modify the field name of the table. Client_master to now hold maximum of 25 characters values.

2)Retrive the client information like Client_no,name and balance for all clients where the field city was the value BOMBAY or DELHI

3)Retrived specified client information for the clients who are NOT in "MADRAS" or "DELHI"

4)Retrive all row from the table client_master and display this data sorted by the value contained in the field NAME in Ascending order.

5) Delete only data from the table client_master.

6)Delete table client_master along with itts structure.


Arun kumar maalik
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

It's ok to ask Oracle questions in this forum. However, I don't see what the question is. You posted your assignment. What are you stuck on? What do you have so far?

(Nobody here is going to do the assignment for you, just point you in the right direction.)

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
No Assignment sir please i have written the answer of these question but i want to match the answer of my question with you pepole answer so please


Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

All right. So go ahead and post your answers, and then we'll compare ours with what you post and discuss any differences. Otherwise, it just looks like you are trying to get somebody to provide you with the answers.
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Okay fine

create table client_master
client_name varchar2(6) primary key,
Name varchar2(20),//Here i don't know what will for upper case only
Address varchar2(30),
city varchar2(15) in("BOMBAY","DELHI","MADRASH","CALCUTA"),
state varchar2(15),
Balance number(10,2);

Now sir i want to answer of this question only actualy how will i add the constraint in these column so that Client_no column will start with 'C' and data value inserted in the NAME should be upper case only.

so change the code there
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
And one thing sir how will i further modify this code to hold maximum of 25 characters values only

Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
JavaRanch is an informal sort of place, where sir this and sir that is not necessary...and perhaps the cowgirls will think you don't want their answers.

Try google search with: oracle check constraint upper
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
I agree. Here's the link:
subject: Please solve this query
It's not a secret anymore!