State 7020 Exam 1 Reading Assignments

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 73

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

74 Terms

1

Table

a structured file that can store data of a specific type. A table might contain a list of customers, a product catalog, or any other list of information

New cards
2

Table Names

Every table in a database has a name that identifies it. That name is always unique —meaning no other table in that database can have the same name

New cards
3

Schema

Information about database and table layout and properties.

New cards
4

Column

A single field in a table. All tables are made up of one or more columns. The vertical columns in the grid are the table columns

New cards
5

Datatype

A type of allowed data. Every table column has an associated datatype that restricts (or allows) specific data in that column.

New cards
6

Row

A record in a table. Horizontal rows are the table rows.

New cards
7

Primary Keys

A column (or set of columns) whose values uniquely identify every row in a table. The primary key is used to refer to a specific row

New cards
8

Conditions of a primary key

  • No two rows can have the same primary key value.

  • Every row must have a value in the primary key column(s). (So, no NULL values.)

  • Values in primary key columns should never be modified or updated.

  • Primary key values should never be reused. (If a row is deleted from the table, its primary key may not be assigned to any new rows in the future.)

New cards
9

SELECT statement

to retrieve information from one or more tables.

New cards
10

FROM keyword

specifies the name of the table from which to retrieve the data.

New cards
11

Retrieving multiple columns

To retrieve multiple columns from a table, the same SELECT statement is used. The only difference is that multiple column names must be specified after the SELECT keyword, and each column must be separated by a comma

New cards
12

Retrieving all columns

using the asterisk (*) wildcard character

New cards
13

Retrieving distinct rows

SELECT DISTINCT tells the DBMS to only return distinct (unique) rows. If used, the DISTINCT keyword must be placed directly in front of the column names.

New cards
14

DISTINCT keyword example

SELECT DISTINCT vend_id

FROM Products

New cards
15

TOP keyword

limit the top number of entries

New cards
16

TOP keyword example

SELECT TOP 5 prod_name

FROM Products

New cards
17

Clause

A clause usually consists of a keyword and supplied data. An example of this is the SELECT statement’s FROM clause

New cards
18

ORDER BY clause

takes the name of one or more columns by which to sort the output.

New cards
19

WHERE clause

data is filtered by specifying search criteria

New cards
20

WHERE clause operators

= Equality

<> Nonequality

!= Nonequality

< Less than

<= Less than or equal to

!< Not less than

> Greater than

>= Greater than or equal to

!> Not greater than

BETWEEN Between two specified values

IS NULL Is a NULL value

New cards
21

Operator

A special keyword used to join or change clauses within a WHERE clause. Also known as logical operators.

New cards
22

AND keyword

A keyword used in a WHERE clause to specify that only rows matching all the specified conditions should be retrieved

New cards
23

OR keyword

OR operator instructs the database management system software to retrieve rows that match either condition.

New cards
24

Wildcard

Special characters used to match parts of a value.

New cards
25

LIKE operator

Within a search string, %means match any number of occurrences of any character.

New cards
26

LIKE Operator example

SELECT prod_id, prod_name FROM Products WHERE prod_name LIKE '%bean bag%'

New cards
27

Brackets in Wildcards

The brackets ([]) wildcard is used to specify a set of characters, any one of which must match a character in the specified position

New cards
28

Brackets in wildcards example

SELECT cust_contact

FROM Customers

WHERE cust_contact LIKE '[^JM]%'

New cards
29

Field

Essentially means the same thing as column and often used interchangeably, although database columns are typically called columns and the term fields is usually used in conjunction with calculated fields

New cards
30

Concatenate

Joining values together (by appending them to each other) to form a single long value.

New cards
31

Concatenate example

SELECT vend_name + '(' + vend_country + ')'

FROM Vendors

ORDER BY vend_name

New cards
32

RTRIM()

function trims all space from the right of a value. When you use RTRIM(), the individual columns are all trimmed properly.

New cards
33

RTRIM () Example

SELECT RTRIM(vend_name) + ' (' + RTRIM(vend_country) + ')'

FROM Vendors

ORDER BY vend_name;

New cards
34

