Simple question about code

Hello, I am beginning with SQL again after a long break and am having a niggling problem with the following code. What is going wrong? Thanks, Jonathon Sunny
CREATE
TABLE CHILDREN
CHILD_ID
INT NOT
NULL PRIMARY KEY,
FNAME
VARCHAR(24)
NOT NULL,
LNAME
VARCHAR(24)
NOT NULL,
PHONE
CHAR(12)
NOT NULL,
CHECK (PHONE
LIKE '(0[0-9][0-9])[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'),
CHILDGRADE
VARCHAR(8)
NOT NULL,
CHECK (CHILDGRADE
LIKE 'BEGINNER'
OR 'NOVICE' OR
'SKILLED' OR
'EXPERT'))
CREATE
TABLE INSTRUCTORS
STAFF_NO
INT NOT
NULL PRIMARY KEY,
FNAME
VARCHAR(24)
NOT NULL,
LNAME
VARCHAR(24)
NOT NULL,
PHONE
CHAR(13)
NOT NULL,
CHECK (PHONE
LIKE '(0[0-9][0-9])[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'))
CREATE
TABLE LESSONS
LESSON_ID
INT NOT
NULL PRIMARY KEY,
DAY
DATE NOT
NULL,
TIME
TIME NOT
NULL,
LESSONGRADE
VARCHAR(8)
NOT NULL,
CHECK (LESSONGRADE
LIKE 'BEGINNER'
OR 'NOVICE' OR
'SKILLED' OR
'EXPERT'))
CREATE
TABLE QUALIFICATION
QUAL_NAME
VARCHAR(24)
NOT NULL
PRIMARY KEY,
DATE_AWARDED
DATE NOT
NULL,
INSTITUTIONNAME
VARCHAR(24)
NOT NULL)
CREATE
TABLE BOOK
FOREIGN
KEY (CHILD_ID,
LESSON_ID))
CREATE
TABLE TEACH
FOREIGN
KEY (LESSON_ID,
STAFF_ID))
CREATE
TABLE AWARDED
FOREIGN
KEY (STAFF_ID,
QUAL_NAME))

