Database Terminology and Components
40 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following BEST describes a Database Management System (DBMS)?

  • A logical structure to store data.
  • A group of records about the same type of entity.
  • A collection of fields for one specific entity.
  • Software used to create and interact with the database. (correct)

A 'field' in a database is best described as a basic unit of data, such as a letter or symbol.

False (B)

In database terminology, what does SDLC stand for?

Systems Development Life Cycle

The process of organizing data to minimize redundancy is called database ________.

<p>normalization</p> Signup and view all the answers

Which stage of the Systems Development Life Cycle (SDLC) involves understanding the problem?

<p>Systems investigation (B)</p> Signup and view all the answers

An E-R model is primarily used to depict the physical storage structure of a database.

<p>False (B)</p> Signup and view all the answers

What type of relationship exists when each occurrence of data in one entity is related to only one occurrence of data in another entity?

<p>One-to-one</p> Signup and view all the answers

In an E-R diagram, a student taking many classes and each class being composed of many students represents a ________ relationship.

<p>many-to-many</p> Signup and view all the answers

What is the primary function of the Database Management System (DBMS) concerning data storage?

<p>Manage the physical structure of the database. (D)</p> Signup and view all the answers

Data normalization aims to increase data redundancy to ensure data is available in multiple locations.

<p>False (B)</p> Signup and view all the answers

What term describes having the same data in different places within a database?

<p>Data redundancy</p> Signup and view all the answers

Data ________ refer to inconsistencies in data resulting from data redundancy.

<p>anomalies</p> Signup and view all the answers

What is the first step in normalizing a table that contains repeating groups?

<p>Identify the primary key. (A)</p> Signup and view all the answers

A composite primary key consists of only one column to uniquely identify a row.

<p>False (B)</p> Signup and view all the answers

What type of dependency exists when a column is only dependent on a portion of the primary key?

<p>Partial dependency</p> Signup and view all the answers

In third normal form (3NF), ________ dependencies are eliminated.

<p>transitive</p> Signup and view all the answers

What is the purpose of relating tables within a database?

<p>To establish relationships between tables through common fields. (C)</p> Signup and view all the answers

A lookup table always contains descriptive data referenced in a primary key.

<p>False (B)</p> Signup and view all the answers

What does SQL stand for?

<p>Structured Query Language</p> Signup and view all the answers

SQL is considered a data ________ because it is used to create, modify, and retrieve data.

<p>sublanguage</p> Signup and view all the answers

Which SQL statement is used to retrieve data from a database?

<p>SELECT (A)</p> Signup and view all the answers

The FROM clause in a SELECT statement identifies the condition to filter the rows.

<p>False (B)</p> Signup and view all the answers

In a SELECT statement, which clause is used to identify the table(s) from which to retrieve data?

<p>FROM</p> Signup and view all the answers

To select all columns from a table in SQL, you can use an ________ in the SELECT clause.

<p>asterisk</p> Signup and view all the answers

In SQL, what is the purpose of using a column alias?

<p>To provide a different column heading in the result set. (B)</p> Signup and view all the answers

The AS keyword is required when assigning a column alias in SQL.

<p>False (B)</p> Signup and view all the answers

What SQL operator is used to combine data with a string literal in a SELECT statement?

<p>Concatenation operator (||)</p> Signup and view all the answers

In SQL, arithmetic operations are executed from ________ to ________, following the order of operations.

<p>left, right</p> Signup and view all the answers

What is the purpose of the DISTINCT keyword in a SELECT statement?

<p>To suppress duplicate rows in the result set. (A)</p> Signup and view all the answers

Database table names can contain blank spaces.

<p>False (B)</p> Signup and view all the answers

What is the maximum number of characters that a table or column name can contain?

<p>30</p> Signup and view all the answers

A database table is created and modified using data definition language (DDL) ________.

<p>commands</p> Signup and view all the answers

Which SQL command is used to add a column to an existing table?

<p>ALTER TABLE...ADD (D)</p> Signup and view all the answers

After dropping a column from a table, it can be restored.

<p>False (B)</p> Signup and view all the answers

What command is used to permanently remove a table, including its structure and contents, from the database?

<p>DROP TABLE</p> Signup and view all the answers

The SQL command ________ TABLE is used to delete all rows from a table while retaining the table structure.

