Database Basics BCIS 3680 Enterprise Programming.

Slides:



Advertisements
Similar presentations
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Advertisements

3-1 Chapter 3 Data and Knowledge Management
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSC 2720 Building Web Applications Database and SQL.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Information systems and databases Database information systems Read the textbook: Chapter 2: Information systems and databases FOR MORE INFO...
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Software Application
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Transaction Processing Systems, & Management Information Systems.
Database Systems Lecture 5 Natasha Alechina
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Introduction to Databases. Overview  What is a Database?  What is a Database Management System?  How is information organized in a database?  What.
Database Lecture # 1 By Ubaid Ullah.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Relational Data Model, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 The Relational Model Chapter 3.
ASP.NET Programming with C# and SQL Server First Edition
DATABASE. A database is collection of information that is organized so that it can easily be accessed, managed and updated. It is also the collection.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Database Technical Session By: Prof. Adarsh Patel.
Introduction to SQL Steve Perry
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
2005 SPRING CSMUIntroduction to Information Management1 Organizing Data John Sum Institute of Technology Management National Chung Hsing University.
Organizing Data and Information AD660 – Databases, Security, and Web Technologies Marcus Goncalves Spring 2013.
CODD’s 12 RULES OF RELATIONAL DATABASE
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Computer Science 101 Database Concepts. Database Collection of related data Models real world “universe” Reflects changes Specific purposes and audience.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
C6 Databases. 2 Traditional file environment Data Redundancy and Inconsistency: –Data redundancy: The presence of duplicate data in multiple data files.
M1G Introduction to Database Development 2. Creating a Database.
5-1 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
Fanny Widadie, S.P, M.Agr 1 Database Management Systems.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Introduction to Databases Queries CS 146. Sample Database: CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
Visual Programing SQL Overview Section 1.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
0 / Database Management. 1 / Identify file maintenance techniques Discuss the terms character, field, record, and table Describe characteristics.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Concept 1 Database – Organized collection of related information.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Chapter 3: Relational Databases
Howard Paul. Sequential Access Index Files and Data File Random Access.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
SQL Basics Review Reviewing what we’ve learned so far…….
Introduction to Databases Queries CS 146. Sample Database: CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Introduction to Database Programming with Python Gary Stewart
Data Resource Management Data Concepts Database Management Types of Databases Chapter 5 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Databases Chapter 16.
Database Management  .
Databases and Information Management
PHP and MySQL.
Databases and Information Management
Presentation transcript:

Database Basics BCIS 3680 Enterprise Programming

Database Concepts  A database usually consists of a number of tables.  It’s often file(s) on a hard drive or other data storage devices.  A database management system (DBMS) is the software application that is used to manage databases.  MySQL is a DBMS. 2

Table  A structured list of data of a specific type.  It describes a certain entity with various attributes.  A table must have a unique name.  There is debate regarding whether the name should be in singular or plural form.  Forta uses plural nouns.  My convention is to use singular nouns because it make more sense when it comes to draw the Entity Relationship Diagram (ERD) for the database. 3

Elements in a Table  Each record in a database is stored as a row in one of the tables, e.g., a new customer is entered as a new row in the Customer table.  Vertically, a table is made up of columns. A column is also called a “field.”  Each column defines a certain attribute of a record, e.g., name, address, phone number, etc.  All rows in the table have the same number of columns. For each record, you may enter its attributes as defined by the various columns. 4

Schema  Schema stores the “meta-data” about the table.  It defines the datatype for the information to be stored in a column – text, numbers, currency values, even large blobs of binary information.  See Appendix D for a list of MySQL datatypes.  Table and column names cannot be one of the SQL keywords (Appendix E). 5

Example of Schema 6

null  A special “value” in database. It means there is no entry in a particular field.  Regardless of the datatype for the field, null doesn’t mean –  0  0.0  Empty string  Space  It just means, there is nothing there.  If you want to force the entry in a field, you set “ no null ” for the field in your schema. 7

Primary Key  Each row in a table must have a unique identifier so that it can be stored and retrieved correctly.  This is done by defining a field (or a combination of fields) as the primary key.  For each record, the value stored in the primary key field serves as its unique ID.  No two rows in the same table may have the same value for primary key.  A primary key field cannot be null.  No all unique values are good candidate for PK. For example, changeable values like addresses are bad PKs. 8

“Sequel” to What?  Structured Query Language (SQL) is a language designed to communicate with databases.  There are minor syntax differences in implementations across different vendors (Oracle, Microsoft, IBM, MySQL AB, etc.) and even within the same vendor (Microsoft SQL Server vs. Access).  E.g., the semicolon is not always mandatory.  Syntax is not case sensitive. However, it is conventional to capitalize the keywords, e.g., SELECT … FROM …  It enhances readability of programming code and stored procedures. 9

Keywords and Clause 10 SELECT prod_name, prod_price FROM products WHERE prod_price = 2.50;  The keywords are SELECT, FROM, and WHERE.  The SELECT clause tells us that this is for data retrieval.  The FROM clause specifies which table to look for information.  The WHERE clause defines the criterion for retrieval.