Databases MCQ Flashcards
What is Data?
A collection of facts and figures that can be processed to produce info
What is a database?
a collection of related data designed to meet the information needs of an organisation
DBMS
a database management system is the software that manages and controls access to the database.
Database application
a program that interacts with the database at some point in its execution
Database system
a collection of application programs that interacts with the database and the DBMS
Limits of file Based approach
Separation and Duplication of data
Data Dependence
Incompatible file Formats
Fixed queries
Entity
a distinct object in the org that is to be represented in the database (person,place,thing)
attribute
property that describes some aspect of the object we wish to record
relationship
an association between entities
Where is computer data stored?
In main memory (RAM)
In secondary memory (USB,Flash drives etc)
Why not always use RAM?
RAM is volatile, as it needs power to store and process data meaning when power is witched off, data is lost.
Reasons to store in disk/hard memory
Capacity
Volatility
Implications of 2 types of memory
- What data is stored
- How it is stored
- Performance of a DBMS
Meta Data
Data that describes other data
Three types of data
Processing Data,
Programs,
Meta data
Why are there many application programming languages
Application type,
language design,
data typing,
data independece
Strongly typed
In strongly typed languages, type constraints are strictly enforced by the compiler or runtime system (Java, C#, and Best eg: Arduino int,long,char)
Weakly typed
In weakly typed languages, type constraints are more relaxed, allowing for implicit type conversions and flexible operations between different types.(JavaScript, PHP, and Perl.)
Procedural language
program lists step by step the sequence of processing instructions, C, Java,Python
Non-procedural
the program states the logic required to isolate
the data, but not a procedure on how to do it. MYSQL
MYSQL is
Weakly typed and non procedural primarily
Design objectives in DBMS programs
- Implementation of logical and physical data dependence.
- Data sharing
- Strict control over data
Physical DI
(DI = data independece)independence from the physical hardware
Advantage of physical DI
Allows the program to respond to changes to any physical element within the system
Logical DI
The ability to change the logical structure of the database without affecting the application programs that access the data.
SELECT Name,address
FROM Students;
Is this a logically independent query?
Yes
Why is MYSQL non-procedural?
The SQL programmer just indicates what data is required
rather than how to get it
What’s the problem with data sharing?
if data is shared it must have a common definition to all users/applications
Two sections of MYSQL
Data Definition
Data Manipulation
Data definition (DDL)
records structures and attribute data types.(INSERT,UPDATE,CREATE)
Data Manipulation (DM)
WHERE/FROM/SELECT etc.
Order of a full sample query
SELECT
FROM
WHERE
GROUP BY
HAVING
ORDER BY