In the recent decades data has indeed become one of the most valuable assets for government institutions, private businesses, and individual persons. Nowadays almost any software, from social networks and dating mobile applications to large information systems and analytical services for enterprise management, accumulates, stores, and processes data to solve certain problems in their subject areas. Extremely large data volumes are organized in databases that are used as the baseline for almost all of modern software applications. As the most important components of software systems, databases should be carefully designed, since drawbacks at the stage of requirements elicitation may result in exponential growth of defects fixing costs at testing and maintenance phases. Therefore, we propose an approach and software tool to database schema generation from textual requirements also known in database design domain as business rules.
This may help database designers to rapidly obtain usable database schemas in order to detect and fix defects as early as possible. Moreover, proposed solution may simplify the database design process, since database creation scripts are generated from business rules directly. Thus, instead of coding all the required statements, engineers are only need to check obtained schema and make certain adjustments to data types, unique attributes, or used naming style. This tool considers relational model and relational databases, since they are most widely used nowadays.
Attributes: Each entity name has attribute, attribute, ..., attribute.
e.g.: Each student has full name, student card id, birth date, enrollment date.
Relationships: (Each | Some) entity name is relationship description (one | many) entity name.
e.g.: Each student is given by many score.
When buying food, it is important to make sure it is fresh and not expired. You are given the following 'Products' list. Write a query to select the ProductName, ProductionDate and ExpirationDate. Use the SELECT statement and separate the required columns by commas.
A local bakery creates unique cake sets. Each cake set contains three different cakes. Here is the cakes table. Today a customer want a cake set that has minimal calories. Write a query to sort the cakes by calorie count and select the first 3 cakes from the list to offer the customer. Try to combine ORDER BY and LIMIT keywords.
You want to rent an apartment and have the following table named Apartments. Write a query to output the apartments whose prices are greater than the average and are also not rented, sorted by the 'Price' column. Recall the AVG keyword.
You manage a zoo. Each animal in the zoo comes from a different country. Here are the tables you have: Animals and Countries. 1) A new animal has come in, with the following details: name - "Slim", type - "Giraffe", country_id – 1 Add him to the Animals table. 2) You want to make a complete list of the animals for the zoo's visitors. Write a query to output a new table with each animal's name, type and country fields, sorted by countries. Recall INSERT and INNER JOIN keywords.