Flexible Data Modeling in MariaDB

Size: px
Start display at page:

Download "Flexible Data Modeling in MariaDB"

Transcription

1 Flexible Data Modeling in MariaDB WHITE PAPER Part 1 Dynamic Columns

2 Table of Contents Introduction - Benefits and Limitations - Benefit - Limitations - Use Cases Dynamic Columns - Definitions - Create - Read - Indexes - Updates - Data Integrity Conclusion

3 Introduction With a history of proven reliability, relational databases are trusted to ensure the safety and integrity of data. In the digital age, where offline interactions become online interactions, data is fundamental to business success, powering mission-critical web, mobile and Internet of Things (IoT) applications and services. The safety and integrity of data has never been more important. However, the digital age is creating new challenges. It is leading to new use cases, requiring businesses to innovate faster and developers to iterate faster and diversity of data is expanding with increased use of semi-structured data in modern web and mobile applications. As a result, businesses had to decide between the reliability of relational databases and the flexibility of schemaless databases. When faced with this choice, many businesses chose to deploy multiple types of databases, increasing both the cost and complexity of their database infrastructure. With strict schema definitions and ACID transactions, relational databases ensure the safety and integrity of data. But, what if a relational database supported flexible schemas? What if a relational database could not only support semi-structured data, but could enable applications to extend or define the structure of data on demand, as needed? That s the power of MariaDB Server, ensuring data is safe for the business while at the same time supporting schema flexibility and semi-structured data for developers. With dynamic columns and JSON functions, flexible schemas and semi-structured data (e.g., JSON) can be used without sacrificing transactions and data integrity. With MariaDB, it is now possible to: Combine relational and semi-structured and/or JSON data Query semi-structured data and/or JSON data with SQL Modify semi-structured and/or JSON in an ACID transaction Extend the data model without modifying the schema first This white paper is the first in a two-part series on flexible data modeling for developers, architects and database administrators. Through sample data and queries, it explains how to create flexible schemas using dynamic columns. Part of this white paper series explains how to create flexible schemas using JSON functions. 1

4 Benefits and Limitations There are many benefits to using dynamic columns, for both the business and its developers. However, there are limitations as well. In order to benefit from flexible schemas, applications must share responsibility for managing the schema and the integrity of data. Benefits Faster time to market: develop new features without waiting for schema changes Easier development: build applications and features using simpler data models and queries More use cases: support modern and emerging use cases web, mobile and IoT Simpler infrastructure: use a single database for both legacy and modern applications Less risk: support flexible data models without sacrificing reliability, consistency and integrity Limitations Data models: complex, hierarchical data models are not supported with dynamic columns Data types: applications are responsible for managing the data types of dynamic columns Use Cases With dynamic columns, organizations in every industry from finance to retail can support modern use cases for mission-critical applications, or simplify existing use cases, by combining the flexibility of dynamic columns with the reliability of a relational database and transactions. Advertising: visitor profiles with varying attributes Finance: financial instruments with different properties Insurance: policies with unique declarations IoT: devices with many possible configurations Manufacturing: parts with different measurements Media and Entertainment: assets with different rendering and/or streaming properties Retail: products with different SKUs

5 Dynamic Columns When dynamic columns are used, different rows can have different columns. That s because every row contains a column and its value is a set of nested columns ideal for collapsing a one-to-one relationship within a single row. While every row has this column, every row can have a different value a different set of nested columns. The outer column is in the table definition. However, the inner columns are created by the application. id name format price attr 1 Tron Blu-ray 9.99 Rating Duration Aspect ratio PG :1 Foundation Paperback 7.99 Author Page count Isaac Asimov 96 Definitions To use dynamic columns, create a BLOB column for MariaDB Server to store dynamic column names and values (as name/value pairs). In the example, dynamic columns will be stored in the attr column with a NOT NULL constraint. However, a NOT NULL constraint is optional. For example, if dynamic columns were optional some rows have them, some do not. CREATE TABLE IF NOT EXISTS products ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, type VARCHAR(1) NOT NULL, name VARCHAR(40) NOT NULL, format VARCHAR(0) NOT NULL, price FLOAT(5, ) NOT NULL, attr BLOB NOT NULL); Example 1: Create a table with dynamic columns 3

6 Create To insert a row with dynamic columns, use COLUMN_CREATE with one or more name/value pairs in an INSERT statement. While the data type can be specified, it is optional. MariaDB Server can infer the data type of dynamic columns. In the example below, two products are inserted into the products_dc table: a book (Foundation) and movie (Tron). While products have a type, name, format and price, books have an author and a page count as well, while movies have a rating, duration and aspect ratio. INSERT INTO products (type, name, format, price, attr) VALUES ('M', 'Tron', 'Blu-ray', 9.99, COLUMN_CREATE('rating', 'PG-13', 'duration', 96, 'aspect_ratio', '.1:1')); INSERT INTO products (type, name, format, price, attr) VALUES ('B', 'Foundation', 'Paperback', 7.99, COLUMN_CREATE('author', 'Isaac Asimov', 'page_count', 96)); Example : Create rows with dynamic columns With the use of dynamic columns, rows for books can contain dynamic columns for the author and page count while rows for movies can contain dynamic columns for the rating, duration and aspect ratio and they are both stored in the same table. Read To read dynamic columns, use COLUMN_GET with the dynamic column name and data type. While the data type is not required to create a dynamic column, it is required to read one. In the example below, the query returns the name, format, price, rating, duration and aspect ratio of movies using COLUMN_GET for the three dynamic columns: rating, duration and aspect_ratio. SELECT name, format, price, COLUMN_GET(attr, 'rating' AS CHAR(5)) AS 'rating', COLUMN_GET(attr, 'duration' AS INTEGER) AS 'duration', COLUMN_GET(attr, 'aspect_ratio' AS CHAR(6)) AS 'aspect_ratio' WHERE type = 'M'; name format price rating duration aspect_ratio Tron Blu-ray 9.99 PG :1 Example 3: Read dynamic columns in a query (movies) 4

