9.1 Databases Flashcards Preview

Computer Science > 9.1 Databases > Flashcards

Flashcards in 9.1 Databases Deck (26)
Loading flashcards...
1
Q

What is a database

A

a persistent structured collection of data that allows people to extract information in a way that meets their needs

2
Q

What is a single-table datatbase

A

a database contains only one table

3
Q

Why are databases useful

A

» if any changes or additions are made it only has to be done once – data is consistent
» the same data is used by everyone
» data is only stored once in relational databases which means no data duplication.

4
Q

What are databases used for

A

Info about people
Info about things
Info about events

5
Q

What is a record

A

a collection of fields that describe one item

horizontal rows

6
Q

What is a field

A

vertical columns

7
Q

What is a datatype

A

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

8
Q

what are the 6 basic data types

A

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

9
Q

What is a primary key

A

a field in a database that uniquely identifies a record

10
Q

What is SQL

A

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

11
Q

What is an SQL script

A

list of SQL commands that perform a given task

12
Q

What is SELECT

A

Fetches specified fields (columns) from a table; queries

always begin with SELECT

13
Q

what is FROM

A

Identifies the table to use

14
Q

what is WHERE

A

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

15
Q

what is ORDER BY

A

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

16
Q

what is SUM

A

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

17
Q

what is COUNT

A

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

18
Q

all queries end with what

A

;

19
Q

how to select all

A

SELECT *

20
Q

Describe text/alphanumeric (data type)

A

A number of characters

21
Q

Describe Character (data type)

A

A single character

22
Q

Describe Boolean (data type)

A

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

23
Q

Describe Integer

A

Whole number

24
Q

Describe Real (data type)

A

A decimal number

25
Q

Describe date/time

A

Date and/or time

26
Q

Format to access date/time in SQL

A

Select * FROM tablename WHERE colname = ‘22/11/2022’

need quotations and ‘/’