<p>TRUNCATE</p> Signup and view all the answers

What SQL command can be used to recover a table from the recycle bin (available in Oracle 10g and later)?

<p>FLASHBACK TABLE (D)</p> Signup and view all the answers

Constraints are optional rules that are imposed to enforce business practices and policies.

<p>True (A)</p> Signup and view all the answers

Which constraint type ensures that a column does not contain NULL values, and can only be created at the column level during the initial table creation?

<p>NOT NULL</p> Signup and view all the answers

When creating a FOREIGN KEY constraint, the referenced column in the parent table is usually the ________.

<p>PRIMARY KEY</p> Signup and view all the answers

Flashcards

Database

Logical structure to store data.

DBMS

Software used to create and interact with a database.

Character

Basic unit of data; can be a letter, number, or symbol.

Field

Group of related characters representing an attribute.

Signup and view all the flashcards

Record

Collection of fields for one specific entity.

Signup and view all the flashcards

File

Group of records about the same type of entity.

Signup and view all the flashcards

Database Normalization

Determines required tables and columns; reduces data redundancy.

Signup and view all the flashcards

Data Redundancy

Having the same data in multiple places within the database.

Signup and view all the flashcards

Data Anomalies

Data inconsistencies due to redundancy.

Signup and view all the flashcards

Unnormalized Data

Contains repeating groups; needs normalization.

Signup and view all the flashcards

First Normal Form (1NF)

Primary key identified; repeating groups eliminated.

Signup and view all the flashcards

Composite Primary Key

More than one column to uniquely identify a row.

Signup and view all the flashcards

Partial Dependency

A column dependent on only part of a composite key.

Signup and view all the flashcards

Second Normal Form (2NF)

Partial dependency eliminated.

Signup and view all the flashcards

Third Normal Form (3NF)

Transitive dependency eliminated.

Signup and view all the flashcards

Relating Tables

Tables linked through a common field.

Signup and view all the flashcards

Lookup Table

Common reference for descriptive data tables.

Signup and view all the flashcards

SQL

Data sublanguage used to create, modify, and retrieve data.

Signup and view all the flashcards

SELECT statement

Used to retrieve data from the database.

Signup and view all the flashcards

Syntax

Basic structure or rules for a command.

Signup and view all the flashcards

Column Alias

Used for column headings or arithmetic operations.

Signup and view all the flashcards

Concatenation

Combines data with a string literal.

Signup and view all the flashcards

Database Table

A database object that stores data in columns and rows.

Signup and view all the flashcards

DDL Commands

Used to create and modify tables.

Signup and view all the flashcards

VARCHAR2(n)

Variable-length character data.

Signup and view all the flashcards

Char(n)

Fixed-length Character data.

Signup and view all the flashcards

Number(p, s)

Numeric column with precision and scale.

Signup and view all the flashcards

Date

Stores date and time.

Signup and view all the flashcards

ALTER TABLE...ADD

Add a column.

Signup and view all the flashcards

ALTER TABLE...MODIFY

Modify a column.

Signup and view all the flashcards

ALTER TABLE...DROP

Delete a column.

Signup and view all the flashcards

Constraints

Rules to enforce business practices and ensure data integrity.

Signup and view all the flashcards

Primary Key Constraint

Uniquely identifies each record; can't be NULL; data values must be unique.

Signup and view all the flashcards

Foreign Key Constraint

Ensures if entered in a specified column, it must already exist in the 'one' table, or the record isn't added.

Signup and view all the flashcards

Unique Constraint

Ensures all data values stored in a specified column are unique.

Signup and view all the flashcards

Check Constraint

Ensures a specified condition is TRUE before the data value is added to the table.

Signup and view all the flashcards

Not Null Constraint

A specified column can't contain a NULL value.

Signup and view all the flashcards

Study Notes

Database Terminology

  • Database constitutes a logical structure designed for data storage
  • Database management system (DBMS) represents the software used for database creation and interaction

Database Components

  • The components comprise characters, fields, records, and files

Character

  • Represents the fundamental unit of data
  • It could manifest as a letter, number, or symbol

Field

  • The group constitutes related characters
  • Representing an attribute or characteristic of an entity
  • Corresponding to a column in the physical database

Record

  • The field represents the collection for a specific entity
  • Corresponds to a row in the subject database

