Write a statement to create a view that selects all fields

Assignment Help PL-SQL Programming
Reference no: EM13947390

This must be done in SQL Server 2005.

In the first exercise, the Class field in the Part table should be a string of size 5, and not an int.

1- Write a statement that creates a table named Part, with an Id field as an int idendity primary key(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.

Reference no: EM13947390

Questions Cloud

Determine the addition to retained earnings : Balance Sheet as of December 31, 2013 (Thousands of Dollars) Cash $ 1,080 Accounts payable $ 4,320 Receivables 6,480 Accruals 2,880 Inventories 9,000 Line of credit 0 Total current assets $16,560 Notes payable 2,100 Net fixed assets 12,600. Use the f..
Create a list of 10 web design standards with your cluster. : To create this list, discuss the standards on each site and determine the 10 your cluster feels to be the most appropriate for effective Web design.
Develop an application for lapland uas : Description of the project Your duty is to plan and develop an application for Lapland UAS - Database plan and description
Induction heating coil experiences uniform volumetric : A very long rod of 5-mm diameter and uniform thermal conductivity k = 25 W/m · K is subjected to a heat treat- ment process. The center, 30-mm-long portion of the rod within the induction heating coil experiences uniform volumetric heat generation..
Write a statement to create a view that selects all fields : 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.
Explain decision maker go get information future cash flows : As you continue your discussions on other capital budgeting considerations, please explain where would a decision maker go to get information about future cash flows for a proposed project? Examples to illustrate your points are greatly appreciated..
What was the amount of cash paid in taxation during year two : The tax liability in the statement of financial position at the end of Year 2 was £10m. What was the amount of cash paid in taxation during Year 2?
Actual thermal conductivity of the carbon nanotube : Physicists have determined the theoretical value of the thermal conductivity of a carbon nanotube to be kcn,T = 5000 W/m · K. (a) Assuming the actual thermal conductivity of the carbon nanotube is the same as its theoretical value, find the thermal..
What is the percent change in the multifactor productivity : What is the companys labor hours productivity and what is its multifactor productivity - What is the percent change in the multifactor productivity if the initial process used is the one without the rework capability and is then replaced by the pro..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd