Thursday
April 17, 2014

Homework Help: SQL

Posted by adesola on Monday, May 10, 2010 at 3:48pm.

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.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

SQL for Business - By using this table: CREATE TABLE Part ( Partid int IDENTITY...
SQL - 1- A SQL statement is needed to create a stored procedure that has one ...
SQL server help! - A SQL statement is needed to create a stored procedure, which...
sql - By using this table below I need to Write a SQL statement that creates a ...
SQL for business help - I have no idea where to begin with this. A SQL statement...
Unix Shell script - Shell script Using "if" statement checks for a file called...
C code - //INSTRUCTIONS //Your parser will read from input.txt //input.txt ...
Unix Script - "Using "if" statement checks for a file called "student.txt" in ...
programming - b. Write a well-commented C++ program that reads data from the ...
Computer Database SQL - Update the data in the Employees table so that employees...

Search
Members