Chapter 3: Database Management

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

32 Terms

1
New cards

Structured Query Language

  • Acronym: SQL

  • Originally developed by IBM as the SEQUEL language in the 1970s

  • SQL-92 is an ANSI national standard adopted in 1992

  • SQL 2011 is current standard


2
New cards

SQL defined

  • SQL is not a programming language, but rather a data sublanguage

  • SQL is compromised of:

  • Data definition language (DDL): which is used to define database structures

  • Data manipulation language (DML): Data definition and updating, data retrieval (Queries)

  • SQL/Persistent Stored Modules (SQL/PSM): Procedural programming capabilities

  • Transaction Control Language (TCL): control transaction behavior

  • Data Control Language (DLC): Grant and revoke database permissions


3
New cards

SQL for Data Retrieval: Queries

  • SELECT is the best known SQL statement

  • SELECT will retrieve information from the database that matches the specified criteria using the SELECT/FROM/WHERE framework


4
New cards

SQL for Data Retrieval: The results of a query is a relation

  • a query pulls information from one or more relations and creates (temporarily) a new relation

  • This allows a query to:

  • Create a new creation

  • Feed information to another query (as a sub query)


5
New cards

SQL for Data Retrieval: Displaying all columns

  • To show all of the column values for the rows that match the specified criteria, use an asterisk (*)


6
New cards

SQL for Data Retrieval: Showing each row only once

The DISTINCT keyword may be added to the SELECT statement to inhibit duplicate rows from displaying

7
New cards

SQL for Data Retrieval: Specifying search criteria

The WHERE clause stipulates the matching criteria for the record that is to be displayed

8
New cards

SQL for Data Retrieval: Specifying columns and rows 1

Display the FirstName, LastName, Phone and Department values of employees in the finance department

9
New cards

SQL for Data Retrieval: Specifying columns and rows 2

  • AND: Representing an intersection of the data sets

  • OR: Representing a union of the data sets


10
New cards

SQL for Data Retrieval: Specifying columns and rows 3

  • The use of IN and NOT IN

  • IN: the column may equal to any of the values in the list

  • NOT IN: the column must not be equal to all the values in the list


11
New cards

SQL for Data Retrieval: Finding Data in a range of values

  • SQL provides a BETWEEN keyword that allows a user to specify a minimum and maximum value on one line


12
New cards

SQL for Data retrieval: Comparison operators

The WHERE clause operators may include

  • Equals to “=”

  • Not Equal to “<>”

  • Greater than “>”

  • Less than “<“

  • Greater than or Equal to “>=”

  • Less than or Equal to “<=”


13
New cards

SQL for Data Retrieval: Allowing for Wildcard Searches

  • The SQL LIKE keyword allows searches on partial data values

  • LIKE can be paired with wildcards to find rows matching a string value

  • Multiple character wildcard character is a percent sign (%)

  • Single character wildcard character is an underscore (_)


14
New cards

SQL for Data Retrieval: Sorting the Results

  • Query results may be sorted using the ORDER BY clause


15
New cards

COUNT

counts the number of rows that match the specified criteria

16
New cards

MIN

Finds the minimum value for a specific column for those rows matching the criteria

17
New cards

MAX

Finds the maximum value for a specific column for those rows matching the criteria

18
New cards

SUM

calculates the sum for a specific column for those rows matching the criteria

19
New cards

AVG

Calculates the numerical average of a specific column for those rows matching the criteria

20
New cards

GROUP BY

Subtotals can be calculated using this clause

21
New cards

HAVING

This clause can be used to restrict which data is displayed

22
New cards

Subqueries

The result of a query is a relation. As a result, a query may feed another query.

23
New cards

Joins

Another way of combining data is by using a join

  • Join (also called an Inner Join)

  • Left Outer Join

  • Right Outer Join


24
New cards

Outer join

this syntax can be used to obtain data that exists in one table without matching data in the other table

25
New cards

CREATE

to create database objects

26
New cards

ALTER

To modify the structure and/or characteristics of database objects

27
New cards

DROP

to delete database objects

28
New cards

Insert

will add a new row in a table

29
New cards

Update

will update the data in a table that matches the specified criteria

30
New cards

Delete

Will delete the data in a table that matches the specified criteria

31
New cards

CHECK

this constraint can be used to create sets of values that restrict the values that can be used in a column

  • MSAccess doesn’t support this constraint


32
New cards

SQL View

its a virtual table created by a DBMS-stored SELECT statement which can combine access to data in multiple tables and even in other views

  • MSAccess doesn’t support Views