473,472 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1699
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.