Question

How to set multiple constraints.

Rating7.2Very Good


SID -- A string of four characters in length, student I.D. How could I specify the following constraints:
1) The string has exact four character long,
2) The first character of the string has to be 'S',
3) The other characters have to be numeric.
Can you set it as primary key and unique?

Email -- is an email address, I know how to  hold up to 30 characters but how can u make it contain a '@' character with it as well?

And this what have done so far,
CREATE TABLE Student
(
SID
Name varchar(10) not null,
BirthDate DATE not null,
Email

);

  1. not null constraint
    1) When user defined constraint names are not given for not null check constraints , not nulls appear using describe command and not the other way round. 2) Why so? Why they disappear when our own constraint names are given. Is there any way to make them reappear?. --- k_murli_krishna
  2. ORA-06502: PL/SQL: numeric or value …
    Trying to execute a function and getting this error: select getChildOrderIds('AB82888') from dual; ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "GETCHILDORDERIDS", line 13 Function: CREATE OR REPLACE FUNCTION getChildOrderIds(or…
  3. ORACLE -- update number to null
    How can I do something like the below to update my "NUMBER(8)" column to NULL ? UPDATE gml_p_components SET mast_id = ;
  4. PLease help correct this code.
    I am in a Database course but have no programming background. Help is much appreciated-I need to hand in this assignment by 6 pm tonight. I am having an error creating tables. Oracle EXPRESS 10g-installed on WIn XP SP3 machine. SQL Plus. Please offer correction for this code and any other suggestions you think might be applicable. …
  5. Understanding SQL +
    Can someone help explain this? (This i shomework so I am just looking for an explanation) I can't figure out what is wrong with the fk and why SQL+ keeps throwing an error. Error is ORA-00922: missing or invalid option. These are two simple tables. One named student, the second named enrollment. CREATE TABLE enrollment…

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
multiple constraint
Participating Experts
4
Solution Grade
B

Replies

 
by: cjjclifford

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: andrewst

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: grim_toaster

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: mottor

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: cjjclifford

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: andrewst

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Celiowin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: grim_toaster

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Celiowin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Celiowin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: andrewst

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: andrewst

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: andrewst

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert