473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Oracle Problem 1: Please Help


Hi Everyone,

This is my problem;

*PROBLEM 1:* I need to create a table called *INSTRUCTOR_NEW* with al
of the information from *INSTRUCTOR* table. Add a column to th
instructor table called *SALARY* which should be a number with
decimal places. Add a constraint to the *INSTRUCTOR_NEW* table calle
*inst_max_sal* that stipulates that no instructor can have a salar
greater than $3000(three thousand dollars) (this is a weekly salary).
Code
-------------------

CREATE TABLE instructor_new AS
SELECT *
FROM instructor;

ALTER TABLE instructor_new
ADD (salary NUMBER(4,2)
CONSTRAINT inst_max_sal
CHECK (salary >= 0
AND salary < 3000));
/

-------------------

I used the code above however the problem I'm having is identifying th
salary as a weekly salary. *How do I write that the MAX salary i
$3000.00 per week in SQL?
*
-
singhji
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message173341.htm
Jul 19 '05 #1
2 1698
In addition to doing your homework, do we also have to pay portion of
your tuition fees?

Daniel
Jul 19 '05 #2
singhjih <si*************@mail.webservertalk.com> wrote in message news:<si*************@mail.webservertalk.com>...

You do not specify what the INSTRUCTOR table looks like, so it is
difficult to help you. Why don't you include all the details?

Based on what you are saying, I am assuming you need an aggregate
function to enforce your constraint. If so, I think you will need to
use a before insert trigger on the table rather than a simple check
constraint, and inside the trigger, run the aggregate query to
determine whether or not the constraint is violated or not.

Dave
Hi Everyone,

This is my problem;

*PROBLEM 1:* I need to create a table called *INSTRUCTOR_NEW* with all
of the information from *INSTRUCTOR* table. Add a column to the
instructor table called *SALARY* which should be a number with 2
decimal places. Add a constraint to the *INSTRUCTOR_NEW* table called
*inst_max_sal* that stipulates that no instructor can have a salary
greater than $3000(three thousand dollars) (this is a weekly salary).
Code:
--------------------

CREATE TABLE instructor_new AS
SELECT *
FROM instructor;

ALTER TABLE instructor_new
ADD (salary NUMBER(4,2)
CONSTRAINT inst_max_sal
CHECK (salary >= 0
AND salary < 3000));
/

--------------------

I used the code above however the problem I'm having is identifying the
salary as a weekly salary. *How do I write that the MAX salary is
$3000.00 per week in SQL?
*

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
3
by: Jan Bols | last post by:
I've been trying to install Oracle 8.1.7 on a fresh Mandrake 9.1 O.S for days, but I'm still not able to get it running. I've tried several install instructions that I found on the internet but no...
1
by: Crowe | last post by:
Greetings Everyone: Oracle 9i installed on a sun solaris box. No protocol adapters available. I would greatly appreciate any help from the db gurus on this forum. after bringing up the...
7
by: Cherrish Vaidiyan | last post by:
hello, I am been getting mad with so many doubts and errors.. I have posted some doubts,test cases regarding listener,replication and standby database.But i havent got any response..(I am...
1
by: Dominic | last post by:
Hi, I am TOTALLY new to all this stuff and really hope to find help here. I have to come up with a solution for one of my client. They use HP-UX and Pro/5 What I'm trying to do:
1
by: black hawk | last post by:
Hello, i have a big problems, to install oracle 9i v9.2 Server to my "Windows XP" with Service Pack 2 and all security and other updates from Microsoft. The "Universall Installer" (Standard...
63
by: Nick Palmer | last post by:
Hi all, Is there a DB2 equivilant to Oracle's DB Link functionality ? I have two DB2 databases and I need to get access to the tables in one from the other. In Oracle I would just create a DB...
0
by: Anonymous User | last post by:
Hi, I am working on a mobile application that consists of a number of handheld scanners, an Xml Web service and an Oracle 9i database in a highly secure environment. The .Net Compact Framework...
9
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
2
by: Ruslan A Dautkhanov | last post by:
Hello ! I'm about to install O9i on FreeBSD box. uname -a: FreeBSD stat2.scn.ru 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.