Database Introduction PDF

Summary

This document provides an introduction to computer engineering, specifically focusing on the concept of databases. It covers database fundamentals, storage methods such as indexed files and hashing, and the Structured Query Language (SQL).

Full Transcript

Introduction to Computer Engineering 07–DATABASE Perihan Pehlivanoğlu Dr. Biruni University Computer Engineering Department 1 Database A collection of data that is multidimensional in the sense that internal links betwee...

Introduction to Computer Engineering 07–DATABASE Perihan Pehlivanoğlu Dr. Biruni University Computer Engineering Department 1 Database A collection of data that is multidimensional in the sense that internal links between its entries make the information accessible from a variety of perspectives. 9-2 Text File-LOG style 0-3 Text File-Structured Data Store 0-4 Text File-Structured Data Store 0-5 Largest Databases in the World Library of Congress 130 million items (books, photographs, maps, etc) 29 million books 10,000 new items added each day 530 miles of shelves 5 million digital documents 20 terabytes of text data AMAZON 59 million active customers More than 42 terabytes of data 6 Youtube Given: 650,000 videos per day X 30 days per month = 19,500,000 videos per month; 10 terabyte = 10,048,576 megabytes. If we assume that each video has a size of 1MB, YouTube would expect to grow 18.6 terabytes next month. Similarly, if we assume that each video has a size of 10MB, YouTube would expect to grow 186 terabytes next month. 7 AT&T United States' oldest telecommunications company AT&T maintains one of the world's largest databases. 323 terabytes of information 1.9 trillion phone call records 8 You can... Add a line to any row (INSERT) Delete a line (DELETE) Sort the table (INDEX or SQL) Find any item (SELECT SQL) in more EFFICIENT way 0-9 Figure 9.1 A file versus a database organization 9-10 Figure 9.1 A file versus a database organization 9-11 Figure 9.2 The conceptual layers of a database implementation 9-12 Database Management Systems Database Management System (DBMS): A software layer that manipulates a database in response to requests from applications https://www.youtube.com/watch?v=JZfeeyP-tCM 9-13 Database Management Systems Distributed Database: A database stored on multiple machines DBMS will mask this organizational detail from its users Data independence: The ability to change the organization of a database without changing the application software that uses it 9-14 Data independence IN writing programs in C (or C++) if you change a variable type you need to recompile it. However if source codes are not with you, this is a problem) Therefore C++ is data dependent. 15 Relational Database Model Relation: A rectangular table Attribute: A column in the table Tuple: A row in the table 9-16 Relational Database 0-17 Relational Database 0-18 Relational Database 0-19 Relational Database 0-20 Relational Database 0-21 Relational Database 0-22 Relational Database 0-23 Structured Query Language (SQL) Operations to manipulate tuples insert update delete select 9-24 SQL Examples 9-25 SQL Examples SELECT EmplId, Dept FROM Assignment, Job WHERE Assignment.JobId = Job.JobId AND Assignment.TermData = '*'; Main focus is this. % 80 of SQL Statements Uses This.. 9-26 SQL Examples 9-27 SQL Examples (continued) INSERT INTO Employee VALUES ('43212', 'Sue A. Burt', '33 Fair St.', '444661111'); DELETE FROM Employee WHERE Name = 'G. Jerry Smith'; UPDATE Employee SET Address = '1812 Napoleon Ave.' WHERE Name = 'Joe E. Baker'; 9-28 SQL Examples 9-29 SQL Examples 9-30 SQL Examples 9-31 Search in a Indexed(ordered) list 0-32 Use of Indexes 0-33 Indexed Files Index: A list of key values and the location of their associated records. An index for a file contains a list of the keys stored in the file along with entries indicating where the record containing each key is stored. 9-34 Figure 9.17 Opening an indexed file 9-35 Hashing Each record has a key field The storage space is divided into buckets A hash function computes a bucket number for each key value Each record is stored in the bucket corresponding to the hash of its key 9-36 Figure 9.18 Hashing the key field value 25X3Z to one of 41 buckets 9-37 Figure 9.18 Hashing the key field value 25X3Z to one of 41 buckets 9-38 Data Mining Data Mining: The area of computer science that deals with discovering patterns in collections of data Data warehouse: A static data collection to be mined Data cube: Data presented from many perspectives to enable mining 9-39 End of Chapter Copyright © 2015 Pearson Education, Inc.

Use Quizgecko on...
Browser
Browser