Professional Documents
Culture Documents
Q (1) - Draw Data Models For The Following Entities. in Case, Make Certain That You Show The
Q (1) - Draw Data Models For The Following Entities. in Case, Make Certain That You Show The
Q (1) - Draw Data Models For The Following Entities. in Case, Make Certain That You Show The
Answer:
Data modeling helps us to understand the structure and meaning of data, which is necessary
before a database can be created. A data model is a graphical description of the components of
a database. One of these components is an Entity, Entities are things in the environment about
which we wish to store information. An Entity has characteristics or attributes. An Attribute
describe an entity contains the entity’s data we want to store. An entity must have a unique
Identifier, an attribute that uniquely identifies an instance of an entity is called an Identifier.
Conventions for drawing a Data model are :
Should use an uppercase for entity name where as attributes should be in lowercases
Identifiers is marked with * symbol
Q(1)a. Aircraft: An aircraft has a manufacturer, model number, call sign(e.g., N123ID), payload,
and a year of construction. Aircraft are classified as civilian or military.
Data Model:
AIRCRAFT
*callsign
manufacturer
modelnum
payload
manufactyear
aircrafttype
Entity: AIRCRAFT
Identifier: callsign
Q(b). Car: A car has a manufacturer , range name, and style code (e.g., Honda Accord Dx, where
Honda is the manufacturer, Accord is the range, and DX is the style). A car also has a vehicle
identification code, registration code, and color.
Data model:
CAR
*vin
car rangename
car stylecode
car registrationcode
car color
Entity: CAR
Attributes:, vin, car rangename, car stylecode, car registrationcode, car color.
Q(c). Restaurant: A restaurant has an address, seating capacity, phone number, and style of
food(e.g., French, Russian, Chinese).
Data model:
RESTAURANT
*restid
restname
resttype
restcap
restphone
reststreet
restcity
reststate
restzip
Entity: RESTARANT
Identifier: restid
Q(d). Cow: A dairy cow has a name, date of birth, breed(e.g., Holstein), and a numbered plastic
ear tag.
Data Model:
COW
*cow eartagnum
cow name
cow dob
cow breed
Entity: COW
(c). List the names and prices of all shares with a price of at least $10.
(d). Create a report showing firm name, share price, share holding. And total value of shares
held.( Value of shares held is price times quantity.)
(e). List the names of all shares with a yield exceeding 5 percent.
(f). Report the total dividend payment of Patagonian Tea. (the total dividend payment is
dividend times quantity).
SELECT shrfirm ,shrdiv, shrqty, shrdiv*shrqty AS total div payment FROM shr
WHERE shrcode = ‘PT’;
(g). Find all the shares where the price is less than 20 times the dividend.
(i). Find the total value of all shares with a PE ratio > 10.
(j). Find the share with the maximum total dividend payment.
(l). Find the yield of all firms except Bolivian Sheep and Canadian Sugar.