SQL

Due today
Submit a text file (extension .txt).

1- Write a statement that creates a table named Part, with an Id field as an int idendity PK, a SupplierId int field, a Description string field of size 25, a Count int field, a Class string field of size 5, and an inspection small date field. All fields cannot have a value of null, and the SupplierId field should be an FK that references the PK of a Supplier parent table.

2- Write a satement to add a check constraint to the above defined table, which guarantees that values entered in the inspection small date field are not older than today, meaning from now on. According to new requirements from your business analyst, an inspection can only be scheduled in the future.

3- Write a statement to add a check constraint to the above defined table, which guarantees that values entered in the Count field are never less than zero.

4- Write a statement to add a check constraint to the above defined table, which guarantees that values entered in the Class field can only be limited to the following strings: Open, Spec, and Priv.

5- Write a statement to create a view that selects all fields from the above table, except for both Id fields, in addition to the supplier name field of the Supplier table referenced in question 1. Note that the user is only interested in Parts that are not of class Priv. In other words, parts of class Priv should not be returned. Hint: A JOIN must be used to only return common rows.

  1. 👍
  2. 👎
  3. 👁
  1. What kind of HELP do you need? You need to be specific when asking questions here.

    If all you do is post your entire assignment, nothing will happen since no one here will do your work for you. But if you are specific about what you don't understand about the assignment or exactly what help you need, someone might be able to assist you.

    1. 👍
    2. 👎
  2. 1- Try:
    SELECT Id, SupplierID, Description, Count, Class, inspecton
    INTO Part FROM Supplier;

    You will need to describe the table structure ahead of time.

    For the rest, give it a try and post what you have, and what the problem is, if any.

    1. 👍
    2. 👎

Respond to this Question

First Name

Your Response

Similar Questions

  1. Writing

    Write 1-2 paragraphs explaining Why electronic file organization is a key skill for today’s workplace? You may use a scenario from your current and/or future workplace where file organization and file sharing would be a critical

  2. American government check my answer

    Statement 1 – Illegal immigrants who have resided in the United States for years should qualify for alternative paths to citizenship. Statement 2 – Diversity in backgrounds and experience creates a society that teaches

  3. Emergent computer tech.

    1. What file is being called by this IMG tag? (1 point) answer= SRC 2. What type of link is used to call this file? (1 point) answer=need help with this one 3. If the user loads this graphic in a text-only browser how will the

  4. History

    Statement 1-Immigrants should make every effort to adapt to their new country, including adopting cultural norms and traditions. Statement 2-Diversity in backgrounds and experience creates a society that teaches tolerance and

  1. Safety

    Is you feel that an OSHA inspection is need to get hazards corrected at your work place, which is your best option? A- file a complaint online B- submit a written, signed complaint with a specific hazard information C- request a

  2. La

    What is a main idea? (1 point) a lesson that is not stated in a text an action that leads to the main event in a text a short statement of the main events of a text a concept introduced in the middle of a text my answer: a short

  3. LANGUAGE ARTS

    HELP PLEASE What does a bibliography list? Select the two correct answers.(1 point) all of the facts used in a specific text information about sources others can use to find them sources the author used to write the text how long

  4. computer

    Rachel has completed her assignments and wants to email her file to her instructor . She wants to rename her file according to the naming convection of her course . Which function key will help her rename the file .

  1. math - modular arithmetic

    In the statement below, the two blanks can be filled by positive single-digit numbers in such a way that the statement is always true: $$\text{If }2x\equiv y+5\ (\bmod\ 9)\text{, then }x\equiv \underline{\ \ \ }\,y+\underline{\ \

  2. c programming

    Write a program to read from a file called "input.txt" information about 5 workers. Each line would contain two values respectively, an employee ID and the employee's monthly salary. Assume that the data from the input file is

  3. Ed. Tech

    When you save documents, it is important to check the blank at the top of the navigation window to ensure you are saving your file in the correct location. A. address bar B. insert ribbon C. file type D. file name Is the answer D?

  4. window XP

    Which of the following is true of the Encrypting File System (EFS)? a. The Encrypting File System provides encryption for data files stored locally using the file systems supported by Windows XP Professional. b. If the file owner

You can view more similar questions or ask a new question.