7 Reference: data types BINARY[(n)] CHAR[(n)] DECIMAL[(m[, d])] DOUBLE[m, d] INTEGER SIGNED [INTEGER] UNSIGNED [INTEGER] DATE DATETIME[(d)] TIME[D] In the example below, the query returns the name, format, price, author and page count of books using COLUMN_GET for the two dynamic columns: author, page_count. SELECT name, format, price, COLUMN_GET(attr, 'author' AS CHAR(0)) AS 'rating', COLUMN_GET(attr, 'page_count' AS INTEGER) AS 'page_count' WHERE type = 'B'; name format price author page_count Foundation Paperback 7.99 Isaac Asimov 96 Example 4: Read dynamic columns in a query (books) In addition, COLUMN_GET can be used in the WHERE clause. SELECT name, format, price WHERE COLUMN_GET(attr, 'rating' AS CHAR(5)) = 'PG-13'; name Tron format Blu-ray price 9.99 Example 5: Evaluate dynamic columns in the WHERE clause of a query 5

8 Note: Reading a dynamic column that does not exist In the example below, the query returns the name, format, price, rating, duration and aspect ratio of all products, including books. If the dynamic column does not exist, COLUMN_GET will return NULL, not an error. SELECT name, format, price, COLUMN_GET(attr, 'rating' AS CHAR(5)) AS 'rating', COLUMN_GET(attr, 'duration' AS INTEGER) AS 'duration', COLUMN_GET(attr, 'aspect_ratio' AS CHAR(6)) AS 'aspect_ratio' ; name format price rating duration aspect_ratio Tron Blu-ray 9.99 PG :1 Foundation Paperback 7.99 NULL NULL NULL Example 6: Read dynamic columns that do not exist in a query Tip: Reading dynamic columns as JSON objects To return dynamic columns as a JSON object, use COLUMN_JSON. The dynamic columns will be returned as name/value pairs (i.e., fields) within a JSON object. SELECT type, name, format, price, COLUMN_JSON(attr) AS 'attributes' ; id type name format price attributes 1 M Tron Blu-ray 9.99 { "rating": "PG-13", "duration": 96, "aspect_ratio": ".1:1" } B 7.99 NULL NULL { "author": "Isaac Asimov", "page_count": 96 Example 6: read dynamic columns that do not exist in a query} Example 7: Return dynamic columns as JSON objects in a query 6

9 Indexes It is not possible to create an index on a dynamic column. However, it is possible to create a virtual column (i.e., generated column) based on a dynamic column, and to index the virtual column. A virtual column can be PERSISTENT or VIRTUAL. If a virtual column is VIRTUAL, it is not stored in the database / written to disk. In the example below, a virtual column, rating, is created based on the rating dynamic column using COLUMN_ GET. ALTER TABLE products ADD COLUMN rating VARCHAR(0) AS (COLUMN_GET(attr, 'rating' AS CHAR(5))) VIRTUAL; EXPLAIN SELECT name, format, price WHERE rating = 'PG'; id select_type table ref possible_keys 1 SIMPLE products ALL NULL Example 8: Create a virtual column based on a dynamic column However, in the example above, per the explain plan, an index will not be used for the query because an index has not been created on the virtual column. In the example below, an index is created, ratings, on the rating virtual column, and per the explain plan, the query will use the index. CREATE INDEX ratings ON products(rating); EXPLAIN SELECT name, format, price WHERE rating = 'PG'; id select_type table ref possible_keys 1 SIMPLE products ALL ratings Example 9: Create an index on a virtual column based on a dynamic column 7

10 Updates To create a new dynamic column or update an existing dynamic column, use COLUMN_ADD with the dynamic column name and value. If the dynamic column exists, it will be updated. If it does not, it will be created. In the first example below, the rating dynamic column for Tron is updated. It is not PG-13, it is PG. In the second, the disks dynamic column is created for Tron. UPDATE products WHERE id = 1; SET attr = COLUMN_ADD(attr, 'rating', 'PG') SELECT name, format, price, COLUMN_GET(attr, 'rating' AS CHAR(5)) AS 'rating', COLUMN_GET(attr, 'duration' AS INTEGER) AS 'duration', COLUMN_GET(attr, 'aspect_ratio' AS CHAR(6)) AS 'aspect_ratio' WHERE id = 1; name format price rating duration aspect_ratio Tron Blu-ray 9.99 PG :1 Example 10: Update a dynamic column in an existing row UPDATE products SET attr = COLUMN_ADD(attr, 'disks', ) WHERE id = 1; SELECT name, format, price, COLUMN_GET(attr, 'disks' AS INTEGER) AS 'disks' WHERE id = 1; name format price disks Tron Blu-ray 9.99 PG-13 Example 11: Create a dynamic column in an existing row 8

