Docsity

Relational Databases and SQL: Understanding Resources, Events, Agents and REA Approach - P, Study notes of Accounting

Toggle sidebar
bg1
Relational Databases and SQL
-REA approach makes sure that the system captures all the business events
-you can extract and analyze data through SQL
-REA (Resources, Events, Agents)
-SQL : a database query language used to construct and manipulate relational databases
-William McCarthy published a paper that outlined the REA approach, “a new way of thinking about acct
information”
-he was attracted by the E-R models capability to capture the meaning (semantics) of business
events more efficiently and effectively
-he classified business info into 3 types: resources, events and agents
-instance: one specific thing of the type defined of an entity…so the entity could be Employee and the
instance would be Dan and Misty
-an entity is represented as a table and the instances are represented as rows in the tables
-attribute: an item of data that characterizes an entity or relationship, ex: Name, address, phone
number
-attribute can include several different subattributes…ex: attribute is address, subattributes
would be house number, street, state, zip
-composite attributes: attributes that consist of multiple subattributes, ex: address
-attributes do NOT need to be broken down into the smallest possible units
-necessary that one or more attributes be identified so that the user can access the correct
entity
-key attribute: attribute whose value is unique for every entity that is in a database, used as
primary key
-most designers use coding to get key attribute
-databases include multiple entities
-the ease that a user can extract data from a database depends on the logical design of the database
-most common way to gather info about relationships among entities is to interview employees, NOT
just managers
-recursive relationship: a relationship b/t two different instances of an entity, represented by a
diamond
-DBMS include a feature that enforces max constraints which ensure that data are never entered that
connect more than one employee to a single work entry
-participation constraint: specifies the degree of min participation of one entity in the relationship with
another entity, minimum can be zero or one
-cardinality with participation constraint is shown as (min, max), it provides more info but is used less
frequently
-objective of REA model is to integrate the data in way that allows mgt and other users to access the info
they need to perform effectively
-REA models continue to grow with an explosion of entities and relationships
-relational database driven systems are in large organizations
-legacy systems: systems that have existed in a company for a long period of time and developed using
an organizations previous computer hardware and software
-relational databases are perceived as a collection of tables
-relation: a collection of data representing multiple occurrences of a resource, event or agent
-rows are tuples (a set of data that describes a single instance of an entity represented by a relation)
-ordering of tuples is not important in relational databases
-each tuple must be distinct from all other tuples
pf2

Partial preview of the text

Download Relational Databases and SQL: Understanding Resources, Events, Agents and REA Approach - P and more Study notes Accounting in PDF only on Docsity!

Relational Databases and SQL

-REA approach makes sure that the system captures all the business events -you can extract and analyze data through SQL -REA (Resources, Events, Agents) -SQL : a database query language used to construct and manipulate relational databases -William McCarthy published a paper that outlined the REA approach, “a new way of thinking about acct information” -he was attracted by the E-R models capability to capture the meaning ( semantics) of business events more efficiently and effectively -he classified business info into 3 types: resources, events and agents

  • instance: one specific thing of the type defined of an entity…so the entity could be Employee and the instance would be Dan and Misty -an entity is represented as a table and the instances are represented as rows in the tables
  • attribute: an item of data that characterizes an entity or relationship, ex: Name, address, phone number -attribute can include several different subattributes…ex: attribute is address, subattributes would be house number, street, state, zip
    • composite attributes: attributes that consist of multiple subattributes, ex: address -attributes do NOT need to be broken down into the smallest possible units -necessary that one or more attributes be identified so that the user can access the correct entity
    • key attribute: attribute whose value is unique for every entity that is in a database, used as primary key -most designers use coding to get key attribute -databases include multiple entities -the ease that a user can extract data from a database depends on the logical design of the database -most common way to gather info about relationships among entities is to interview employees, NOT just managers
  • recursive relationship: a relationship b/t two different instances of an entity, represented by a diamond -DBMS include a feature that enforces max constraints which ensure that data are never entered that connect more than one employee to a single work entry
  • participation constraint: specifies the degree of min participation of one entity in the relationship with another entity, minimum can be zero or one -cardinality with participation constraint is shown as (min, max), it provides more info but is used less frequently -objective of REA model is to integrate the data in way that allows mgt and other users to access the info they need to perform effectively -REA models continue to grow with an explosion of entities and relationships -relational database driven systems are in large organizations
  • legacy systems: systems that have existed in a company for a long period of time and developed using an organizations previous computer hardware and software -relational databases are perceived as a collection of tables
  • relation: a collection of data representing multiple occurrences of a resource, event or agent -rows are tuples (a set of data that describes a single instance of an entity represented by a relation) -ordering of tuples is not important in relational databases -each tuple must be distinct from all other tuples

-primary key is specified to identify each tuple in the relation -columns are attributes which are often called fields

  • candidate keys: additional attributes are secondary keys Key attributes are required to be non null, meaning they must have a value
  • null: a missing value
  • referential integrity: for every attribute value in one relation that has been specified to allow reference to another relation, the tuple being referenced must remain -if someone were to erase a tuple with referential integrity restraint on then the constrait would require you to reassign the attributes to another tuple before deleting it -an arrow represents the referential integrity constraints, the destination of the arrow is the attribute the must be controlled to achieve referential integrity SQL: a powerful database language used to define database systems, query the database, generate reports, and access data by using SQL commands -SQL is a survival tool -SQL was first introduced as a Structured English Query Language (SEQUEL) -delete a table with the DROP command DROP TABLE [table name] -data can be changed in a database by…
    1. INSERT command: to add a single tuple to an existing relation, but first you must use the CREATE command to generate the structure of the table
    2. DELETE command: one of the weaknesses of SQL because it doesn’t enforce referential integrity
    3. UPDATE: used when you want to change one or more attribute values for one or more tuples in a table -queries are driven by SELECT commands -SELECT command consists of…
    4. a list of attributes you want to select
    5. a list of tables where the attributes can be found
    6. a where clause that sets the conditions under which attribute values are to be retrieved -we use connectors such as AND to link multiple conditions that must all be met when selecting tuples from one or more tables, OR is another type of connector
  • ad hoc means as needed -we can create views of data that look like additional tables but are really just alternative ways to view the data that already exists in a database -view creates the appearance of a different set of table the user needs to see -views do not replicate data, they only provide alternative ways to examine the data -permanent views can be deleted by using DROP VIEW statement -create a view by using SELECT statement -views can be used to generate standard reports to provide all data necessary -views are likely to come and go in databases