0% found this document useful (0 votes)
16 views

Chapter 01-Database 3CS

Uploaded by

obida2712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Chapter 01-Database 3CS

Uploaded by

obida2712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Computer Science

Level #3

Chapter #1

Database
2020
Q1. Briefly state difference between Data, Information, and Knowledge?

Data Information Knowledge


 Unorganized fact need  Derived from data when  After put data into
to be processed. context (information),
data is processed.
 Data are raw. analyzed it, use it to take
 Pieces of information  Given a context. decision, this produce
with no context.
 E.g., average score of Knowledge.
 Can be quantitative or
qualitative. class.
 E.g., each students test
score.

Wisdom: Combine of knowledge and experience to produce a deeper understanding.

Note:

 Quantitative ‫كمية‬: Is numeric (e.g. measurement, count, mathematical


calculation).
 Qualitative ‫نوعى‬: Descriptive ‫( وصفى‬e.g. Ruby Red the color of ford focus).
 A number can be qualitative (e.g. if I tell you my favorite number is 3) ->
descriptive.

Q2. Compare between File system and DBMS.


DBMS
File System
Database Management System
Both used to manage, store, retrieve, and manipulate data.
 Earliest way to store data.  Connection Bridge between database
 Data stored directly in a set of files. and user.
 Query some data required parse each  Understand queries.
row and load it into array.  Convert query into meaningful
 line by line. command to access database.
 Inefficient and time consuming,  E.g. Oracle, Access, SQL Server.
inconsistency, lack to security.  Convenient and efficient.

1 DataBase 2020
Q3. Define Flat file. Give an example.
 A File system that contains only one table for all data separated by comma.
 E.g. CSV (Comma Separated Values) data stored as (ASCII) separated by comma.
(ASCII: American Standard Code for Information Interchange.)

Q4. State the four DBMS elements.


1) Modeling language: define the language of each database hosted in DBMS.
2) Data structures: organize the data like records, fields, files.
3) Query language: maintaining the security of database.
4) Mechanism for Transaction: allow for transaction (no record can modified by
multiple user at the same time).
Q5. Describe three levels of data abstraction.
 Physical level: Describes how records stored in database.
 Logical level: Describes data, and the relationships among this data.
 View level: User view of database, Represents data as a set of relations.

Q6. Write abbreviation of ANSISPARC then state the Three-Tier (DBMS


Schema) levels.
 ANSISPARC: American National Standards Institute, Standard Planning and
Requirements Committee.
 Three-Tier (DBMS Schema) levels.
[1] Internal level. (Physical level)
[2] Conceptual level. (Logical level)
[3] External level. (view level)

2 DataBase 2020
Q7. Describe the Three-Tier (DBMS Schema) levels Of ANSISPARC.
 External Level Schema.
 User view of database.
 Represents data as a set of relations.
 Some users should not see portions of the stored data.
 Example: Student should not see faculty salaries.
 Conceptual (Logical) Level Schema:
 Describing data stored in database and its relationships.
 Does not specify how data is physically stored.
 DBA (Database Administrator) works at this level.
 Only DBA can define this level.
 Internal Level Schema:
 Describe how data is actually stored in database.
 Involves how the database physically represented on the computer.

Q8. What is Database? State some of database platforms. State Database


models.
 Database: a collection of related tables which has relationships among them.
 Organized collection of related information.
 All data described and associated with other data.
 Made up of table, which contains rows and columns.

3 DataBase 2020
 Database Platform:
1) MySQL
2) Microsoft ACCESS
3) SQLLite
4) PostgreSQL
 Database models (determine the logical structure of database):
1) Hierarchical database.
2) Network Database.
3) Flat-file Database.
4) Relational Database.
5) Object-oriented Database.

Q9. Describe Hierarchical database model. State disadvantages.


 Hierarchical Database Model:
 Oldest database model developed by IBM.
 Structure like a tree each node representing record (row) and each branch
represent a fields (column).
 Windows registry XP is an example of hierarchical model.
 E.g. hierarchical model for university.

4 DataBase 2020
 Disadvantage:
1) Supports only one to many relationships.
2) Searching for data require DBMS to run through entire model from top to
bottom until required information is found.
3) Data stored in many different entities.

Q10. Describe Network database model. State disadvantages.


 Network database Model:
 Modified version of hierarchal model.
 Organized data more like a graph and can have more than one parent node.

 Disadvantages:
1) All records maintained using pointers (structure very complex).
2) Insert, delete, update require large number of pointer adjustments.
3) Change structure of database is very difficult.

Q11. Describe Flat File database model. State disadvantages.


 Flat File Database Model:
 Stores data in a single table.
 Generate in plain text form (each line holds only one record).
 Fields in record separated by comma.