11 Data Integrity While applications can create columns not defined in the table definition, data integrity can be enforced by the database using CHECK constraints, introduced in MariaDB Server 10., with dynamic column functions. In the example below, a CHECK constraint is created to ensure movies have a rating, duration and aspect ratio while books have an author and page count. And while it ensures these columns exist, it doesn t prevent the application from creating more. ALTER TABLE products ADD CONSTRAINT check_attr CHECK ( (type = 'M' and COLUMN_EXISTS(attr, 'rating') and COLUMN_EXISTS(attr, 'duration') and COLUMN_EXISTS(attr, 'aspect_ratio')) or (type = 'B' and COLUMN_EXISTS(attr, 'author') and COLUMN_EXISTS(attr, 'page_count'))); Example 1: Create a check constraint to require specific dynamic columns In the example below, the INSERT fails and returns an error because it was for a movie with a rating and duration, but without an aspect ratio - it violated the CHECK constraint. INSERT INTO products (type, name, format, price, attr) VALUES ('M', 'Tron', 'Blu-ray', 9.99, COLUMN_CREATE('rating', 'PG', 'duration', 96)); ERROR 405 (3000): CONSTRAINT 'check_attr' failed for 'test'.'products' Example 13: Violate a check constraint because a dynamic column is missing (movie) In the example below, the INSERT fails and returns an error because it was for a book with an author, but not page count - it violated the CHECK constraint. INSERT INTO products (type, name, format, price, attr) VALUES ('B', 'Foundation', 'Paperback', 7.99, COLUMN_CREATE('author', 'Isaac Asimov')); ERROR 405 (3000): CONSTRAINT 'check_attr' failed for 'test'.'products_' Example 14: Violate a check constraint because a dynamic column is missing (book) 9

12 Conclusion MariaDB Server, with dynamic columns and JSON functions, enables businesses to use a single database for both structured and semi-structured data, relational and JSON, together. It is no longer necessary to choose between data integrity and schema flexibility. When dynamic columns are used, a flexible schema can be created with a relational data model without sacrificing data integrity, transactions and SQL. MariaDB Server is a trusted, proven and reliable database, and with support for flexible schemas and semistructured data, including JSON, it meets the requirements of modern, mission-critical applications in the digital age - web, mobile and IoT. MariaDB Server helps business and developers save time and money by: Developing new features without waiting for schema changes Developing applications with simpler data models and queries Supporting current and future use cases - web, mobile and IoT Supporting both legacy and modern applications Supporting flexible data models without sacrificing data integrity Americas: sales-amer@mariadb.com Europe, Middle East, Africa: sales-emea@mariadb.com Asia Pacific: sales-apac@mariadb.com Copyright 017 MariaDB Corporation Ab, Tekniikantie 1, 0150 Espoo, Finland. MariaDB is a trademark or registered trademark of MariaDB Corporation.

Flexible Data Modeling in MariaDB

Flexible Data Modeling in MariaDB Flexible Data Modeling in MariaDB WHITE PAPER Part 2 JSON Table of Contents Introduction - Benefits and Limitations - Benefit - Limitations - Use Cases JSON Functions - Definitions - Create - Read - Indexes

More information

MARIADB & JSON: FLEXIBLE DATA MODELING

MARIADB & JSON: FLEXIBLE DATA MODELING MARIADB & JSON: FLEXIBLE DATA MODELING FEBRUARY 2019 MARIADB PLATFORM Transactions and Analytics, UNITED MariaDB Platform is an enterprise open source database for transactional, analytical or hybrid transactional/analytical

More information

Enterprise Open Source Databases

Enterprise Open Source Databases Enterprise Open Source Databases WHITE PAPER MariaDB vs. Oracle MySQL vs. EnterpriseDB MariaDB TX Born of the community. Raised in the enterprise. MariaDB TX, with a history of proven enterprise reliability

More information

Total Cost of Ownership: Database Software and Support

Total Cost of Ownership: Database Software and Support Total Cost of Ownership: Database Software and Support WHITE PAPER MariaDB TX vs. Oracle Database Enterprise Edition AUGUST 08 Table of Contents Executive Summary - MariaDB TX - Market - Analysis Enterprise

More information

JSON Support in MariaDB

JSON Support in MariaDB JSON Support in MariaDB Vicențiu Ciorbaru Software Engineer @ MariaDB Foundation * * JSON & GeoJSON JSON (Java Script Object Notation), a text based, platform independent data exchange format MariaDB Supports:

More information

Total Cost of Ownership: Database Software and Support

Total Cost of Ownership: Database Software and Support Total Cost of Ownership: Database Software and Support WHITE PAPER Enterprise vs. Database Enterprise Edition Table of Contents Executive Summary...1 Market Analysis Enterprise Requirements...2 High Availability

More information

High availability with MariaDB TX: The definitive guide

High availability with MariaDB TX: The definitive guide High availability with MariaDB TX: The definitive guide MARCH 2018 Table of Contents Introduction - Concepts - Terminology MariaDB TX High availability - Master/slave replication - Multi-master clustering

More information

Programming and Database Fundamentals for Data Scientists

Programming and Database Fundamentals for Data Scientists Programming and Database Fundamentals for Data Scientists Database Fundamentals Varun Chandola School of Engineering and Applied Sciences State University of New York at Buffalo Buffalo, NY, USA chandola@buffalo.edu

More information

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210 SQL: Concepts Todd Bacastow IST 210: Organization of Data 2/17/2004 1 Design questions How many entities are there? What are the major entities? What are the attributes of each entity? Is there a unique

More information

Introduction to Data Management CSE 344. Lecture 2: Data Models

Introduction to Data Management CSE 344. Lecture 2: Data Models Introduction to Data Management CSE 344 Lecture 2: Data Models CSE 344 - Winter 2017 1 Announcements WQ1 and HW1 are out Use your CSE ids to access the HW docs Use Piazza to post questions OHs are up on

