SQL

posted by .

1- A SQL statement is needed to create a stored procedure that has one input parameter of data type int. The stored proc selects the supplierId field and the total, or sum, of all Count field values for each group of supplierId fields from the Part table. The Part table was defined in the assignment of week 3. Only rows with their Count total, or sum, greater than the value specified in the input parameter should be returned. Hint: Each returned record has a unique SupplierID value, since we are dealing with groups.


2- A SQL statement is needed to create a stored procedure, which adds a new record to the Part table of week 3. The stored proc returns an out parameter that contains the value of the PartID PK of the record just added. Input parameters are needed to pass the field values of the record to be added. Keep in mind that the PK field in the Part table of week 3 is an idendity field, which SQL Server creates values for. The identity PK field is managed by SQL Server.


3- A SQL statement that creates a user defined function that returns an int value is needed. This int return value is obtained by deducting the lowest Count field value from the highest Count field value of the Part table. You should enter sample test records in the Part table for testing this function in SQL Server.


4- An Update trigger on the Part table is needed, which raises an error string if the Count field of the updated row has a higher value than the value prior to the Update. In other words, the new value cannot be larger than the older value. If the trigger fires and after the error string is displayed, the Update operation should be rolled back. The exact text of the error string is up to you to define.

  • SQL -

    If you are working on PL/SQL (from Oracle), you can specify it.

    In addition, you need to specify what your proposed solution is, and what difficulties you are encountering.

    To be able to help you, we also need the specifications of the Part Table, name/type of the fields, size, etc.

  • SQL -

    MrMath, please do not post aany answers to this question. My daughter, thinking she would help me with hoemwork posted this. I appreciate your time but do not need any assistance as I have a good understanding of the material. I have asked the site to delete this post. Sorry for wasting your time.

  • SQL -

    ok, no problem.

  • SQL -

    Thank you sir:)

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Database Management

    your projects should contain the following: 1. write a prosa text for a domain of your own (maximum 1 A4 sheet of paper) 2. model this text in form of an EER diagram or UML class diagram 3. create a SQL script for building all tables …
  2. sql

    By using this table below I need to Write a SQL statement that creates a stored procedure with one int input parameter. The stored procedure selects the supplierId field and the total of all Count field values for each group of supplierId's …
  3. SQL for Business

    By using this table: CREATE TABLE Part ( Partid int IDENTITY PRIMARY KEY, Supplierid int NOT NULL REFERENCES Part (PartID), Description VARCHAR (25) NOT NULL, Count int NOT NULL, Class VARCHAR (5) NOT NULL, Inspection smalldatetime …
  4. 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 …
  5. SQL server help!

    A SQL statement is needed to create a stored procedure, which adds a new record to the Part table of week 3. The stored proc returns an out parameter that contains the value of the PartID PK of the record just added. Input parameters …
  6. SQL for business help

    I have no idea where to begin with this. A SQL statement that creates a user defined function that returns an int value is needed. This int return value is obtained by deducting the lowest Count field value from the highest Count field …
  7. SQL Server

    I have created a Database called Business with the 2 tables as follows: dbo.Orders ID OrderID ItemName Quantity Price SalesID dbo.Sales SalesID FIrstName LastName OrderID I need to create a stored procedure to show all the data from …
  8. Computer Database SQL

    Update the data in the Employees table so that employees with the following managers are listed as working in the following departments: The UPDATE statement in SQL. I cant figure the statement, I keep getting syntax error. Help. ReportsTo …
  9. buissness

    Data Security Password protect the database you created for your individual assignment in Week Three. Create a matrix to indicate the permissions (read, insert, delete, modify) you would grant to different users of your database. Create …
  10. computer science visual basic

    I need help Application: Create a GeneratedNumber application that stores in an array with indexes 1 through 100 numbers generated by the index values when Generate is clicked. Generate the number to be stored at each index by summing …

More Similar Questions