Databases MCQ Flashcards

(81 cards)

1
Q

What is Data?

A

A collection of facts and figures that can be processed to produce info

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

What is a database?

A

a collection of related data designed to meet the information needs of an organisation

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

DBMS

A

a database management system is the software that manages and controls access to the database.

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

Database application

A

a program that interacts with the database at some point in its execution

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

Database system

A

a collection of application programs that interacts with the database and the DBMS

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

Limits of file Based approach

A

Separation and Duplication of data
Data Dependence
Incompatible file Formats
Fixed queries

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

Entity

A

a distinct object in the org that is to be represented in the database (person,place,thing)

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

attribute

A

property that describes some aspect of the object we wish to record

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

relationship

A

an association between entities

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

Where is computer data stored?

A

In main memory (RAM)
In secondary memory (USB,Flash drives etc)

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

Why not always use RAM?

A

RAM is volatile, as it needs power to store and process data meaning when power is witched off, data is lost.

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

Reasons to store in disk/hard memory

A

Capacity
Volatility

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

Implications of 2 types of memory

A
  1. What data is stored
  2. How it is stored
  3. Performance of a DBMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Meta Data

A

Data that describes other data

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

Three types of data

A

Processing Data,
Programs,
Meta data

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

Why are there many application programming languages

A

Application type,
language design,
data typing,
data independece

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

Strongly typed

A

In strongly typed languages, type constraints are strictly enforced by the compiler or runtime system (Java, C#, and Best eg: Arduino int,long,char)

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

Weakly typed

A

In weakly typed languages, type constraints are more relaxed, allowing for implicit type conversions and flexible operations between different types.(JavaScript, PHP, and Perl.)

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

Procedural language

A

program lists step by step the sequence of processing instructions, C, Java,Python

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

Non-procedural

A

the program states the logic required to isolate
the data, but not a procedure on how to do it. MYSQL

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

MYSQL is

A

Weakly typed and non procedural primarily

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

Design objectives in DBMS programs

A
  1. Implementation of logical and physical data dependence.
  2. Data sharing
  3. Strict control over data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Physical DI

A

(DI = data independece)independence from the physical hardware

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

Advantage of physical DI

A

Allows the program to respond to changes to any physical element within the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Logical DI
The ability to change the logical structure of the database without affecting the application programs that access the data.
26
SELECT Name,address FROM Students; Is this a logically independent query?
Yes
27
Why is MYSQL non-procedural?
The SQL programmer just indicates what data is required rather than how to get it
28
What's the problem with data sharing?
if data is shared it must have a common definition to all users/applications
29
Two sections of MYSQL
Data Definition Data Manipulation
30
Data definition (DDL)
records structures and attribute data types.(INSERT,UPDATE,CREATE)
31
Data Manipulation (DM)
WHERE/FROM/SELECT etc.
32
Order of a full sample query
SELECT FROM WHERE GROUP BY HAVING ORDER BY
33
Impact of Restrict data structure to a table
Makes it common to all users No need for output formatting statements User operations simplified
34
4 Basic Properties of Relational Model
1. Data only stored in table 2. System can use multiple tables 3. Data in diff tables can be linked using relationships. 4. Each row in a table is unique and you must declare a primary key
35
Terminology
Relation = Table = File Tuple = Row = Record Attribute = Column = Field
36
Flat files
Flat file = data files that contain records with no structured relationships
37
Data Model
Data Model = integrated collection of concepts for describing and manipulation data,relationships between data and constraints on the data in an org. Purpose is to represent data and make data understandable
38
Components of data model
Structural part Manipulative Part Integrity Constraints
39
Fortnite
Ninja
40
Relational Data Model
divides info into logical subsets and places each subset in a separate table
41
Relation/Table
Logical concept, not a representation of the physical structure.
42
Domain
definition of the allowable set or range of values allowed in an attribute
43
Primary Key
primary key constraints will uniquely identify each record in a table. they must contain unique values and can't contain null values. there can be only one primary key in a table eg StudentNo
44
Candidate key
when more than one combination of attributes uniquely identify a row.
45
Alternate key
Candidate keys are unique but also minimal in that they cannot be reduced. That is, no subset of the key can be a candidate key itself (extra attribute(s) are redundant).
46
Why is key uniqueness important
Search Mechanism Prevents duplication,waste of storage Count function Implement relationships (JOINS)
47
Referential Integrity
There can be no unmatched foreign key values
48
Required Fields
Marked as NOT NULL
49
Why use DBMS
Data Management & sharing Data Integrity Security Recovery Concurrency
50
Alternatives to RDBMS
NoSQL MongoDB HADOOP
50
DBA
Database Administrator manages and controls the DBMS tools
51
Brief History
Big changes - 1992 Made - 1972 Maker - Donald D. Chamberlin SQL 3 - 1999 Latest - SQL:2016 released
51
SQL Dialects
MYSQL,SQLLite, Oracle,Ingres,MYSQL server, DB2
51
Objectives of SQL
Portable Create database and relation structures Perform inserts,modifications,deletion Perform Simple/Complex queries
52
Reserved Words
fixed part of SQL and must be spelt as required and cannot be split across lines
52
Portability
Ability to move code from one database installation to another. Easiest eg: using '' instead of " ". as some dialects don't support double quotes
53
User-defined words
made up by user and represent names of database objects.
53
BNF notation (kind of an aside?)
UPPER CASE -reserved words lower case - user defined | indicates choice {} indicates required element [] indicates optional element ... indicates optional repitition
54
SELECT
query data in db
54
UPDATE
updates data in a table
55
INSERT
inserts data in table
55
WHERE
filters rows
56
DELETE
deletes data from table
57
USE
specifies database to be used
57
FROM
specifies table to be used
57
HAVING
filters groups subject to some conditon. needs GROUP BY to work
58
ORDER BY
specifies the order of the output
58
AS
creates temporary column
58
GROUP BY
forms groups of rows with same column value. isolates subsets
58
DISTINCT
eliminates duplicates
59
BETWEEN
creates a range of values between such a number and another number (BETWEEN 2000 AND 300)
59
Mandatory queries
SELECT FROM
60
IN
allows you to specify multiple values in a WHERE clause
60
LIKE
search for a specified pattern in a column
61
%sampleword%
looks for sequence of characters of any length containing sampleword
61
_sampleword
looks for a match with only one character before sampleword
61
sampleword_
looks for a match with only one character after sampleword
61
IS NULL
checks if a value is NULL
62
IS NOT NULL
checks for non null values
62
Difference between WHERE and HAVING
WHERE: filters rows HAVING: filters groups
63
Subquery
Query inside a Query (SELECT inside a SELECT) SELECT staffNo, fName, lName, position FROM Staff WHERE branchNo=(SELECT branchNo FROM Branch WHERE street = β€˜163 Main St’)