File

  • Represents a group of similar records

Database Management System

  • It manages the physical structure through data storage
  • It controls access and privileges through security measures
  • Multiuser access allows the management of concurrent data access
  • Data access is provied through a language that facilitates interactions
  • Backup procedures enable recovery options after failures
  • Data integrity enables checks and constraints
  • A data dictionary maintains information about database structure

Database Design

  • It uses the Systems Development Life Cycle (SDLC)
  • It uses the Entity-relationship model (ER model)
  • It uses Normalization

Systems Development Life Cycle (SDLC)

  • Systems investigation involves understanding the problem
  • Systems analysis involves understanding the solution
  • Systems design focuses on logical and physical component creation
  • Systems implementation focuses on placing completed systems into operation
  • Systems maintenance and review involves implemented system evaluation

Entity-Relationship Model (ER Model)

  • Used to show the relationships among the entities
  • It can include one-to-one, one-to-many, and many-to-many relationships

One-to-One Relationship

  • Each data occurrence in one entity is represented by one occurrence in the other
  • Example: An individual has one Social Security number, and each SSN belongs to one person

One-to-Many Relationship

  • Data occurrence in one entity is represented by many occurrences in the other
  • Example: One instructor may teach many classes, but a class has one instructor

Many-to-Many Relationship

  • Data can have multiple occurrences in both entities
  • Example: Students can take multiple classes, and each class consists of many students
  • Cannot be included in the physical database

Database Normalization

  • Determines required tables and columns for each table
  • Involves a multi-step process
  • Reduces or controls data redundancy

Database Normalization (continued)

  • Data redundancy duplicates data in a database
  • Data anomalies refer to inconsistencies

Unnormalized Data

  • Contains repeating items in the Author column in the data BOOKS table

First-Normal Form (1NF)

  • The Primary key is identified
  • Repeating items are eliminated

First-Normal Form (1NF) (continued)

  • ISBN (International Standard Book Number) and Author columns create a composite primary key

Composite Primary Key

  • Multiple columns identify a row
  • Can lead to partial dependency, where a column depends on a portion of the primary key

Second-Normal Form (2NF)

  • Partial dependency must be eliminated
  • Break the composite primary key into two parts, each representing a separate table

Second-Normal Form (2NF) (continued)

  • An example is the data BOOKS table

Third-Normal Form (3NF)

  • Publisher contact name has been removed

Summary of Normalization Steps

  • 1NF: eliminate repeating items, identify the primary key
  • 2NF: table exists in 1NF, and partial dependencies are eliminated
  • 3NF: table exists in 2NF, and transitive dependencies are eliminated

Relating Tables within the Database

  • Normalized tables are linked
  • Tables connect through a common field
  • A typical common field uses a primary key and foreign key

Lookup Table

  • Common reference for descriptive data tables referenced via foreign keys

Structured Query Language (SQL)

  • Represents a data sublanguage
  • Used to create or modify, add, edit, and retrieve data
  • ANSI and ISO standards

Basic SQL SELECT statements

  • SELECT retrieves data from the database
  • Referred to as a query

SELECT Clause

  • SELECT and FROM clauses are required
  • SELECT clause identifies column(s)
  • FROM clause identifies table(s)
  • Each clause begins with a keyword

Operations within the SELECT statement

  • The select statement includes column aliases, arithmetic operations, suppressing duplicates & concatenating data

Column Aliases

  • Column headings are used to name columns
  • Optional AS keyword allows aliases after column headings
  • Enclose in double quotation marks to contain blanks

Using DISTINCT & UNIQUE

  • A DISTINCT or UNIQUE keyword removes duplicates

Using Concatenation

  • Data combined with a string literal
  • SQL uses a concatenation operator

Using Arithmetic Operations

  • Multiplication & division solved before addition & subtraction
  • Operations override order within parentheses

NULL Values

  • Representing a condition where the data is missing

Database Table

  • A table stores data in the database
  • A table consists of columns and rows
  • Tables are created using data definition language commands

Table Design

  • Table and column names are a maximum of 30 characters with no blank spaces
  • Table and column names must begin with a letter and be unique
  • Table and column names can contain numbers and underscores
  • Table and columns cannot use reserved words

