CENG316 – Database Systems Lecture 1: Course Outline and Introduction Assist. Prof. Dr. Sedef Demirci Acknowledgement Slides taken or adapted from: Donnie Pinkston, Caltech, CS121, Lecture Slides Dr Roxana Leontie and Bhagi Narahari, CS2451 Database Systems, Lecture Slides Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems CENG316 Class Introduction Dr. Sedef Demirci Contact: sedefgunduz@gazi.edu.tr Website: https://avesis.gazi.edu.tr/sedefgunduz Course Objective After completing this course, you should be able to: • Identify the major components of database system • Create relational data models and entity-relationship (ER) diagrams • Map E-R models to relational databases • Employ basic and advanced SQL functions and queries • Run complex queries to retrieve data from multiple tables • Perform database normalization process • ..... Resources • No textbook is required for the course. • Th lecture slides contain most of the relevant topics. Resources • Following books are useful: ○ Elmas, R., Navathe, S.B., Fundamentals of Database Systems, Addison Wesley, 7th edition ○ Database: Principles, Programming, and Performance, Second Edition (The Morgan Kaufmann Series in Data Management Systems) 1st Edition ○ Database Management Systems, by Raghu Ramakrishnan and Johannes Gehrke, 3rd Edition ○ Database System Concepts Seventh Edition Avi Silberschatz Henry F. Korth S. Sudarshan, 2019 Resources • For the assignments: ○You may require download and install Oracle SQL Developer. ○The resources in the Oracle Database Online Documentation Library will be useful. Other Class Resources ○ LMS ○ TA: Res. Assist. Sümeyra Kuş sumeyrakus@gazi.edu.tr Assignment grades Grading • Assignment and pop-up quiz (may be in case of face-to-face education) = %30 • 1 midterm = %30 • Final = %40 Assignments • Submissions will be made through the online system on the due date. • Assignments may be about designing a database system and drawing E-R diagram, query writing, etc. Course Schedule (Tentative) • • • • • Feb 23 Mar 2 Mar 9 Mar 16 Mar 23 Course outline and introduction Relational database concept and data models Introduction to relational database design Relational database design using E-R model Introduction to SQL Course Schedule (Tentative) • • • • • Mar 30 Apr 6 Apr 13 Apr 20 Apr 27 Intermediate SQL Advanced SQL Query processing Ramazan Bayramı Arifesi Query optimization Course Schedule (Tentative) • • • • • May 4 May 11 May 18 May 25 Jun 1 Functional dependencies Normalization (Big) Data analytics Blockchain databases Advanced topics Today • • • • • • • • Database Terminology Why Do We Need Databases? Kinds of Databases Database Management Systems (DBMSs) Simplified Database System Environment Typical DBMS Functionalities Additional DBMS Functionalities Recent Developments Database Terminology Data • Known facts that can be recorded and have an implicit meaning. • Observations or measurements represented as text, numbers, or multimedia. Database • An organized collection of related data. Database Terminology Database Management System (DBMS) • Software that manages computerized databases ○ Create, modify, query, backup/restore, etc. • Provides an interface over the database ○ Examples: MySQL, MongoDB, Hadoop, Dynamo,…. Database System • DBMS + Data (+ Applications) Why do we need databases? Why file-based systems and file processing not adequate? • Huge amount of data are produced every day. • File-based systems do not know your data model. ○ [Name, Course, Grade] Ayşe, CENG316, AA Why do we need databases? [Name, Course, Grade] Ayşe, CENG316, AA • Query1: Find all courses taken by Sedef Demirci • Query 2: Find all of Ali’s Grades You need to write different code for these operations associated with only this file structure. Why do we need databases? Why file-based systems and file processing not adequate? • Do you want to perform new operations? ○ Create new programs to manipulate the data files! • Do you want to change the data model? ○ Update all the programs that access the data! • How to implement transactions? Security? Integrity constraints? • Can we use the same code when we change the data structure? Why do we need databases? Why file-based systems and file processing not adequate? Each application in a file-based system contains its own code for accessing and manipulating files. This causes several problems: • Code duplication of file access routines • Change in data (structure) requires change in code • High maintenance costs Why do we need databases? Why file-based systems and file processing not adequate? Each application in a file-based system contains its own code for accessing and manipulating files. This causes several problems: • Hard to support multi-user access to information • Difficult to connect information present in different files • Difficulty in developing new applications/handling data changes We study databases, because... Huge amount of data We need to effectively analyze data: • collect relevant data • store data • efficiently access data • provide programming interface We study databases, because... • Databases are everywhere in the real-world even though you do not often interact with the DBMS directly. Examples: • Retailers manage their products and sales using a database. ○ Wal-Mart has one of the largest databases in the world • Online web sites such as Amazon, eBay, Trendyol, etc.. • Social media sites ○ Facebook (PHP+MySQL), Instagram,… • The university maintains all your registration information in a database. • Lots of other examples.. We study databases, because... • Businesses: Banking, Insurance, Retail, Transportation, Healthcare, Manufacturing • Service Industries: Financial, Real-estate, Legal, Electronic Commerce, Small businesses • Education: Resources for content and Delivery • Personalized Applications: based on smart mobile devices • More recently: Social Networks, Environmental and Scientific Applications, Medicine and Genetics Kinds of Databases • There are many kinds of databases based on usage: ○ Amount of data being managed embedded databases: small, application-specific systems (e.g. SQLite, BerkeleyDB) data warehousing: vast quantities of data (e.g. Oracle) ○ Type/frequency of operations being performed OLTP: Online Transaction Processing • “Transaction-oriented” operations like buying a product or booking an airline flight OLAP: Online Analytical Processing • Storage and analysis of very large amounts of data • e.g. “What are my top selling products in each sales region?” DBMSs • In order to manage databases, we use DBMSs. ○ to store, retrieve, and run queries on data. • On the contrary of file processing, DBMSs provide data abstraction. ○ Data abstraction allows changing internal definition of an object without affecting programs that use the object through an external definition. DBMSs: Data Independence Logical data independence • Protects the user from changes in the logical structure of the data: ○ could reorganize a table without changing how we query/store it Physical data independence • Protects the user from changes in the physical structure of data: ○ could change how the table is stored in memory without changing how the user would write the query DBMSs • Provide layers of abstraction to isolate users, developers from database implementation ○ Physical level: how values are stored/managed on disk ○ Logical level: specification of records and fields ○ View level: queries and operations that users can perform (typically through applications) • Provide general-purpose database capabilities that specific applications can utilize ○ Specification of database schemas ○ Mechanism for querying and manipulating records Simplified Database System Environment Typical Database Management System Functionalities • Define a particular database in terms of its data types, structures, and constraints • Construct or load the initial database contents on a secondary storage medium • Manipulating the database: ○ Retrieval: Querying, generating reports ○ Modification: Insertions, deletions and updates to its content ○ Accessing the database through Web applications • Processing and sharing by a set of concurrent users and application programs – but, keeping all data valid and consistent Application Activities to a Database Applications interact with a database by generating: • Queries: that access different parts of data and formulate the result of a request. • Transactions: that may read some data and “update” certain values or generate new data and store that in the database. Applications must not allow unauthorized users to access data. Additional DBMS Functionalities DBMS may additionally provide: • Protection or security measures to prevent unauthorized access • Presentation and visualization of data • Maintenance of the database and associated programs over the lifetime of the database application ○ Called database, software, and system maintenance Recent Developments New database technologies are emerging to manage vast amounts of data generated on the web: • Big data storage systems involving large clusters of distributed computers • NOSQL (Not Only SQL) systems • A large amount of data now resides on the “cloud” which means it is in huge data centers using thousands of machines. Summary • Data, database, DBMS, database system • Why file storage and processing is not adequate? • Kinds of databases • Functionalities of DBMSs • Recent developments in database technology