More information

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam.

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam. Oracle 1Z0-874 MySQL 5 Database Administrator Certified Professional Exam, Part II Exam TYPE: DEMO http://www.examskey.com/1z0-874.html Examskey Oracle 1Z0-874 exam demo product is here for you to test

More information

CS121 MIDTERM REVIEW. CS121: Relational Databases Fall 2017 Lecture 13

CS121 MIDTERM REVIEW. CS121: Relational Databases Fall 2017 Lecture 13 CS121 MIDTERM REVIEW CS121: Relational Databases Fall 2017 Lecture 13 2 Before We Start Midterm Overview 3 6 hours, multiple sittings Open book, open notes, open lecture slides No collaboration Possible

More information

SQL (and MySQL) Useful things I have learnt, borrowed and stolen

SQL (and MySQL) Useful things I have learnt, borrowed and stolen SQL (and MySQL) Useful things I have learnt, borrowed and stolen MySQL truncates data MySQL truncates data CREATE TABLE pets ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, type CHAR(3) NOT NULL, PRIMARY KEY

More information

Covering indexes. Stéphane Combaudon - SQLI

Covering indexes. Stéphane Combaudon - SQLI Covering indexes Stéphane Combaudon - SQLI Indexing basics Data structure intended to speed up SELECTs Similar to an index in a book Overhead for every write Usually negligeable / speed up for SELECT Possibility

More information

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas SQL SQL Functionality stands for Structured Query Language sometimes pronounced sequel a very-high-level (declarative) language user specifies what is wanted, not how to find it number of standards original

More information

Jean-Marc Krikorian Strategic Alliance Director

Jean-Marc Krikorian Strategic Alliance Director Jean-Marc Krikorian Strategic Alliance Director JeanMarc.Krikorian@EnterpriseDB.com +1 773-383-6517 Introduction to EnterpriseDB 2 Founded in 2004 Mission: Enable the adoption of high quality Postgres

More information

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul 1 EGCI 321: Database Systems Dr. Tanasanee Phienthrakul 2 Chapter 10 Data Definition Language (DDL) 3 Basic SQL SQL language Considered one of the major reasons for the commercial success of relational

More information

CS2300: File Structures and Introduction to Database Systems

CS2300: File Structures and Introduction to Database Systems CS2300: File Structures and Introduction to Database Systems Lecture 14: SQL Doug McGeehan From Theory to Practice The Entity-Relationship Model: a convenient way of representing the world. The Relational

More information

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Background Information 2 Background Information What is a (Relational) Database 3 Dynamic collection of information. Organized into tables,

More information

Smart Data Center From Hitachi Vantara: Transform to an Agile, Learning Data Center

Smart Data Center From Hitachi Vantara: Transform to an Agile, Learning Data Center Smart Data Center From Hitachi Vantara: Transform to an Agile, Learning Data Center Leverage Analytics To Protect and Optimize Your Business Infrastructure SOLUTION PROFILE Managing a data center and the

More information

Connecting Legacy Equipment to the Industrial Internet of Things White Paper

Connecting Legacy Equipment to the Industrial Internet of Things White Paper How Protocol Conversion Addresses IIoT Challenges Connecting Legacy Equipment to the Industrial Internet of Things White Paper How Protocol Conversion Addresses IIoT Challenges Aggressive growth forecasts

More information

Principles of Data Management

