Introduction to SQL Flashcards

1
Q

Data

A

raw facts that need to be processed to become meaningful and useful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Database Management System

A

Software that handles storage, retrieval and updating of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Database

A

Collection of related data that is organized so that it can be easily accessed, managed, and updated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Data Integrity

A

Assurance of the accuracy and consistency of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Information

A

Data that has been processed and has meaning and context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Relational database

A

Data that is stored in a table with rows and columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Column

A

One data item that is a field in the table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Field

A

The data in the column of a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Foreign Key

A

A key that is used to connect two tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Primary Key

A

Column or columns that uniquely identify each row in a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Null

A

Field with no value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Record

A

Row in a database table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Relationship

A

Link or connection that is created between tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Row

A

One record in a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Table

A

Collection of data about one person, place or thing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Data redundancy

A

Data that is duplicated in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Relational Database Management System (RDMS)

A

Database Management System designed specifically for relational databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Structured Query Language

A

Standard database management language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Query

A

Request for information from the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

SQL Server Management Studio (SSMS)

A

The integrated environment used to manage the SQL infrastructure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Relational Database Management System (RDMS)

A

A database management system designed specifically for relational databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

New Query button

A

Opens a new query window for a SQL query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Execute Button

A

to run the SQL query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Object Explorer

A

In SSMS, the window where the list of databases and other objects are located

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Query Editor Window

A

In the SSMS, where the SQL query commands are written and executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

SQL Script File

A

A file that contains SQL code that can be copied into the SSMS Query Editor window and executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Comments

A

Comments in code are ignored by the computer. They are information for the programmer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

The asterisk *

A

A wildcard that means ALL
For Example: SELECT * FROM Customers means to select all of the rows in the Customers table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

SQL Servers primary purpose is to _________ used by other applications

A

store and retrieve data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

SSMS is used to _____, ______,
and ______ the database.

A

Query, design, and manage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

SQL Server Express is the _____ version of SQL Server

A

free

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

To make use of a practice database, you need to define _____ and _____

A

Tables and data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What are scripts?

A

Pre-written SQL code that has been saved as a text file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

A table will be made up of several _______ and _______

A

Columns and Rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Keywords

A

A word that is considered a reserved SQL word that is used in a database operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

SELECT

A

A SQL keyword that is used in a query statement to retrieve data rows from database tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

FROM

A

A SQL keyword that used before the table name to identify the table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

WHERE Clause

A

the WHERE clause is used to filter rows and only select data that meets the condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Column Names

A

names of the columns that were defined when the table was created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

Filter Rows

A

uses the WHERE clause to retrieve only the rows that meet the conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Limit Columns

A

A list of column names to retrieve in the SQL query instead of retrieving all of the columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

Execute

A

Running a query statement to retrieve a result-set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

SQL Syntax

A

SQL syntax refers to the rules and guidelines that must be followed as SQL queries are written. The punctuation, spaces, mathematical operators, and special characters have a special meaning when used inside of SQL query statements. Different database systems will use different syntax rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

Result-set

A

The columns and rows of data retrieved by running a SQL query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

ORDER BY

A

the SQL clause used to sort the data in ascending or descending order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

DESC / ASC

A

SQL keywords used with ORDER BY to indicate sorting order

47
Q

CREATE TABLE

A

A SQL statement to create a new table in a database

48
Q

ALTER TABLE

A

A SQL statement to alter an existing table in a database. It can also be used to add constraints.

49
Q

Constraint

A

A rule for data in the database

50
Q

Primary Key (PK)

A

A primary key is a constraint. It is a column that uniquely identifies the data in the table. It cannot be NULL. There can only be one PK in each table.

51
Q

Foreign Key (FK)

A

A foreign key is used to link two tables together. The PK is one column in the table that refers to the FK in another table.

52
Q

Data Types

A

The data type of a column defines what value the column can store

53
Q

nvarchar

A

a data type that can hold a string. Also a variable width that can hold unicode or multilingual data

54
Q

int

A

a data type that holds whole numbers

55
Q

decimal (p, s)

A

A data type that holds numbers with decimals. The default is 18 numbers precision (p) and 0 decimals scale (s)

56
Q

date

A

a data type that only holds dates

57
Q

NULL

A

a constraint that the data can hold null values or that the column is empty of data

58
Q

NOT NULL

A

a constraint that there is always data in a column. A new row cannot be added with a NULL value in a column defined as NOT NULL

