9.1 Databases Flashcards

1
Q

What is a datatype

A

a classification of how data is stored, displayed, and of which operations that can be performed on the stored value

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

what are the 6 basic data types

A

» text/alphanumeric
» character
» Boolean
» integer
» real
» date/time

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

What is a primary key

A

a field in a database that uniquely identifies a record

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

What is SQL

A

Structured Query Language - standard query language for writing scripts to obtain useful information from a database

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

What is an SQL script

A

list of SQL commands that perform a given task

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

What is SELECT

A

Fetches specified fields (columns) from a table; queries

always begin with SELECT

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

what is FROM

A

Identifies the table to use

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

what is WHERE

A

Includes only records (rows) in a query that match a given condition.

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

what is ORDER BY

A

Sorts the results from a query by a given column either alphabetically or numerically.

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

what is SUM

A

Returns the sum of all the values in a field (column)

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

what is COUNT

A

Counts the number of records (rows) where the field (column) matches a specified condition

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

all queries end with what

A

;

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

how to select all

A

SELECT *

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

Describe text/alphanumeric (data type)

A

A number of characters

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

Describe Character (data type)

A

A single character

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

Describe Boolean (data type)

A

One of two values:
either True or False, 1 or 0, Yes or No

17
Q

Describe Integer

A

Whole number

18
Q

Describe Real (data type)

A

A decimal number

19
Q

Describe date/time

A

Date and/or time

20
Q

Format to access date/time in SQL

A

Select * FROM tablename WHERE colname = ‘22/11/2022’;
need quotations and ‘/’

21
Q

Define a database

A

a structured, persistent collection of data