databases Flashcards

1
Q

what is a database

A

collection of data organised in a way that makes easy to store retrieve and manipulate data either electronic or paper based

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

what is the advantage of electronic database

A

more efficent easy to store, mangae and retreive files

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

single table database

A

single table makes up database eg. spreadsheet

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

table

A

collection of rows and columns

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

what is a row called in databases

A

records

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

what is a record, how should you count its quantity

A

record is collection of related fields about an entity
do not count first row, as its headers of columns

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

what do you call columns in databases

A

fields or attributes

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

what are fields or attributes

A

piece of info about an entity (columns)
each field is made up of same datatype

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

entity

A

anything about which data can be collected

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

what is a data dictionary

A

table that shows collection of fields and their data types and metadata

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

metadata

A

data about data, info about existing data

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

what are the different data types

A

real, character, integer text/ alphanumeric, boolean, date/time

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

character

A

single letter, number, value, eg. s, 7

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

real

A

decimals eb. 12.6

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

integer

A

whole number can be zero and negative

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

text/ alphanumeric

A

string of characters can contain combination of letters with numbers and symbols
Num, Num1, Num_1

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

data/time

A

represent date or time, must specify seperator used in between eg. / or - or :
eg. 17/06/24
17-6-43
15:00:34

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

boolean

A

TRUE or FALSE

19
Q

why is data type important for inputting data of database

A

if wrong data type, data might not be accepted, this is done by validation rules

20
Q

primary key

A

field that uniquely identifies one record from all stores in a database table

21
Q

SQL

A

structured query language- database manipulation language used to manage data in a database, ued to perform operations on database

22
Q

what are some things SQL can perform

A

create database, create table, retreive data from databases, execute queries, display records

23
Q

what is SELECT…FROM used for, and how

A

used to specify fields you want to view from database table
3 variations:
SELECT <filedname> FROM <tablename>
SELECT <fieldname1>, <fieldname2> FROM <tablename>
SELECT * FROM <tablename></tablename></tablename></fieldname2></fieldname1></tablename></filedname>

23
Q

how do you select more than one field to output

A

list fields you want to slect by adding a coma in between eg

24
how do you select entire table
adding asteriscs
25
why is SELCT.....FROM....WHERE used? and how.
outputs data that meets specified criteria eg. SELECT FROM WHERE eg. SELECT FROM WHERE = "dubai"
26
what are the different operations you can use for
equal to = not equal to <> less than < greater than > less than or equal to <= greater than or equal to >=
27
how do you add more than one
use boolean operations either AND or OR
28
explain AND operation
both criteria must be met eg. SELECT FROM WHERE = "dubai" AND > 16
29
explain OR operation
used when either one or both criteria must be met
30
how and why do you use ORDER BY
used togehter with select to sort field or data retrieved from table in ascending or descending order, by default ORDER BY automatically ascneding order eg. SELECT FROM WHERE = "dubai" AND > 16 ORDER BY DESC
31
what are the two types of ORDER BY
ascending ASC or descending DESC
32
what happens when you use ORDER BY in text (string) fields
orders by ascending or descending alphabetical order
33
how and why do you use SUM
only used in columns with numeric values, find sum of all values that meet specified criteria SELECT sum FROM WHERE > 16
34
how and why is COUNT used
count number of records (rows) that meet certain criteria, can be text as well as numeral eg.SELECT count FROM WHERE = "dubai" AND > 16
35
global varible
is accessible anywhere in the program EXCEPT inside the function where a variable of the same name is defined – scope is the whole program – value can be changed anywhere in the program
36
local variable
only accessible inside the function, and can only be passed back to the global scope as a return value. * local variables - scope is a defined block of code/subroutine/procedure/function value cannot be changed elsewhere in the program
37
what are features of a maintanble program
-meaningful identifiers – the commenting feature provided by the programming language – procedures and functions – relevant and appropriate commenting of syntax
38
purposes of files
-Files provide a way to ​store data ​permanently, allowing programs to access and manipulate it later -Files allow for ​organised storage​ of data, making it easier to find, access, and update -They enable ​sharing​ of data between different programs and users -They support ​data backup, ensuring data is not lost when a program or computer system shuts down -They allow for ​large amounts of data​ to be stored and managed efficiently -Data can be transported from one system to another
39
Explain why a programmer would use procedures and parameters when writing a program.
procedure: -to enable the programmer to write a collection of programming statements under a single identifier -to allow procedures to be re-used within the program or in other programs - to enable different programmers to work on different procedures in the same project -o make programs easier to maintain due to being shorter. parameters -to pass values from the main program to a procedure / -so that they can be used in the procedure -allow the procedure / function to be re-used with different data.
40
how should you output sql language
in order that they appear in table, and in order that they are listed in SELECT
41
what does verifying ensure
ensure datas has been accurately copied from one source to another
42
Give two reasons for storing data in a file
data is stored permanently * data can be moved to another computer * another copy of data can be made and stored//accessed elsewhere // backup copy