Table Creation

  • Datatype must be specified for each column
  • Table holds a maximum of 1,000 rows

User Tables

  • Data dictionary maintains information about database objects
  • Query data dictionary to examine schema tables
  • The USER_TABLES data dictionary contains table information

Describe

  • DESCRIBE displays the structure of a table

Table Creation through Subqueries

  • Use subqueries to retrieve data from a table
  • This requires the AS keyword

Modifying Existing Tables

  • Use the ALTER TABLE command to update existing tables

Modification Guidelines

  • A column must be as wide as the data
  • A decrease in size isn't allowed if a NUMBER column contains data
  • Default data won't affect existing data when changed

Drop Column

  • The ALTER TABLE command can drop only one column per execution, and deletion is permanent
  • One cannot delete the last remaining column

Purge and Drop

  • Storage space is deleted at a later time
  • Storage space is freed by ALTER TABLE...DROP UNUSED Command

Renaming Tables

  • Use RENAME...TO to rename a table

Truncating Tables

  • TRUNCATE TABLE command removes all rows, but an empty table structure remains

Deleting Tables

  • DROP TABLE command removes the table structure, but the data remains
  • Oracle 10g introduced recyclying bins
  • Dropped tables can be recovered from recyclying bin

Constraints

  • Rules enforce business rules, practices, and policies
  • Constraints ensure precision and integrity

Constraint Types

The keys are:

  • Primary
  • Foreign
  • Unique
  • Check
  • Not Null

Creating Constraints

  • Assign names with the keyword CONSTRAINT
  • The server names the constraint, and you can use informative names to debug
  • When to create -During table creations -After table creation, when you have modiifed an existing table -Column level approach -Table level approach

Creating Constraints at the Column Level

  • If a column is being created at the column level: columnname [CONSTRAINT constraintname] constrainttype,

Creating Constraints at the Table Level

  • Any constraing type except NOT NULL [CONSTRAINT constraintname] constrainttype(columnname, ...)

Enforcement of Constraints

  • If data values violate a constraint, the entire row is rejected

Adding Constraints to Existing Tables

  • Add constraints to tables using the ALTER TABLE command ALTER TABLE tablename ADD [CONSTRAINT constraintname] PRIMARY KEY (columnname);

Foreign Keys

  • Values exist in the referenced column of a table
  • NULL values are allowed
  • Enforce referential integrity

Creating Foreign Keys

ALTER TABLE orders ADD CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#) REFERENCES customers (customer#);

Unique Keys

  • Updates must meet a specified condition

Using Check

ALTER TABLE books ADD CONSTRAINT books_title_uk UNIQUE (title);

Using Not Null

  • Updates and additions must meet specified condition ALTER TABLE orders MODIFY (customer# CONSTRAINT orders_customer#_nn NOT NULL);

Constraints During Table Creation

A column may include multiple constraints: CREATE TABLE ORDERITEMS Multiple tables

  • The order# column is included in a primary key and a foreign key constraint

User Constraints

  • Users can display contraint listing

Using Disable/Enable

  • DISABLE means enable the clause of the ALTER TABLE Command

Dropping Constraints

  • Constraints must be dropped and recreated because they cannot be modified -PRIMARY KEY, just list type of constraint -UNIQUE, include column name -All others, reference constraint name
  • ALTER TABLE tablename DROP PRIMARY KEY, or UNIQUE ALTER TABLE tablename DROP CONSTRAINT constraintname

Summary

  • Constraints serve business rules, policies, and procedures that ensure data integrity in tables
  • PRIMARY KEY constraints ensure that there won't be dulicate NULL values
  • FOREIGN KEY constraints state that the referenced column entry must match the referenced table
  • A unique constraint is similar to a PRIMARY KEY constraint except it allows NULL values to be stored in the specified column
  • A CHECK constraint ensures a value meets a specified condition and a NOT NULL constraints ensures a value is provided for a coulmn
  • USER_CONSTRAINTS and USER_CONS_COLUMNS data dictionary views provide information regarding constraints

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Explore database fundamentals, including logical structures for data storage and DBMS software for interaction. Understand key components: characters (basic data units), fields (related characters as attributes), records (field collections for entities), and files (groups of similar records). Learn how DBMS manages physical structure, security, and multiuser access.

More Like This

Use Quizgecko on...
Browser
Browser