



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
THESE ARE SOME BASIC DATABASE LABS ASSIGNMENT EASY FOR BEGINNERS..THEY CONTAIN OUPUT PICS AND CODE AS WELL
Typology: Lab Reports
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Define an ERD for the following narrative. The database should track homes and owners. A home has a unique homidentifier, a street address, a city, a state, a zip, a number of bedrooms, a number of bathrooms, and square feet. A home is either owner occupied or rented. An owner has a Social Security number, a name, an optional spouse name, a profession, and an optional spouse profession. An owner can possess one or more homes. Each home has only one owner.
Create entities Home and Owner. Include home identifier (Integer), street address (VarChar), city (VarChar), state (Char), zip (VarChar), bedrooms (Integer), bathrooms (Integer), square feet(Decimal). Make Home identifier as primaryKey. Include Social Security number(integer), name(varchar), spouse name (VarChar), a profession (Char), and spouse profession (varchar). An owner can possess one or more homes so maximum cardinality will be many and minimum will be optional. Each home has only one owner so Maximum and minimum cardinalities will be One and mandatory respectively. Name this 1-M relationship as owns. Diagram :
Procedure: Using inheritance, make Account as Parent entity having three sub entities checkingAcc, CreditCard, and Investment. Investment Further has two child entities Stock and MutuaFunds. Identify attributes of Accounts as account identifier(integer), account name (VarChar), date established (Date), and balance (Decimal). Make AccountIdentifier as PrimaryKey. Identify attributes of checking account as bank name (VarChar), bank address (VarChar), checking account number (Integer), and routing number (Integer). Identify attributes of credit card as credit card number (Integer), expiration date (Date), and credit card limit (Integer). Identify attributes of stocks as stock type (Char), last dividend amount (Integer), the last dividend date (Date), exchange (Decimal), last closing price (Integer), and number of shares (Integer). Identify attributes of mutual funds as share balance (Integer), fund type (VarChar), last closing price (Integer), region (Char), and tax-exempt status(Boolean). Diagram: