How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask TheDoctor Your Own Question

TheDoctor
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1590
Experience:  M.S. in Internet Information Systems
59032869
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Help needed with SQL programming.

Resolved Question:

I have already done the first eight questions, so no need for those.  Just need the query statements in a text file is all.  Thanks a lot for your help.


 


 


 


 


1.   Create an ORDERS_(your initials) table based on the following:.


 


 


            ORDID                                         NOT NULL          NUMBER(4)   


            ORDERDATE                                                            DATE


            COMMPLAN                                                             VARCHAR2(1)    


            CUSTID                                        NOT NULL          NUMBER(6)      


            SHIPDATE                                                                 DATE


     


 


 


 


 


 


           


 


2.   Create an INVOICE table based on the following:


 


 


 


 


 


 


 


 


 


            ORDID                                         NOT NULL                      NUMBER(4)


            ITEMID                                         NOT NULL                     NUMBER(4)


            DESCRIPTION                            NOT NULL                      VARCHAR2(20)    


            PRODID                                                                                 NUMBER(6)


            ACTUALPRICE                                                                    NUMBER(8,2)


            QTY                                                                                        NUMBER(8)


            ITEMTOT                                                                               NUMBER(8,2)


 


3.   Modify the INVOICE table to allow for longer DESCRIPTION names.


 


             


4.  Create an INVOICE_2 table from the INVOICE table using a select statement.


 


5



      Rename the INVOICE_2 table to INVOICE_3.


 


6.   Add a comment to the INVOICE_3 table definitions describing the tables.


 


7. Drop the ITEMID  column from the INVOICE table.


 


8. Create an INVOICE_4 table using a subquery based on the structure of the INVOICE table. Include only the  ORDID, DESCRIPTION, PRODID and QTY columns. Name the columns in your new table INV ID, DESCRIPT, PROD ID and QUANTITY, respectively.


 


 


 


 


9.  Add a first row of data to the INVOICE table with data of your own choosing. Do not list the columns in the INSERT clause.


           


10


 


 


 


 


 


 


.  Populate the INVOICE table with the sample data.  You are to create the values to enter into the table.  This time, list the columns explicitly in the INSERT clause.


 


 


ORDID, DESCRIPTION, ITEMID, ACTUALPRICE, QTY, ITEMTOT,                                PRODID                                                                                                     


  


 


11.  Create a script named LOAD_DATA_(your initials).sql to load rows into the INVOICE table interactively. Prompt the user for the values .   Specify a default value for the QTY.


           


12.  Populate the table with the four  rows of sample data by running the script that you created. 


 


 


13.  Change the value for one of the DESCRIPTIONS.


 


14.  Create a PRIMARY KEY constraint on the INVOICE table using the ORDID column. The constraint should be named at creation as a named table level constraint.


 


15.  Add a named table level foreign key reference on the INVOICE table that will ensure that the PRODID is not assigned to a nonexistent PRODUCT.


 


16. 


Modify the INVOICE_3 table. Add an ORD_DATE column of DATE datatype.


 


17.  Modify the INVOICE  table. Add a CHECK constraint to prevent any ACTUALPRICE greater than what you think is a reasonable level.


 


18.  Modify the INVOICE table by making one of the columns NOT NULL.


 


 


19.  Create a view called INVOICE_View based on four columns in the INVOICE   table.   Use SQL*PLUS formatting commands to create column headings for the four columns.


 


20


.  Using your view INVOICE_View, enter a query to display values for three of the four columns included in the view.

Submitted: 1 year ago.
Category: Homework
Expert:  TheDoctor replied 1 year ago.
Hello and thank you for your question. It would be my pleasure to assist you.

What database management system are you using? (e.g., SQL Server, MySQL, Oracle)

Thank you
Customer: replied 1 year ago.

I'm using sqlplus but they only need to be written out in a text file, no return results are needed. I've actually already done the first 12 on the list, so you would only need to answer 13 through 21. I can send you the text file of what I have so far so you can see the format.

Expert:  TheDoctor replied 1 year ago.
SQLPlus is a client application, not a database management system. You use to connect to a database, usually Oracle. So I assume the DBMS that you are using in class is Oracle?

In your original question, you only posted 20 questions. There is no 21. Please post the 21st question.

Additionally, please send me your work. If you did anything wrong, then the following queries that I wrote will also be incorrect. I can also fix anything that you may not have done correctly.

You can upload your document to http://ge.tt

Once uploaded, you will be given a link on the right. Click on the 'Copy Link' option and then paste it here.

Thank you
Customer: replied 1 year ago.

Yes it is Oracle.


 


Here is the link.


 


http://ge.tt/3ym85Hs/v/0


 


Here is question 21.


 


Create a view named INV_VIEW_QUERY that does not allow an invoice DESCRIPTION to be changed through the view.

Expert:  TheDoctor replied 1 year ago.
Thank you. I will contact you once this is complete.
Customer: replied 1 year ago.

Thank you, XXXXX XXXXX be able to finish tonight?

Expert:  TheDoctor replied 1 year ago.
Yes, it will. The file you sent me does have a few mistakes in it. So I am fixing those and then I will complete the remaining questions and send you the results.
Expert:  TheDoctor replied 1 year ago.

Hello again Matt,

Based on Question 15, this is to be completed on an existing database. It states that you are to create a foreign key to products. Since the product table was not created in this assignment, it must already exist.

Please let me know what the columns in the product table are.

Customer: replied 1 year ago.

It says the product table was non existent. There should not be anything based on an existing table as the assignment was expected for me to just write the queries in a text file and send. Did not have to be done on a putty server or in a Oracle database. Hope this helps. If all else fails just skip question 15 if you have too.


 

Expert:  TheDoctor replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1590
Experience: M.S. in Internet Information Systems
TheDoctor and 4 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Thank you very much. SQL is definitely not my area of expertise but still needed to take the course. Thanks again for your time and also for explaining what I was doing wrong. Have a great day.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

    1781
    3,000+ satisfied customers, all topics, A+ work
 
 
 
Chat Now With A Tutor
TheDoctor
TheDoctor
Software Engineer
738 Satisfied Customers
M.S. in Internet Information Systems