Drink Price Company HQ Web

Coca cola 85p Coca cola Georgia Coca-colacompany.com


Pepsi 85p Pepsico New York Pepsi.com
Sprite 80p Coca cola Georgia Coca-colacompany.com
7 Up 75p Dr Pepper Texas Drpreppersnapplegroup.com
Fanta Orange 80p Coca cola Georgia Coca-colacompany.com

5 DataBase 2020
 Disadvantages:
1) Data redundancy.
2) More cost when add new data.

Q12. Describe Relational database model. State advantages.


 Relational Database Model:
 Data organized into related tables.
 Consists of three major components:
[1] Relations (table)
[2] Attributes (column)
[3] Domain (set of value can attributes take).
Table = Relation Student Attribute = Column = Field
RollNo Name Phone
1 Alex 444123
2 Aryan 421456
3 Parker 414259 Tuple = Row = Record
4 Jhon 456785
 Advantages:
1) Most popular used.
2) Changes in database structure do not affect data access.
3) Access and retrieve data more easy.
Q13. Describe Relational database model. State advantages.
 Object-Oriented Database Model:
 Information represented in a form of objects as used in OOP.
 Use inheritance, polymorphism, overloading.

6 DataBase 2020
 Advantages:
1) Handle different type of data while relational handle a single data.
2) Handle different type of data like pictures, voice, video, text, and numbers.
3) Provide reusability and flexibility.
4) Low cost.
----------------------------------- We Use Relational Database Model  ----------------------------
 Remember:
Relational Database =====>
1) Data stored in Relations (Tables).
2) Data represented by Tuples (rows, records).
3) Each tuple represent a set of related data.
4) Attributes (columns) contains domain of data.

Q14. What is the difference between Super Key, candidate key, primary
key and foreign key?
‫ عبارة عن مجموعة األعمدة (عمود واحد او اثنين او اكثر( والتي من الممكن‬Super Key 
.‫ان تعرف أي صف فريد داخل الجدول‬
‫ يتم اختياره كمفتاح‬Super Key ‫ األقل في عدد األعمدة داخل ال‬Candidate key 
.‫مرشح‬
Candidate Key‫ هو العمود الذى يتم اختياره من الـ‬Primary Key 

PK ⊂ CK ⊂ SK
‫ عباره عن عمود ال بد ان يكون مفتاح أساسي في جدول اخر ويكون‬Foreign key 
.‫من نفس النوع ويستخدم ف العالقة بين الجدولين‬

Q15. State conditions of primary key and foreign key.


 Primary Key Must Be
[1] Unique.
[2] Required.
[3] Indexed.
 Foreign Key must be:
[1] Values in a relation contains F.k must be in a relation contain P.K.
[2] F.K reference to P.K must have the same data type.

7 DataBase 2020
Q16. State several data types of fields in database.
Text Non-numeric 256 character (Char, Varchar).
Paragraph
Text longer than 256.
Text
Number Numbers, there are different type can selected (int, float, numeric).
Yes/No 1 or o (bit).
Date/ Time (Date, time).
Currency Special case of number for currency (money).
object Data cannot entered through keyboard (image, music, videos).

8 DataBase 2020
Q17. Define each of the following:
1) NOSQL:
 NotOnly SQL.
 Solve problem of large-scale database over several server.
 Unstructured data work with data in looser way, allowing unstructured
environment, communication changes to data over the time over the server.
2) Enterprise Database:
 Database sometimes installed on a single computer (or several servers
worldwide) to be accessed by a group of people at a single location.
3) Big data
 Large volume of data (structured and unstructured)
 Doug Laney define Big Data as three Vs:
[1] Volume: collect data from verity sources.
[2] Velocity: Data Stream in unprecedented speed.
[3] Variety: Data comes in all types of formats.
 There are two dimension when come big:
[1] Variability: highly inconsistent. [2] Complexity: difficult to link.
4) Metadata:
 Data about data (Stored in data dictionary).
 E.g. birthday of student is 1993 >> filed name of year of birth.
 E.g. Artist, album, and file size of an mp3 file.
5) Data Warehouse:
 Extract data from one or more organization database and load into data
warehouse (which is itself another database) for storage and analysis, this
improved take decisions.
 Constraints:
[1] Uses non-operational data. (Copy of active data).
[2] Time – variants. (time –stamp)
[3] Standardized (because come from different source).
Note Standardization achieved by ETL: Extraction Transformation Load.
6) Data mining:
 Is a process for analyzing data to find previously unknown patterns in order
to make decision.
7) Privacy concerns:
 Because increasing power of data mining caused concerned in privacy.

9 DataBase 2020

You might also like