59
Q

DROP TABLE

A

A SQL statement to remove a table and all of the data rows from the database

60
Q

debugging

A

making corrections to remove errors in the code

61
Q

NOT NULL

A

A SQL Server constraint that ensures a column cannot have a NULL or empty value

62
Q

UNIQUE

A

A SQL Server constraint that ensures all values are different

63
Q

PRIMARY KEY

A

SQL Server constraint that uniquely identifies each row in a table

64
Q

FOREIGN KEY

A

SQL Server constraint: used to create the link to another table

65
Q

CHECK

A

SQL Server constraint: ensures that all values in a column satisfy a specific condition

66
Q

DEFAULT

A

SQL Server constraint: sets a default value for a column when no value is specified

67
Q

INDEX

A

SQL Server constraint: used to create and retrieve data from the database very quickly

68
Q

INSERT INTO … VALUES

A

SQL statement to add rows to the table

69
Q

Duplicate Key

A

a key value that is being added to the database that violates the PRIMARY KEY constraint

70
Q

subquery

A

a query embedded in another query

71
Q

SELECT subquery

A

a SELECT query embedded inside of another query

72
Q

outer query

A

the main query that has another query embedded inside

73
Q

inner query

A

the subquery that is embedded inside the outer query

74
Q

IN

A

the IN conditional operator is shorthand for multiple OR statements. IN is used to filter records

75
Q

NOT

A

the NOT conditional operator displays the rows where the condition is not true

76
Q

NOT IN

A

combines the NOT and the IN conditions, returning a result-set with records that are NOT equal to the conditions of the IN statement

77
Q

OR

A

conditional operator that only require one condition to be true

78
Q

LIKE

A

used in the WHERE statement to search for a pattern. Usually uses a wildcard

79
Q

%

A

Wildcard: represents zero or more characters

80
Q

_

A

Wildcard: represents a single character

81
Q

Data Integrity

A

Accuracy and consistency of data

82
Q

Accuracy

A

Data that is correct

83
Q

Consistency

A

When changes are made to the data, there are rules that are followed

84
Q

ALTER TABLE

A

SQL Statement to add, delete, or modify columns or constraints on an existing table

85
Q

UPDATE … SET

A

SQL Statement to modify existing rows in a table

86
Q

DELETE

A

SQL Statement to delete rows in a table

87
Q

BETWEEN … AND

A

An operator to select values within a given range, including the beginning and end values

88
Q

IS NULL

A

SQL Condition to test if a column has null values

89
Q

UPDATE … DELETE

A

SQL statement to delete rows. Requires a filter in the statement.

90
Q

Aggregate Function

A

A function that combines the values of multiple rows to return a single value of significant meaning

91
Q

Built-in Function

A

pre-defined function

92
Q

COUNT()

A

returns the number of rows that match the criteria

93
Q

SUM()

A

returns the sum of a numeric column

94
Q

AVG()

A

returns the average value of a numeric column

95
Q

MIN()

A

returns the minimum value of a numeric column

96
Q

MAX()

A

returns the maximum value of a numeric column

97
Q

Column Alias (SELECT … AS …)

A

a temporary name given to a column to make a result-set more readable

98
Q

SELECT DISTINCT

A

returns only the different values

99
Q

View

A

a virtual table that displays data from the underlying tables.

100
Q

virtual table

A

a table with columns and rows that does not store data

101
Q

base table

A

the underlying table that stores the data

102
Q

database security

A

measures put in place to protect a database from unauthorized users

103
Q

CREATE VIEW

A

SQL statement to create view

104
Q

CREATE / ALTER VIEW

A

SQL statement to create or alter a view

105
Q

DROP VIEW

A

SQL statement to delete a view

106
Q

Constraints

A

Defined rules specified for the data in a database table

107
Q

DEFAULT Constraint

A

Used to provide a default value for a column

108
Q

CHECK Column Constraint

A

Used to limit the value range that can be placed in a column.

109
Q

NULL Constraint

A

the column default is to allow null values. a row can be added to the table without a value in the column.

110
Q

CHECK Table Constraint

A

a CHECK constraint on a table limits the values based on the values in other columns in the row

111
Q

NOT NULL Constraint

A

a rule that enforces a column to not accept NULL VALUES. A row cannot be added without a value.

112
Q

Primary Key Constraint

A

unique column in a table

113
Q

index

A

used to help the query process performance when retrieving data