Principles of Data Management Principles of Data Management Alvin Lin August 2018 - December 2018 Structured Query Language Structured Query Language (SQL) was created at IBM in the 80s: SQL-86 (first standard) SQL-89 SQL-92 (what

More information

Basic SQL. Basic SQL. Basic SQL

Basic SQL. Basic SQL. Basic SQL Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Structured

More information

Chapter 2 The relational Model of data. Relational model introduction

Chapter 2 The relational Model of data. Relational model introduction Chapter 2 The relational Model of data Relational model introduction 1 Contents What is a data model? Basics of the relational model Next : How to define? How to query? Constraints on relations 2 What

More information

SQL: Data Definition Language

SQL: Data Definition Language SQL: Data Definition Language CSC 343 Winter 2018 MICHAEL LIUT (MICHAEL.LIUT@UTORONTO.CA) DEPARTMENT OF MATHEMATICAL AND COMPUTATIONAL SCIENCES UNIVERSITY OF TORONTO MISSISSAUGA Database Schemas in SQL

More information

Constraints. Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers. John Edgar 2

Constraints. Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers. John Edgar 2 CMPT 354 Constraints Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers John Edgar 2 firstname type balance city customerid lastname accnumber rate branchname phone

More information

SQL Data Definition Language: Create and Change the Database Ray Lockwood

SQL Data Definition Language: Create and Change the Database Ray Lockwood Introductory SQL SQL Data Definition Language: Create and Change the Database Pg 1 SQL Data Definition Language: Create and Change the Database Ray Lockwood Points: DDL statements create and alter the

More information

How to Use JSON in MySQL Wrong

How to Use JSON in MySQL Wrong How to Use JSON in MySQL Wrong Bill Karwin, Square Inc. October, 2018 1 Me Database Developer at Square Inc. MySQL Quality Contributor Author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming

More information

SQL DDL II. CS121: Relational Databases Fall 2017 Lecture 8

SQL DDL II. CS121: Relational Databases Fall 2017 Lecture 8 SQL DDL II CS121: Relational Databases Fall 2017 Lecture 8 Last Lecture 2 Covered SQL constraints NOT NULL constraints CHECK constraints PRIMARY KEY constraints FOREIGN KEY constraints UNIQUE constraints

More information

DATABASE WRITEBACK. This document describes the process of setting up writeback to a database from a report within Cognos Connection.

DATABASE WRITEBACK. This document describes the process of setting up writeback to a database from a report within Cognos Connection. DATABASE WRITEBACK This document describes the process of setting up writeback to a database from a report within Cognos Connection. 19 February 2008 Page 1 of 8 1 SUMMARY... 3 2 SQL SERVER... 4 3 FRAMEWORK

More information

5. SQL Query Syntax 1. Select Statement. 6. CPS: Database Schema

5. SQL Query Syntax 1. Select Statement. 6. CPS: Database Schema 5. SQL Query Syntax 1. Select Statement 6. CPS: Database Schema Joined in 2016 Previously IT Manager at RSNWO in Northwest Ohio AAS in Computer Programming A+ Certification in 2012 Microsoft Certified

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

IBM DB2 UDB V7.1 Family Fundamentals.

IBM DB2 UDB V7.1 Family Fundamentals. IBM 000-512 DB2 UDB V7.1 Family Fundamentals http://killexams.com/exam-detail/000-512 Answer: E QUESTION: 98 Given the following: A table containing a list of all seats on an airplane. A seat consists

More information

ORACLE DATABASE 12C INTRODUCTION

ORACLE DATABASE 12C INTRODUCTION SECTOR / IT NON-TECHNICAL & CERTIFIED TRAINING COURSE In this training course, you gain the skills to unleash the power and flexibility of Oracle Database 12c, while gaining a solid foundation of database

More information

BEGINNING T-SQL. Jen McCown MidnightSQL Consulting, LLC MinionWare, LLC

BEGINNING T-SQL. Jen McCown MidnightSQL Consulting, LLC MinionWare, LLC BEGINNING T-SQL Jen McCown MidnightSQL Consulting, LLC MinionWare, LLC FIRST: GET READY 1. What to model? 2. What is T-SQL? 3. Books Online (BOL) 4. Transactions WHAT TO MODEL? What kind of data should

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE 9/27/16 DATABASE SCHEMAS IN SQL SQL DATA DEFINITION LANGUAGE SQL is primarily a query language, for getting information from a database. SFWR ENG 3DB3 FALL 2016 But SQL also includes a data-definition

More information

CMPT 354: Database System I. Lecture 2. Relational Model

CMPT 354: Database System I. Lecture 2. Relational Model CMPT 354: Database System I Lecture 2. Relational Model 1 Outline An overview of data models Basics of the Relational Model Define a relational schema in SQL 2 Outline An overview of data models Basics

More information

GlobAl EDITION. Database Concepts SEVENTH EDITION. David M. Kroenke David J. Auer

GlobAl EDITION. Database Concepts SEVENTH EDITION. David M. Kroenke David J. Auer GlobAl EDITION Database Concepts SEVENTH EDITION David M. Kroenke David J. Auer This page is intentionally left blank. Chapter 3 Structured Query Language 157 the comment. We will use similar comments

More information

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS Questions & Answers- DBMS https://career.guru99.com/top-50-database-interview-questions/ 1) Define Database. A prearranged collection of figures known as data is called database. 2) What is DBMS? Database

More information

T-SQL Training: T-SQL for SQL Server for Developers

T-SQL Training: T-SQL for SQL Server for Developers Duration: 3 days T-SQL Training Overview T-SQL for SQL Server for Developers training teaches developers all the Transact-SQL skills they need to develop queries and views, and manipulate data in a SQL

More information

The Top 20 Design Tips

The Top 20 Design Tips The Top 20 Design Tips For MySQL Enterprise Data Architects Ronald Bradford COO PrimeBase Technologies April 2008 Presented Version By: 1.1 Ronald 10.Apr.2008 Bradford 1. Know Your Technology Tools Generics

More information

user specifies what is wanted, not how to find it

user specifies what is wanted, not how to find it SQL stands for Structured Query Language sometimes pronounced sequel a very-high-level (declarative) language user specifies what is wanted, not how to find it number of standards original ANSI SQL updated

More information

Database Management

Database Management Database Management - 2013 Model Answers 1. a. A cyclic relationship type (also called recursive) is a relationship type between two occurrences of the same entity type. With each entity type in a cyclic

More information

DATA AND SCHEMA MODIFICATIONS CHAPTERS 4,5 (6/E) CHAPTER 8 (5/E)

DATA AND SCHEMA MODIFICATIONS CHAPTERS 4,5 (6/E) CHAPTER 8 (5/E) 1 DATA AND SCHEMA MODIFICATIONS CHAPTERS 4,5 (6/E) CHAPTER 8 (5/E) 2 LECTURE OUTLINE Updating Databases Using SQL Specifying Constraints as Assertions and Actions as Triggers Schema Change Statements in

More information

2.9 Table Creation. CREATE TABLE TableName ( AttrName AttrType, AttrName AttrType,... )

2.9 Table Creation. CREATE TABLE TableName ( AttrName AttrType, AttrName AttrType,... ) 2.9 Table Creation CREATE TABLE TableName ( AttrName AttrType, AttrName AttrType,... ) CREATE TABLE Addresses ( id INTEGER, name VARCHAR(20), zipcode CHAR(5), city VARCHAR(20), dob DATE ) A list of valid

More information

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language Information Systems Engineering SQL Structured Query Language DDL Data Definition (sub)language 1 SQL Standard Language for the Definition, Querying and Manipulation of Relational Databases on DBMSs Its

More information

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams Where Are We? Introduction to Data Management CSE 344 Lecture 15: Constraints We know quite a bit about using a DBMS Start with real-world problem, design ER diagram From ER diagram to relations -> conceptual

More information

Practical MySQL indexing guidelines

Practical MySQL indexing guidelines Practical MySQL indexing guidelines Percona Live October 24th-25th, 2011 London, UK Stéphane Combaudon stephane.combaudon@dailymotion.com Agenda Introduction Bad indexes & performance drops Guidelines

More information

Abstract. The Challenges. ESG Lab Review InterSystems IRIS Data Platform: A Unified, Efficient Data Platform for Fast Business Insight

Abstract. The Challenges. ESG Lab Review InterSystems IRIS Data Platform: A Unified, Efficient Data Platform for Fast Business Insight ESG Lab Review InterSystems Data Platform: A Unified, Efficient Data Platform for Fast Business Insight Date: April 218 Author: Kerry Dolan, Senior IT Validation Analyst Abstract Enterprise Strategy Group

More information

Announcements. Using Electronics in Class. Review. Staff Instructor: Alvin Cheung Office hour on Wednesdays, 1-2pm. Class Overview

Announcements. Using Electronics in Class. Review. Staff Instructor: Alvin Cheung Office hour on Wednesdays, 1-2pm. Class Overview Announcements Introduction to Databases CSE 414 Lecture 2: Data Models HW1 and WQ1 released Both due next Tuesday Office hours start this week Sections tomorrow Make sure you sign up on piazza Please ask

More information

MTAT Introduction to Databases

MTAT Introduction to Databases MTAT.03.105 Introduction to Databases Lecture #3 Data Types, Default values, Constraints Ljubov Jaanuska (ljubov.jaanuska@ut.ee) Lecture 1. Summary SQL stands for Structured Query Language SQL is a standard

More information

CS W Introduction to Databases Spring Computer Science Department Columbia University

CS W Introduction to Databases Spring Computer Science Department Columbia University CS W4111.001 Introduction to Databases Spring 2018 Computer Science Department Columbia University 1 in SQL 1. Key constraints (PRIMARY KEY and UNIQUE) 2. Referential integrity constraints (FOREIGN KEY

More information

A HOLISTIC APPROACH TO IDENTITY AND AUTHENTICATION. Establish Create Use Manage

A HOLISTIC APPROACH TO IDENTITY AND AUTHENTICATION. Establish Create Use Manage A HOLISTIC APPROACH TO IDENTITY AND AUTHENTICATION Establish Create Use Manage SIMPLE. SECURE. SMART. ALL FROM A SINGLE SOURCE. As the ways to access your organization and its sensitive data increase,

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business This is the second portion of the Database Design and Programming with SQL course. In this portion, students implement their database design by creating a

More information

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Today's Party. Example Database. Faloutsos/Pavlo CMU /615

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Today's Party. Example Database. Faloutsos/Pavlo CMU /615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications C. Faloutsos A. Pavlo Lecture#6: Fun with SQL (part2) Today's Party DDLs Complex Joins Views Nested Subqueries Triggers Database

More information

CS 327E Lecture 2. Shirley Cohen. January 27, 2016

CS 327E Lecture 2. Shirley Cohen. January 27, 2016 CS 327E Lecture 2 Shirley Cohen January 27, 2016 Agenda Announcements Homework for today Reading Quiz Concept Questions Homework for next time Announcements Lecture slides and notes will be posted on the

More information

Private Institute of Aga NETWORK DATABASE LECTURER NIYAZ M. SALIH

Private Institute of Aga NETWORK DATABASE LECTURER NIYAZ M. SALIH Private Institute of Aga 2018 NETWORK DATABASE LECTURER NIYAZ M. SALIH Data Definition Language (DDL): String data Types: Data Types CHAR(size) NCHAR(size) VARCHAR2(size) Description A fixed-length character

More information

SQL Data Definition and Data Manipulation Languages (DDL and DML)

SQL Data Definition and Data Manipulation Languages (DDL and DML) .. Cal Poly CPE/CSC 365: Introduction to Database Systems Alexander Dekhtyar.. SQL Data Definition and Data Manipulation Languages (DDL and DML) Note: This handout instroduces both the ANSI SQL synatax

More information

Creating Tables, Defining Constraints. Rose-Hulman Institute of Technology Curt Clifton

Creating Tables, Defining Constraints. Rose-Hulman Institute of Technology Curt Clifton Creating Tables, Defining Constraints Rose-Hulman Institute of Technology Curt Clifton Outline Data Types Creating and Altering Tables Constraints Primary and Foreign Key Constraints Row and Tuple Checks

More information

Workbooks (File) and Worksheet Handling

Workbooks (File) and Worksheet Handling Workbooks (File) and Worksheet Handling Excel Limitation Excel shortcut use and benefits Excel setting and custom list creation Excel Template and File location system Advanced Paste Special Calculation

More information

Introduction to Databases CSE 414. Lecture 2: Data Models

Introduction to Databases CSE 414. Lecture 2: Data Models Introduction to Databases CSE 414 Lecture 2: Data Models CSE 414 - Autumn 2018 1 Class Overview Unit 1: Intro Unit 2: Relational Data Models and Query Languages Data models, SQL, Relational Algebra, Datalog

More information

MySQL 5.0 Certification Study Guide

MySQL 5.0 Certification Study Guide MySQL 5.0 Certification Study Guide Paul DuBois, Stefan Hinz, and Carsten Pedersen MySQC Press 800 East 96th Street, Indianapolis, Indiana 46240 USA Table of Contents Introduction 1 About This Book 1 Sample

More information

System Pages (Setup Admins Only)

System Pages (Setup Admins Only) System Pages (Setup Admins Only) 1 Primary System Pages 2 More on Page Views & Sub Page Views 3 4 System Lookup Pages 5 6 7 Distinguishing Tables, Pages, Filtered Pages, & Page Views 8 9 Reasons to Create

More information

Shine a Light on Dark Data with Vertica Flex Tables

Shine a Light on Dark Data with Vertica Flex Tables White Paper Analytics and Big Data Shine a Light on Dark Data with Vertica Flex Tables Hidden within the dark recesses of your enterprise lurks dark data, information that exists but is forgotten, unused,

More information

Hitachi Enterprise Cloud Container Platform

Hitachi Enterprise Cloud Container Platform Hitachi Enterprise Cloud Container Platform Accelerate Enterprise Cloud-Native Development Initiatives SOLUTION PROFILE Cloud-native application development is synonymous with the modern scalable, real-time

More information

Create a simple database with MySQL

Create a simple database with MySQL Create a simple database with MySQL 1.Connect the MySQL server through MySQL Workbench You can achieve many database operations by typing the SQL langue into the Query panel, such as creating a database,

More information

Pagina 1 di 5 13.1.4. INSERT Syntax 13.1.4.1. INSERT... SELECT Syntax 13.1.4.2. INSERT DELAYED Syntax INSERT [LOW_PRIORITY DELAYED HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES ({expr

More information

BlackBerry Enterprise Identity

BlackBerry Enterprise Identity Datasheet BlackBerry Enterprise Identity The Challenge: Cloud services are critical in today s enterprises, yet a reliance on the cloud comes with real and growing security risks. Enterprises want a simple,

More information

SELECT Product.name, Purchase.store FROM Product JOIN Purchase ON Product.name = Purchase.prodName

SELECT Product.name, Purchase.store FROM Product JOIN Purchase ON Product.name = Purchase.prodName Announcements Introduction to Data Management CSE 344 Lectures 5: More SQL aggregates Homework 2 has been released Web quiz 2 is also open Both due next week 1 2 Outline Outer joins (6.3.8, review) More

More information

Code Centric: T-SQL Programming with Stored Procedures and Triggers

Code Centric: T-SQL Programming with Stored Procedures and Triggers Apress Books for Professionals by Professionals Sample Chapter: "Data Types" Code Centric: T-SQL Programming with Stored Procedures and Triggers by Garth Wells ISBN # 1-893115-83-6 Copyright 2000 Garth

More information

Borland InterBase and MySQL

Borland InterBase and MySQL Borland InterBase and MySQL A technical comparison A Borland White Paper By Bill Todd, The Database Group March 2004 Contents Executive summary... 3 Introduction... 3 Choosing the right database for your

More information

Relational Query Languages. Preliminaries. Formal Relational Query Languages. Example Schema, with table contents. Relational Algebra

Relational Query Languages. Preliminaries. Formal Relational Query Languages. Example Schema, with table contents. Relational Algebra Note: Slides are posted on the class website, protected by a password written on the board Reading: see class home page www.cs.umb.edu/cs630. Relational Algebra CS430/630 Lecture 2 Relational Query Languages

More information

SQL OVERVIEW. CS121: Relational Databases Fall 2017 Lecture 4

SQL OVERVIEW. CS121: Relational Databases Fall 2017 Lecture 4 SQL OVERVIEW CS121: Relational Databases Fall 2017 Lecture 4 SQL 2 SQL = Structured Query Language Original language was SEQUEL IBM s System R project (early 1970 s) Structured English Query Language Caught

More information

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage

Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage Part 1: IoT demo Part 2: MySQL, JSON and Flexible storage $ node particle_mysql_all.js Starting... INSERT INTO cloud_data_json (name, data) values ('particle', '{\"data\":\"null\",\"ttl\":60,\"published_at\":\"2017-09-28t19:40:49.869z\",\"coreid\":\"1f0039000947343337373738

More information

THE UNIVERSITY OF AUCKLAND

THE UNIVERSITY OF AUCKLAND VERSION 1 COMPSCI 280 THE UNIVERSITY OF AUCKLAND SECOND SEMESTER, 2015 Campus: City COMPUTER SCIENCE Enterprise Software Development (Time allowed: 40 minutes) NOTE: Enter your name and student ID into

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

Tanium Asset User Guide. Version 1.3.1

Tanium Asset User Guide. Version 1.3.1 Tanium Asset User Guide Version 1.3.1 June 12, 2018 The information in this document is subject to change without notice. Further, the information provided in this document is provided as is and is believed

More information

The Relational Model of Data (ii)

The Relational Model of Data (ii) ICS 321 Fall 2013 The Relational Model of Data (ii) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 1 Defining Relational Schema in SQL Two aspects: Data

More information

DB Fundamentals Exam.

DB Fundamentals Exam. IBM 000-610 DB2 10.1 Fundamentals Exam TYPE: DEMO http://www.examskey.com/000-610.html Examskey IBM 000-610 exam demo product is here for you to test the quality of the product. This IBM 000-610 demo also

More information

Waypoint Leasing. A Global Helicopter Leasing Company

Waypoint Leasing. A Global Helicopter Leasing Company Waypoint Leasing A Global Helicopter Leasing Company Waypoint Overview We put operators first always. Waypoint approaches its role as a financial intermediary and provider of helicopters provides financing

More information

10/18/2017. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414

10/18/2017. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414 Announcements Database Systems CSE 414 Lecture 11: NoSQL & JSON (mostly not in textbook only Ch 11.1) HW5 will be posted on Friday and due on Nov. 14, 11pm [No Web Quiz 5] Today s lecture: NoSQL & JSON

More information

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation MIDTERM EXAM 2 Basic

More information

Query Optimization, part 2: query plans in practice

Query Optimization, part 2: query plans in practice Query Optimization, part 2: query plans in practice CS634 Lecture 13 Slides by E. O Neil based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke Working with the Oracle query optimizer First

More information

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015

MySQL Query Tuning 101. Sveta Smirnova, Alexander Rubin April, 16, 2015 MySQL Query Tuning 101 Sveta Smirnova, Alexander Rubin April, 16, 2015 Agenda 2 Introduction: where to find slow queries Indexes: why and how do they work All about EXPLAIN More tools Where to find more

More information

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1 SQL Fundamentals Chapter 3 Class 03: SQL Fundamentals 1 Class 03: SQL Fundamentals 2 SQL SQL (Structured Query Language): A language that is used in relational databases to build and query tables. Earlier

More information

Writing High Performance SQL Statements. Tim Sharp July 14, 2014

Writing High Performance SQL Statements. Tim Sharp July 14, 2014 Writing High Performance SQL Statements Tim Sharp July 14, 2014 Introduction Tim Sharp Technical Account Manager Percona since 2013 16 years working with Databases Optimum SQL Performance Schema Indices

More information

Referential Integrity and Other Table Constraints Ray Lockwood

Referential Integrity and Other Table Constraints Ray Lockwood DDL Referential Integrity and Other Table s Pg 1 Referential Integrity and Other Table s Ray Lockwood Points: Referential Integrity assuring tables remain properly linked by primary and foreign keys. Referential

More information

Make the most of your Energy from Power Plant to Plug. Chris Simard, Regional Director Field Sales Group

Make the most of your Energy from Power Plant to Plug. Chris Simard, Regional Director Field Sales Group Make the most of your Energy from Power Plant to Plug Chris Simard, Regional Director Field Sales Group We see six key challenges facing our world Connectivity Simplicity Globalization Demand For Energy

More information

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1 Basic Concepts :- 1. What is Data? Data is a collection of facts from which conclusion may be drawn. In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished

More information

Databases 1. Defining Tables, Constraints

Databases 1. Defining Tables, Constraints Databases 1 Defining Tables, Constraints DBMS 2 Rest of SQL Defining a Database Schema Primary Keys, Foreign Keys Local and Global Constraints Defining Views Triggers 3 Defining a Database Schema A database

More information

CSCI3030U Database Models

CSCI3030U Database Models CSCI3030U Database Models CSCI3030U RELATIONAL MODEL SEMISTRUCTURED MODEL 1 Content Design of databases. relational model, semistructured model. Database programming. SQL, XPath, XQuery. Not DBMS implementation.

More information

G64DBS Database Systems. Lecture 6 More SQL Data. Creating Relations. Column Constraints. Last Lecture s Question

G64DBS Database Systems. Lecture 6 More SQL Data. Creating Relations. Column Constraints. Last Lecture s Question G6DBS Database Systems Lecture 6 More SQL Data Tim Brailsford Creating Relations From last lecture.. CREATE TABLE CREATE TABLE ( , ) Column definitions are made

More information

DS Introduction to SQL Part 1 Single-Table Queries. By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford)

DS Introduction to SQL Part 1 Single-Table Queries. By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford) DS 1300 - Introduction to SQL Part 1 Single-Table Queries By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford) Overview 1. SQL introduction & schema definitions 2. Basic single-table

More information

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object.

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object. 1 WHAT IS A DATABASE? A database is any organized collection of data that fulfills some purpose. As weather researchers, you will often have to access and evaluate large amounts of weather data, and this

More information

The Relational Model and SQL

The Relational Model and SQL Databases 2009 Michael I. Schwartzbach Computer Science, University of Aarhus 1 What is a Database? Main Entry: da ta base Pronunciation: \dā-tə-bās, da- also dä-\ Function: noun Date: circa 1962 : a usually

More information

Lab 4: Tables and Constraints

Lab 4: Tables and Constraints Lab : Tables and Constraints Objective You have had a brief introduction to tables and how to create them, but we want to have a more in-depth look at what goes into creating a table, making good choices

More information

Comp 5311 Database Management Systems. 4b. Structured Query Language 3

Comp 5311 Database Management Systems. 4b. Structured Query Language 3 Comp 5311 Database Management Systems 4b. Structured Query Language 3 1 SQL as Data Definition Language Creates the Students relation. The type (domain) of each field is specified, and enforced by the

More information

Relational Algebra. Note: Slides are posted on the class website, protected by a password written on the board

Relational Algebra. Note: Slides are posted on the class website, protected by a password written on the board Note: Slides are posted on the class website, protected by a password written on the board Reading: see class home page www.cs.umb.edu/cs630. Relational Algebra CS430/630 Lecture 2 Slides based on Database

More information

Mobile MOUSe MTA DATABASE ADMINISTRATOR FUNDAMENTALS ONLINE COURSE OUTLINE

Mobile MOUSe MTA DATABASE ADMINISTRATOR FUNDAMENTALS ONLINE COURSE OUTLINE Mobile MOUSe MTA DATABASE ADMINISTRATOR FUNDAMENTALS ONLINE COURSE OUTLINE COURSE TITLE MTA DATABASE ADMINISTRATOR FUNDAMENTALS COURSE DURATION 10 Hour(s) of Self-Paced Interactive Training COURSE OVERVIEW

More information