Common Manipulation Functions

  • LEFT() (or use substring function

    • Returns characters from left of string

  • LENGTH() (also DATALENGTH() or LEN())

    • Returns the length of a string

  • LOWER()

    • Converts string to lowercase

  • LTRIM()

    • Trims white space from left of string

  • RIGHT() (or use substring function)

    • Returns characters from right of string

  • RTRIM()

    • Trims white space from right of string

  • SUBSTR() or SUBSTRING()

    • Extracts part of a string (as noted in Table 8.1)

  • SOUNDEX() Returns a string’s SOUNDEX value

  • UPPER() Converts string to uppercase

New cards
35

DATEPART() function

returns a part of a date. DATEPART() takes two parameters: the part to return and the date to return it from.

New cards
36

DATEPART() function example

SELECT order_num

FROM Orders

WHERE DATEPART(yy, order_date) = 2020;

New cards
37

Aggregate Functions

Functions that operate on a set of rows to calculate and return a single value

New cards
38

AVG() Function

used to return the average value of a specific column by counting both the number of rows in the table and the sum of their values. AVG() can be used to return the average value of all columns or of specific columns or rows.

New cards
39

AVG() Function example

SELECT AVG(prod_price) AS avg_price

FROM Products

New cards
40

COUNT() function

  • Use COUNT(*) to count the number of rows in a table, whether columns contain values or NULL values.

  • Use COUNT(column) to count the number of rows that have values in a specific column, ignoring NULL values.

New cards
41

MAX() Function

returns the highest value in a specified column.

New cards
42

MIN() Function

returns the lowest value in a specified column.

New cards
43

SUM() Function

return the sum (total) of the values in a specific column.

New cards
44

GROUP BY clause

instructs the DBMS to sort the data and group it

  • must come after any WHERE clause and before any ORDER BY clause.

New cards
45
New cards
46

SQL Ordering

  1. SELECT

  2. FROM

  3. WHERE

  4. GROUP BY

  5. ORDER BY

New cards
47

Query

usually used to refer to SELECT statements

New cards
48

Subquery

Subqueries are always processed starting with the innermost SELECT statement and working outward. When the preceding SELECT statement is processed, the DBMS actually performs two operations.

New cards
49

Subquery example

SELECT cust_id

FROM Orders

WHERE order_num IN (SELECT order_num

FROM OrderItems

WHERE prod_id = 'RGAN01')

New cards
50

INNER JOIN

a join based on the testing of equality between two table

New cards
51

UNION operator

return the results as a single query result set.

New cards
52

UNION operator example

SELECT cust_name, cust_contact, cust_email

FROM Customers

WHERE cust_state IN ('IL','IN','MI')

UNION

SELECT cust_name, cust_contact, cust_email

FROM Customers

WHERE cust_name = 'Fun4All';

New cards
53

structured data

tables with well-defined rows and columns

New cards
54

entity relationship diagrams

New cards
55

data model

definition of the tables, the columns, and the relationships among them

New cards
56

logical data model

explains the database in terms that business users understand. The logical data model communicates the contents of the database because it defines many business terms and how they are stored in the database

New cards
57

physical data model

explains how the database is actually implemented. That is, every entity in the logical data model corresponds to a table in the database; every attribute corresponds to a column.

New cards
58

Entity-Relationship Diagram

“relational databases” refers to the fact that different tables relate to each other via keys, and to the fact that columns in a given row relate to the values for that column via the column name

New cards
59

foreign key

a column whose contents are the primary key of another table

New cards
60

dataflow

graphical way of visualizing data transformations

New cards
61

nodes

dataflow diagram transform data, taking zero or more inputs and producing output

New cards
62

edges

dataflow diagram are pipes connecting the nodes

New cards
63

READ operator

reads all the columns of data from a database table or file

New cards
64

OUTPUT operator

creates desired output, such as a table in a row-column format or some sort of chart based on the data.

New cards
65

IN statement

used in a WHERE clause to choose items from a set.

New cards
66
New cards
67
New cards
68
New cards
69
New cards
70
New cards
71
New cards
72
New cards
73
New cards
74
New cards

Explore top notes

note Note
studied byStudied by 16 people
838 days ago
5.0(1)
note Note
studied byStudied by 31 people
866 days ago
5.0(3)
note Note
studied byStudied by 7 people
854 days ago
5.0(1)
note Note
studied byStudied by 7 people
881 days ago
5.0(1)
note Note
studied byStudied by 313 people
321 days ago
5.0(2)
note Note
studied byStudied by 7 people
109 days ago
5.0(4)
note Note
studied byStudied by 172 people
533 days ago
5.0(1)
note Note
studied byStudied by 14 people
61 days ago
5.0(1)

Explore top flashcards

flashcards Flashcard (116)
studied byStudied by 2 people
97 days ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 7 people
822 days ago
4.5(2)
flashcards Flashcard (71)
studied byStudied by 1 person
697 days ago
5.0(1)
flashcards Flashcard (48)
studied byStudied by 7 people
105 days ago
5.0(1)
flashcards Flashcard (103)
studied byStudied by 40 people
485 days ago
5.0(1)
flashcards Flashcard (83)
studied byStudied by 2 people
649 days ago
5.0(2)
flashcards Flashcard (269)
studied byStudied by 8 people
590 days ago
5.0(3)
flashcards Flashcard (69)
studied byStudied by 36 people
21 days ago
5.0(1)
robot