Database Principles Flashcards
(106 cards)
What is a surrogate key and when is it used
A single column that you fill with artificial values. Used when a table doesn’t have data that supports creating a natural primary key
What is a candidate key
A minimal super key that is, a key that does not contain a subset of attributes
What is an alternate key
A key that contains all the properties needed to become a candidate key. Can be a set of single attributes or multiple attribute
What is a superkey
A key that can uniquely identify any row in the table. Time attribute is a good example of a super key
Does the order of creation matter
Yes cant create an intersection table cust_order before table customer
What is DDL
- Data Definition Language (DDL)
Allows the DBA or users to describe and name entities, attributes and relationships required for the applications that access it
Examples
CREATE TABLE, ALTER TABLE, DROP TABLE, RENAME TABLE
What is DML
- Data Manipulation Language (DML)
Provides the ability to manipulate data within the database.
Examples
SELECT, INSERT, UPDATE, DELETE
What is a join and how does it work
A JOIN links tables by selecting only the rows with common values in their common
How does inner join work
Only returns matched records from the tables that are being joined
How does outer join work
Matched pairs would be retained, and any unmatched values in the other table would be left NULL
What is data control language
Language used to control access to data stored in a database
Example
REVOKE
GRANT
What is a transaction
Any request for a piece of information from a database
What is transaction analysis
the process of ensuring that multiple database operations (like updates or inserts) are done correctly and completely as a single
What is the purpose of TA and what does it allow
- Purpose of transaction analysis is to be able to see which tables are used the most in transactions
- With this information we can optimize the tables
It guarantees data consistency and reliability
. Can help identify problems
. can improve performance
What are the 3 main categories of databases
○ According to the number of users
○ According to the type of use
○ According to Database site location
What are 2 categories for users in a database
Single User database systems
Multi User database systems
What is a Single User database systems
. Database is on the PC and hard disk
. All applications run on the same PC and directly access the database
. A single user accesses the application
What is a Multiuser database systems
. many PC’s connected through a LAN
. a file server stores a copy of the database files
. each user runs a copy of the same application and accesses the same files.
What are the 4 categories for type of use in a database
Production or Transactional Database system
Data Warehouse
Decision Support Database System
Research
What is Production or Transactional Database system
. Used for management of supply chain and for tracking production of items in factories, inventories of items in warehouses/stores and orders for items
. Used for purchases on credit cards and generation of monthly statements
. Used in Banks for customer information, accounts, loans and banking transaction
What is a data warehouse
. Historical collection of data and transaction
. Can be used to find trends
What is a Decision Support Database System
. Its a hybrid
. Aids users in judgement and choice activities
. Used in environments like business, health care and military where you have to make decisions
What are the 4 categories for database location
Centralised database system
Parallel database system
Distributed database system
Client/Server database system
What is a centralised database system
Single processor together with its associated data storage devices and other peripherals