The document discusses a database design for a real estate management system. It identifies six tables - users, property categories, properties, auctions, bids, and chats. It specifies the key fields for each table, identifies the relationships between tables through foreign keys, and fully describes the database design.
The document discusses a database design for a real estate management system. It identifies six tables - users, property categories, properties, auctions, bids, and chats. It specifies the key fields for each table, identifies the relationships between tables through foreign keys, and fully describes the database design.
Q Relational model represents how data is stored in relational databases. a) Discuss relational database in brief. → A relational database (RDB) is a grouping of various data sets that are arranged by tables, records, and columns. Between database tables, it provides a clear connection. With the use of tables, data can be searched for, organized, and reported on more easily. → An easy-to-understand method of displaying data in tables, the relational model is the foundation of relational databases. In a relational database, each row in the table represents a record with a unique ID known as the key. Each record typically includes a value for each characteristic, which makes it simple to determine the links between data points. The columns of the table carry the attributes of the data. → Relational Database make use of Structured Query Language (SQL), a common user application that offers a simple programming interface for database access.
b) Discuss properties of relational databases.
→ A relational database is a collection of data items that have links between them that have been specified in the database. These connections allow the database to organize the data in a structured format. These objects are organized in the form of a series of tables, and each table includes columns and rows that make up its structure. Tables are the locations in a database where data relating to the entities that are going to be represented may be found. → Relational databases are known for having the following properties: i. The data are presented in the form of a set of relationships. ii. To ensure that the data in the database is correct and that it complies with the rules that have been established, entries are maintained in an atomic manner. iii. All of the values contained inside a column are assigned to a same data type regardless of their individual nature. iv. Each row has its own identity. v. The sequence in which the columns are presented is arbitrary. vi. The sequence in which the rows are presented is arbitrary. vii. Each column may be considered to have its own unique identity. Q Database design is the organization of data according to a database model. Determining the purpose of your database helps you prepare for the remaining steps. The process involves: Finding and organizing the information required, Dividing the information into tables, turning information items into columns, specifying primary keys, setting up the table relationships, refining your design, Applying the normalization rules. As a Database designer you are required to complete following design process and document it properly as a design document. You can choose the system of your interest and do the following task: a) Write the proposed database system description in brief. → As a database designer, I will be working on the Real Estate Management system. The system will allow owner/broker to list their property and buyer to bid and buy the property. For the proposed system, there will be 6 tables which are: user, property category, property, auction, bid, and chat. There will be 4 types of end-users: admin, owner, broker, and general user. The type of user will be differentiated using ‘role’ property of the user. A property will have its category related to the category table. When auction is started, user can bid on the product. At the time end, highest bid will win the auction. Also, general user can chat with the property listing user. Chats table will have message: with the text in message, status: whether the message is seen by the receiver, and ‘from’ & ‘to’ which are sender and receiver respectively. b) Identify at least five relations with required fields. → There are six relations which with required i. Categories • “category_id” => integer, auto incrementing • “category_name” => varchar • “category_description” => varchar ii. Users • “user_id” => integer, auto incrementing • “full_name” => varchar • “email” => varchar • “password” => varchar • “role” => varchar or enumeration • “address” => varchar iii. Properties • “property_id” => integer, auto incrementing • “property_title” => varchar • “property_description” => varchar • “minimum_price” => decimal float • “user_id” => integer • “category_id” => integer iv. Auctions • “auction_id” => integer, auto incrementing • “product_id” => integer • “auction_start_datetime” => datetime • “auction_end_datetime” => datetime • “winner_id” => integer v. Bids • “bid_id” => integer, auto incrementing • “auction_id” => integer • “user_id” => integer • “amount” => decimal float • “bid_datetime” => datetime vi. Chats • “chat_id” => integer, auto incrementing • “message” => varchar • “status” => integer or enumeration or boolean • “from_user_id” => integer • “to_user_id” => integer • “chat_datetime” => datetime c) Specify all the relationship keys of the relations. → The relationship keys for the given relations are: i. Categories • “category_id + category_name” is the super key • “category_id” is the candidate key and the primary key ii. Users • “user_id + full_name + email” is the super key • “user_id” is the candidate key and the primary key iii. Properties • “property_id + property_title” is the super key • “property_id” is the candidate key and the primary key iv. Auctions • “auction_id + auction_start_datetime + auction_end_datetime” is the super key • “auction_id” is the candidate key and the primary key v. Bids • “bid_id + amount + bid_datetime” is the super key • “bid_id” is the candidate key and the primary key vi. Chats • “chat_id + status + from_user_id + to_user_id + chat_datetime” is the super key • “chat_id” is the candidate key and the primary key d) Set up the table relationship by specifying foreign keys wherever applicable. → The table relationship has following foreign keys: i. Categories • Doesn’t have any foreign key ii. Users • Doesn’t have any foreign key iii. Properties • “user_id” is referencing to ‘users’ relation • “category_id” is referencing to ‘categories’ relation iv. Auctions • “winner_id” is referencing to ‘users’ relation • “product_id” is referencing to ‘products’ relation v. Bids • “auction_id” is referencing to ‘auctions’ relation • “user_id” is referencing to ‘users’ relation vi. Chats • “from_user_id” is referencing to ‘users’ relation • “to_user_id” is referencing to ‘users’ relation