Bellow is the right one:
CREATE TABLE CHILDREN (
CHILD_ID INT NOT NULL PRIMARY KEY,
FNAME VARCHAR(24) NOT NULL,
LNAME VARCHAR(24) NOT NULL,
PHONE CHAR(12) NOT NULL,
CHECK (PHONE LIKE '(0[0-9][0-9])[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'),
CHILDGRADE VARCHAR(8) NOT NULL,
CHECK (CHILDGRADE = 'BEGINNER' OR CHILDGRADE = 'NOVICE' OR CHILDGRADE = 'SKILLED' OR CHILDGRADE = 'EXPERT'))
CREATE TABLE INSTRUCTORS (
STAFF_NO INT NOT NULL PRIMARY KEY,
FNAME VARCHAR(24) NOT NULL,
LNAME VARCHAR(24) NOT NULL,
PHONE CHAR(13) NOT NULL,
CHECK (PHONE LIKE '(0[0-9][0-9])[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'))
CREATE TABLE LESSONS (
LESSON_ID INT NOT NULL PRIMARY KEY,
DAY DATE NOT NULL,
TIME TIME NOT NULL,
LESSONGRADE VARCHAR(8) NOT NULL,
CHECK (LESSONGRADE = 'BEGINNER' OR LESSONGRADE = 'NOVICE' OR LESSONGRADE = 'SKILLED' OR LESSONGRADE = 'EXPERT'))
CREATE TABLE QUALIFICATION (
QUAL_NAME VARCHAR(24) NOT NULL PRIMARY KEY,
DATE_AWARDED DATE NOT NULL,
INSTITUTIONNAME VARCHAR(24) NOT NULL)
CREATE TABLE BOOK (
CHILD_ID INT NOT NULL,
LESSON_ID INT NOT NULL
FOREIGN KEY (CHILD_ID) REFERENCES CHILDREN(CHILD_ID),
FOREIGN KEY (LESSON_ID) REFERENCES LESSONS(LESSON_ID))
CREATE TABLE TEACH (
LESSON_ID INT NOT NULL,
STAFF_ID INT NOT NULL
FOREIGN KEY (LESSON_ID) REFERENCES LESSONS(LESSON_ID),
FOREIGN KEY (STAFF_ID) REFERENCES INSTRUCTORS(STAFF_NO))
CREATE TABLE AWARDED (
STAFF_ID INT NOT NULL,
QUAL_NAME VARCHAR(24) NOT NULL
FOREIGN KEY (STAFF_ID) REFERENCES INSTRUCTORS(STAFF_NO),
FOREIGN KEY (QUAL_NAME) REFERENCES QUALIFICATION(QUAL_NAME))
If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Similar Messages

  • Simple question about mount and delay script

    Hello, I have a simple question about mounting volumes on start up.
    My computer wakes up auto - and then auto there are serveral applescript tasks (mount and start up programs)
    I use this script (daily) for serveral connections with external volumes I always need the connect to. ( In the script I use this code 3 times for other locations) I do this on start up.
    set Uname to "XXX"
    set Pword to "XXX"
    set someVolume to "afp://XXX.XXX.XXX.XXX/XXX/XXX
    mount volume someVolume as user name Uname with password Pword
    (same code for 2 other locations)
    When i do this on start up sometimes the script says there is no connection possible. I guess it's because on start up the connection isn't there. And 1 minute later when computer is total ready the connection is ok. When I run the script then It works. Just sometimes ( In the morning) 'It' want to connect but the script stops. When i do it manually(I run the script again) it works just fine.
    Is it possible that I need a delay? Can someone explain this?
    How would I make a delay handler for this script? Is that the best solution?
    Thanks in advance. This is something small i'm wondering about.
    Colin

    BTW, If you saved the script as an application +(and not as an application bundle)+ you could drop the script on to *Drop Script Backgrounder* (freeware).
    Then the script would run in the background, so, you wouldn't see it running in the Finder.
    <http://www.macupdate.com/info.php/id/7922/drop-script-backgrounder-x>
    Tom

  • A simple question about combo box

    Dear All,
    Just got a simple question about combo box: I have one of these selectors with labels based on filtered rows from a table.
    Is it possible to have one more label that would select all options?
    Like:
    Product A
    Product B
    Product C
    All Product
    Many thanks for your help!
    Gilles

    Hi Gilles,
    The purpose of ComboBox itself to select single option out of many.
    For your purpose, you may have to use "List Builder" which can accomodate 1 or more  to select.
    Please revert for more clarification if you need.
    With best wishes
    BaaRaa.

  • A simple question about performance!

    Hi! I have a simple question about performance. Suppouse that you have a servlet or a class with DB access, and you need to use a value several times in that page. What is best, to assign the value from say, a resultset or a request.getParameter() to a variable or to call the resultset or the request every time you need to retrieve that value? Which option uses less memory, which is faster, etc.?
    Hoping the best fou u
    Raul

    If you need more values from a db, the best is to open some connections (connection pool) and use the for accessing the db.
    To get the data only once, open the connection, get the data, store the data whereever you want: variable (class), hidden control (if you want to send from one page to another by request) and close the connection as quicky as possible.
    The advantage of the first method is that the most time consuming activity (connections opening) is done only once.

  • Simple question about flex and AS 3.0

    Hi, this might sound like a simple question so I apologize...
    I have both a copy of flex 2 and 3, and i want to simply code in AS
    3.0 not mxml. I referred to the help of both flex 2 and 3, and all
    i could come up with is "you can add dynamic behavior to your
    documents using actionscript", which means to me, you only write
    your functions in AS and create instances with mxml (...ugh).
    personally, i find mxml to be ugly (mainly because it looks like
    html to me), and i'd rather not use it. coming from programming in
    an IDE in Java, it seems like it would be nicer to have something
    similar, all the while having the power and cool features of flash.
    I'm not fully educated in this matter so i understand that i could
    be totally wrong.
    i mean, if i have to code in mxml, i will. i'm a web
    programmer for a living, and if a more experience programmer said
    something like "if you don't code mxml in flex, you'll never get a
    job coding in flex", i would trust the advice, and learn the ugly
    code. :)
    yes, i do have Flash cs3, it's great but it seems like a pain
    to me the way you organize classes.... i've only seen a few
    tutorials, ones that explain how you cannot simply import a custom
    class, you have tell your movie to link to it, put it in the same
    directory, or manually name the package, it's sort of confusing.
    my main point here is that i'm very eager to start building
    apps in straight AS 3.0 instead of using flash cs3 (for some
    projects), and it would be cool to get some help or be pointed in
    the right direction.
    to simplify:
    can i write AS 3.0 and only as 3.0 in flex 2 or 3? how? can
    you link me to a tutorial? any advise?
    thanks!

    Hey William, thanks for the post. It's a great coincidence
    because I'm reading that book as well. I'm about half way through
    it, and I love it. I installed mxmlc on my linux box and am writing
    pure AS 3 apps. I think that's the way to go, though I know it's
    not for everybody.
    My problem with mxml is that it has a weird syntax for
    function calls, and it's not as 'intuitive' for a person like me,
    who came from C++ and Java programming in the past. I like writing
    programs in the C++ and Java style syntax, and since so many other
    languages use a similar syntax, I don't see any reason to learn the
    nuances of mxml, unless I was getting paid to do it. As far as I
    can tell there is no benefit.
    I hate using Flash to write flash apps as well, I feel like
    they become messy and confusing, especially when trying to write an
    OOP application. I only use it if I want to move an object in a
    very specific way and can't do it with the Tween methods.

  • A simple Question about % in CR Chart!

    Hi, I have another simple question.
    When i use SQL to storage data and wanna Crystal Report to display the data in chart using %
    which data type should i use?
    float or string?
    and I found when i use 0.12 as 12% in database , It could not display in Crystal Report line chart normally.
    What should I do??
    Please Help!!!
    Thank you VERY MUCH!!!

    If you have the datatype as string from your database then try adding the string field as a summary field in chart and select maximum instead of count and if you have them in number format then you can directly select the percentage in chart.
    Regards,
    Raghavendra

  • Simple question about generate proxy

    Hi guys...
    This is a simple but a truly simple question....
    When trying to create a proxy from our messages interfaces using SPROXY, i'm not able to get the Software component versions that were used from the sld...
    Do I have to export them? Or import them?

    Hi Goncalo,
    Check if it helps...
    Re: SW component version not visible in SPROXY
    Regards
    Anand

  • Simple question about JAVA path

    Hi. I have a simple question , but I spent several hours trying to find an answer.
    How do I know the location of the java executable which is used by Concurrent Manager.
    I already know that running which java under application user will not give me the correct answer

    Maybe you can try like this:
         public String getPath(){
              Class cls=getClass();
              String className=cls.getName();
              String packageName=cls.getPackage().getName();
              System.out.println(className);
              System.out.println(packageName);
              String newClassName=className.replaceAll("\\.", "/");
              String resouceName=newClassName+".class";
              System.out.println(resouceName);
              URL url;
              url=cls.getClassLoader().getResource(resouceName);
              String path="";
              path=url.getFile();
              return path;
         }

  • A very simple question about WF

    hi experts
    I would like to ask a question about workflow
    as u may know there is 'Loop' step in workflow, but I am confused when should I use Loop?
    Is this step used for processing internal table?  if yes, why shouldn't I create a custom BOR method and pass the entire internal table to the method?
    many thanks

    hi
    loop step for not process the internal table,
    this is used to process the some steps repetely until condition True or False.
    we have two loop steps is there
    WHILE AND UNTIL.
    Thanks
    sitaram

  • Simple question about telnet and characters

    Hi all,
    We've installed for the first time a SUN machine. So i think it's for a SUN expert a very simple question.
    Normally when i type a special character it will be dispayed like " � " [alt+132]
    But when i use a telnet session and i type "alt+132" i get a "d" and not "�".
    Does someone know where i must start to find out how this works ?
    Thanks you very much.
    ESP

    This is probably related to the locale your server is in. I don't remember the default locale a box is installed in if you don't specify. I think its "C". I use the UTF-8 or en_US.ISO8859-1 locales at home. At work, usually C but sometimes applications may require UTF-8. BEA Weblogic required this for a project a while back. This is defined in /etc/init/tz.

  • Maybe a simple question about M2T ?

    Hi
    I record in HDV on the JVC GY 101.
    I store on the Focus Enhancements DR HD100 Hard disk recorder.
    The footage I have is in HDV 25frames Progressive.
    The hard disk stores as m2t file and I seem to need to use Mpeg streamclip to convert for Final Cut Pro HD.
    I have a few questions about this.
    1) What should i convert to with mpeg streamclip ? mov, dv m2v etc etc
    2) What setting should I have on FCP with regards to screen size ? The converted clips are 1280x720. When I choose this setting on the sequence, I end up with small black bars left and right of the video on the canvas ???
    3) I will also later have to add some digi beta footage which will be PAL, 720x576 Anamorphic.
    4) What is the best resolution for me here ?
    5) And will the quality of the original m2t file be downgraded by the mpeg streamclip ?
    Thanks so much for your help
    All the best
    Simon

    HDV isn't an "edit-friendly" format, meaning: HDV uses inter-frame compression, combined with a long group-of-pictures (GOP) of 15 frames (12 frames in PAL-equivalent). In intra-frame compression (as in DV, DVCPRO HD, etc.), each video frame is a complete image that stands alone. Inter-frame compression (which is also used in DVDs) uses only a limited number of complete image frames, the GOP determines that number. So, in HDV for example, with a GOP of 15 frames, 1 second of 30fps video contains only 2 complete frames, while the other 28 frames are determined by calculations used in conjunction with the Bi-directional ('B') and Predicted ('P') frames, which contain partial information on the changes in the video in between the 'I' frames which contain whole images. This process, of course, requires much more computer processing power than when editing DV, DVCPRO HD, Uncompressed, etc.
    Editing video streams such as HDV (and XDCAM HD) is made difficult by the reduced number of I-frames. For example, if you make a cut in between the I-frames in the video clip, the computer has to then recalculate new I-frames that are placed at both sides of the cut. Converting on capture/after import to an intra-frame codec like DVCPRO HD, ProRes 422, or Uncompressed will reduce processing power and increase real-time performance, as well as give better performance when adding effects and performing compositing like chroma-keying.
    A common rule of thumb in professional applications is to acquire in HDV, XDCAM HD, etc., but capture and edit in DVCPRO HD, ProRes 422, or even Uncompressed. Native HDV editing is not taboo by any means; it's just not as easy or robust -- especially with the LONG render times. Depending on what kind of work you do (and of course personal preference), you may not see much benefit by transcoding to another format.
    Are you suggesting i have to convert each clip after capture?
    Unless you have an HDV deck with HD-SDI and a capture card, you would have to convert each clip. Batch-conversion would be very useful for that.
    Hope that helps.
    tim

  • A simple question about DAQ data sampling

    Hi all:
    Now I meet a very basic question about DAQ sampling.  I am using NI PCI-6040E DAQ card, SCXI-1001 chasis, SCXI-1102, SCXI1300 terminal block, and SCXI1160 relay module.
    I am not sure , is it possible if I want to test a voltage (1 volt) on a resistor. Now I am connecting the Ch0+ to resistor+ (24 volt), and connecting Ch0- to resistor-(23 volt). So the voltage between resistor+ and resistor- should be 1volt.  Actually, It is working at the first, but after I want to test 9 channels based on this connection. The Measurement & Automation can't read data from the DAQ card. (when I test it by multimeter, I can get the voltage data on the Ch0+ and Ch0- of SCXI1300 terminal block).
    That's strange, does anybody know what' s wrong about it?/
    Thanks a lot

    Hi hanwei,
    According to the specifications of the PCI 6040E (page 3), the input signal and common mode voltage should never exceed 11V from ground.  I believe this is the reason you are able to measure the potential of a battery but not the 24V signal (even though the differential value is only 1V). 
    Best Regards
    Hani R.
    Applications Engineer
    National Instruments

  • Just simple question about java HTTP session mechanism...

    I have one simple question regarding the java HTTP Session Mechanism.
    1) Is there another alternative for the HTTP Session ? If have, what the alternative?
    2) I have been acknowledge that HTTP session is same as cookie system and others say have many different, where is the different..
    thanks

    1) You can always do your own session handling. But why bother when there is one there for you?
    2) The issue with sessions is how to identify the user from the request. Each session gets given a session id. The user has to send that session id with every request they make.
    The standard way is to use a session cookie, which only lasts as long as the browser session. The cookie with the JSESSIONID is sent with every request, thus the server can identify which session a user is in from their cookie.
    Of course you cannot assume that the browser will support cookies, so you need to encode all URLs with the method response.encodeURL(). That method puts the session id into the URL if the browser does not support cookies, or they have them switched off.

  • Simple question about integrating .AS file into flex3 code

    I'm sure this is extraordinarily easy for most people, but I
    can't figure it out ... nada, zilch ...
    I have this file (
    Optimized
    Perlin Noise File), and I'm trying to include it/make it
    available in my flex3 code. I just can't get the namespace/import
    code right, and I'm not sure - because of the namespace - if I'm
    supposed to put this file in a collection of sub-folders (something
    like: nl/ronvalstar/math ...). The end result is me being able to
    replace the BitmapData.perlinNoise method with an optimized version
    for real-time cloud generation.
    If somebody could provide the code to get this file
    integrated I'd be grateful.
    Thanks :)

    "January_jsd" <[email protected]> wrote in
    message
    news:g8ptaq$jp3$[email protected]..
    > I'm sure this is extraordinarily easy for most people,
    but I can't figure
    > it
    > out ... nada, zilch ...
    >
    > I have this file (
    http://www.quasimondo.com/examples/OptimizedPerlin.as),
    > and
    > I'm trying to include it/make it available in my flex3
    code. I just can't
    > get
    > the namespace/import code right, and I'm not sure -
    because of the
    > namespace -
    > if I'm supposed to put this file in a collection of
    sub-folders (something
    > like: nl/ronvalstar/math ...). The end result is me
    being able to replace
    > the
    > BitmapData.perlinNoise method with an optimized version
    for real-time
    > cloud
    > generation.
    >
    > If somebody could provide the code to get this file
    integrated I'd be
    > grateful.
    http://flexdiary.blogspot.com/2007/08/as3-basics.html

  • Simple question about custom tags really easy!!

    I am trying to make my own custom tags, so far i have created simple one that have i use for heading or to set the page layout for a jsp page, My question is I want to make a custom tag with a body , with a start and end tag can anybody give a simple example of a custom tag which has a body.
    I do not mean write me a tag i mean what could a tag with a body be used for? Can you give me some example of what a tag of this kind could do?

    Thanks having read that and some other pages i have another question:
    would it be possible to put the following code into a custom tag so that i can pass in a list and have it output it to a table?
    <TABLE >
    <% 
    out.println("<TABLE >\n" +
                    "<TR BGCOLOR=\"#FFDDAA\">\n" +
                    "  <TH>ID Number\n" +
                    "  <TH>Artist\n"
    Iterator it = pricePassed.getpricePassed().iterator();
    while( it.hasNext() ){
       MySite.VideoBean vids = (MySite.VideoBean) it.next();
       out.println( "<TR>\n" +
                   "<TD><Center><B>" + vids.getRecId() + "</TD>" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
    %></TABLE>At the moment i use the above in a jsp to put data into a table, would it be a massive task to undertake to put into a custom tag?

Maybe you are looking for

  • Schedule 3 reports to one xls fil????e

    hi all..... using ibots i have scheduled 3 reports which are present on my dashboard. i want all these 3 reports to be saved as .xls under 3 sections but under a common excel file.. how can this be achieved??? regards mahi Edited by: Mahis on Dec 27,

  • How to fix "error loading operating system"

    My pc becomes lag and i did defrag the c driver. it took almost 2 hours, so i stopped it. after i restart my pc back, there was a message "error loading operating system". anyone can help me? please im stuck.... i cant do anything and i can access to

  • Botched update, grey screen telling me to restart. pls help.

    i have a botched update guys, Macbook4 Mac-F22788A9, a hand me down unit with a dead battery, was running fine til I tried updating it and then accidentally tripped over the Magsafe and now this... grey screen with kernel panic hoolabaloos (sorry, i

  • Help with initializing/sending a contact form

    Hi guys. Basically, I created a standard HTML webpage(s) in Dreamweaver (this form is on a HTML file, not a PHP file). I have a form in there (at the footer of all my webpages), and it looks like this:   <div id="form">             <form action="PHP/

  • Clipboard Handling ... font is not retained

    I do this same project at the end of each year, and this was not a problem with InDesign last year.  When I copy Arial 13pt text in Excel 2011 (Mac) and paste into the current version of InDesign CC, the font styling is lost.  InDesign converts the t