Design a schema for a part of a package delivery company, which contains information about packages (PkgId, AddresseeId), addressees (Id, Name, StreetNumber, StreetName, City), and streets (StreetName, City, MinHouseNumber, MaxHouseNumber). Show the primary and foreign keys. Indicate the NOT NULL constraint wherever applicable.

What will be an ideal response?



CREATE TABLE Package (
PkgId INTEGER,
AddresseeId CHAR(20) NOT NULL,
PRIMARY KEY (PkgId)
FOREIGN KEY (AddresseeId) REFERENCES Addressee (Id)
)
CREATE TABLE Addressee (
Id CHAR(20),
Name CHAR(20) NOT NULL,
StreetNumber INTEGER NOT NULL,
StreetName CHAR(40) NOT NULL,
City CHAR(20) NOT NULL,
PRIMARY KEY (Id)
FOREIGN KEY (StreetName,City) REFERENCES Streets
)
CREATE TABLE Streets (
StreetName CHAR(40),
City CHAR(20),
MinHouseNumber INTEGER NOT NULL,
MaxHouseNumber INTEGER NOT NULL,
PRIMARY KEY (StreetName, City)
)

Computer Science & Information Technology

You might also like to view...

Which of the following Python Standard Library modules offers additional data structures beyond lists, tuples, dictionaries and sets?

a. sys and statistics b. collections c. queue d. b) and c)

Computer Science & Information Technology

(IntegerSet Class) Create class IntegerSet for which each object can hold integers in the range 0 through 100. Represent the set internally as a vector of bool values. Element a[i] is true if integer i is in the set. Element a[j] is false if integer j is not in the set. The default constructor initializes a set to the so-called “empty set,” i.e., a set for which all elements contain false.

Provide member functions for the common set operations. For example, provide a unionOf- Sets member function that creates a third set that is the set-theoretic union of two existing sets (i.e., an element of the result is set to true if that element is true in either or both of the existing sets, and an element of the result is set to false if that element is false in each of the existing sets). Provide an intersectionOfSets member function which creates a third set which is the set- theoretic intersection of two existing sets (i.e., an element of the result is set to false if that ele- ment is false in either or both of the existing sets, and an element of the result is set to true if that element is true in each of the existing sets). Provide an insertElement member function that places a new integer k into a set by setting a[k] to true. Provide a deleteElement member function that deletes integer m by setting a[m] to false. Provide a printSet member function that prints a set as a list of numbers separated by spaces. Print only those elements that are present in the set (i.e., their position in the vector has a value of true). Print --- for an empty set. Provide an isEqualTo member function that determines whether two sets are equal. Provide an additional constructor that receives an array of integers and the size of that array and uses the array to initialize a set object. Now write a driver program to test your IntegerSet class. Instantiate several IntegerSet objects. Test that all your member functions work properly. What will be an ideal response?

Computer Science & Information Technology

User agents are able to read XML data quickly because XML data has a specific ____.

A. structure B. filename C. size D. type

Computer Science & Information Technology

Some machine-local groups are similar in usage and membership to domain local groups. These types of local groups do not exist in AD DS and grant users access to resources on the local computer only

Indicate whether the statement is true or false

Computer Science & Information Technology