In Week 5 as we start analysis and design for our group project, we touch on basic concepts for Databases
Domain Model: In Software Design, the Domain means the sphere of knowledge specific to the business for which the software is being developed. During design, we usually define a model that abstracts each relevant domain entity and its attributes. Example: to develop a system for managing classes and enrollment at a school, the domain model might include entities for Student, Course, Faculty, etc. The model would need to define the relationships as well
Relationships:
- One to Many: Example: Course to Section – Each Course can have multiple Sections; a Section belongs to only one Course.
- Many to Many: Example: Section to Student -Each Section can have many Students; each Student can enroll in many Sections
- One to One: Example: Faculty to Salary. All columns pertain to just one Faculty member, but may be separated into two tables for security reasons. Or may be in one table with defined Views controlled by permissions
Database: a structured repository for persisting information (data!). In Web Development, the information a user enters into a form and submits is stored in a database if it will need to be retrieved at a later time. Lists and Detail views of items on a Web Page are often populated by look-ups to the database.
- Table: a set of data records for a single type of entity (a thing relevant to the domain being modeled) organized into rows and columns. Example: Student table would represent the Student entity within a domain model for a School system.
- Row: stores one particular record in a table; example: each Student has her own row
- Column: each column represents a single Attribute of the thing being represented in the table; e.g. FirstName, LastName, DateOfBirth
- Primary Key: unique identifier for a row in a table; e.g., CourseID for the Course table
- Foreign Key: a value in a table that links it to another table. Used in One-to-Many relationships, e.g., the Section table would have a CourseID column
SQL: Structured Query Language. Allow us to query the database to retrieve information and to modify the tables and their data using CRUD operations
CRUD: Commonly used acronym for Create-Read-Update-Delete; refers to the types of operations allowed against a database
Learn more about SQL and Try it Out at: W3 Schools SQL Tutorial