9 - Databases Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is data? [2]

A
  • refers to the individual pieces of information that are stored
  • information about something
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a base? [2]

A
  • signifies that it is the foundation or platform
  • where data is stored and managed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are examples of data and what can it include? [2]

A
  • someone’s age, someone’s salary, etc
  • can include: text, pictures, numbers, multimedia, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a database? [3]

A
  • structured collection of data that allows people to extract, add, delete and update information in a way that meets their needs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where are databases used? [3]

A
  • to store information about people
  • to store information about things
  • to store information about events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are examples of information that might be stored about people? [2]

A
  • patients in a hospital
  • pupils at a school
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are examples of information that might be stored about things? [2]

A
  • cars to be sold
  • books in a library
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are examples of information that might be stored about events? [2]

A
  • hotel bookings
  • results of races
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are flat files? [2]

A
  • a simple table consisting of fields in columns and records in rows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why are flat files called flat? [2]

A
  • they store data in a simple, plain text format without any complex structure
  • the data is organised in a straightforward manner
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is data organised in a flat file? [2]

A
  • seperated by commas or tabs
  • each line represents a single record
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are examples of flat files? [3]

A
  • notepad
  • microsoft excel
  • microsoft word
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the issues related to flat files? [3]

A
  • data inconsistency (not updated)
  • miscommunication
  • takes up too much storage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the solutions to these issues? [6]
(3 reasons + explanations)

A
  • data is stored centrally and accessed by different applications
  • changes made by one application is reflected in another application
  • access rights and privileges are maintained so you can control who can access, edit and modify data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two things a table consists of? [2]

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

What is a field + example? [2]

A
  • one type of information
  • e.g. name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a record + example? [2]

A
  • details
  • e.g. name, age, salary together
18
Q

What does a table contain data about? [3]

A

one type of item, person or event + given a meaningful name

19
Q

What does a record within a table contain data about? [3]

A

a single item, person or event

20
Q

What are the data types used in databases? [6]

A
  • text/alphanumeric
  • character
  • boolean
  • integer
  • real
  • data/time
21
Q

Give examples of each data type used in databases. [6]

A
  • text: Sumridhi
  • character: S
  • boolean: Yes/No
  • integer: 16
  • real: 11.23
  • date/time: 23/06/09
22
Q

What does a data type classify? [2]

A
  • how the data is stored and displayed
  • the operations that can be performed on the stored value
23
Q

What is a real data type? [1]

A

a decimal number

24
Q

What is a primary key? [1]

A

a field in a database that uniquely identifies a record

25
Q

Why do we use a primary key on a table? [2]

A
  • to uniquely identify the data
  • make sure there’s no repeats
26
Q

What is an example of the main primary key used? [1]

A

user ID

27
Q

What does a field that is a primary key contain? [1]

A

data values that are never repeated in the table

28
Q

What issues are faced on a table without a primary key? [2]

A
  • update / modification issues
  • insertion issues as rows wouldn’t be uniquely identified
29
Q

What are the advantages of using database system over flat file system? [3]

A
  • imrpoved data security and consistency
  • enhanced data access and sharing
  • makes data management more efficient and structured
30
Q

What does SQL stand for? [1]

A

Structured Query Language

31
Q

Why is SQL used? [2]

A
  • used to obtain information from single-table databases
  • for writing scripts to obtain useful information from a database
32
Q

What are the possible miconceptions about SQL? [3]

A
  • it’s case insensitive
  • end every command with a semi colon
  • must be used to separate items
33
Q

What are the shortcuts used for SQL scripts? For example how are the data types identified. [3]

A
  • text: varchar
  • length of data type: (__)
  • number: int
34
Q

What is the script for creating a database? [1]

A

create database ___ ;

35
Q

What is the script for creating a table? [2]

A

create table __(table name)__
(fieldname#1 datatype,
fieldname#2 datatype,
fieldname#3 datatype) ;

36
Q

What is the script for inserting data into a table? [2]

A

insert into _(table name)__
(fieldname#1, fieldname#2, fieldname#3)
values (value#1, value#2, value#3) ;

37
Q

What is the script for selecting all the data from a table? [1]

A

select * from __(table name)__;

38
Q

What is the script for selecting a particular field of data from a table? [2]

A

select __(field name)__ from __(table name)__ ;

39
Q

What is the script for selecting multiple fields of data from a table? [2]

A

select __(field#1)__, __(field#2)__ from __(table name)__ ;

40
Q

What is the script for selecting all the data based on a condition? [2]

A

select * from __(table name)__
where __(condition)__ ;

41
Q

What is the script for selecting all the data based on multiple conditions? [2]

A

select * from __(table name)__
where __(condition#1)__ and __(condition#2)__ ;