Standard Query Language: Current standard Logical Schema Design: Schema Definition with SQL (DDL)

Similar documents
3.2.4 Enforcing constraints

4 Schema Definition with SQL / DDL (II)

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

Basic SQL. Basic SQL. Basic SQL

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

DBS 2006: 1 st week. DBS 2006: Plan. DB Life-Cycle: Requirement analysis. Data modelling: Conceptual Design. Logical Schema Design

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity

Lab # 2 Hands-On. DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

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

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

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

BASIC SQL CHAPTER 4 (6/E) CHAPTER 8 (5/E)

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

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

Information Systems for Engineers Fall Data Definition with SQL

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p:// Lecture 3

Database Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

SQL Introduction. CS 377: Database Systems

Full file at

BASIC SQL CHAPTER 4 (6/E) CHAPTER 8 (5/E)

Using DDL Statements to Create and Manage Tables. Copyright 2004, Oracle. All rights reserved.

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

Using DDL Statements to Create and Manage Tables. Copyright 2004, Oracle. All rights reserved.

SQL Constraints and Triggers. Week 11

Using DDL Statements to Create and Manage Tables. Copyright 2006, Oracle. All rights reserved.

Lab # 4. Data Definition Language (DDL)

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1

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

Outline. Textbook Chapter 6. Note 1. CSIE30600/CSIEB0290 Database Systems Basic SQL 2

COGS 121 HCI Programming Studio. Week 03 - Tech Lecture

Relational Model. CSE462 Database Concepts. Demian Lessa. Department of Computer Science and Engineering State University of New York, Buffalo

user specifies what is wanted, not how to find it

CSIE30600 Database Systems Basic SQL 2. Outline

Slides by: Ms. Shree Jaswal

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

A <column constraint> is a constraint that applies to a single column.

Bonus Content. Glossary

MySQL Introduction. By Prof. B.A.Khivsara

Overview of MySQL Structure and Syntax [2]

Data and Tables. Bok, Jong Soon

SQL:1999 additional features. Object-oriented concepts Object relational concepts in SQL:1999 Active database concepts Active concepts in SQL:1999

How to define a relational schema for a data base?

CSCC43H: Introduction to Databases. Lecture 4

SQL Commands & Mongo DB New Syllabus

SQL Data Definition Language

Content: How to transform the relational model into a database schema DDL: create table students(studentnr int, name varchar);

Creating and Managing Tables Schedule: Timing Topic

SQL OVERVIEW. CS121: Relational Databases Fall 2017 Lecture 4

Database Management Systems,

CS143: Relational Model

Principles of Data Management

618 Index. BIT data type, 108, 109 BIT_LENGTH, 595f BIT VARYING data type, 108 BLOB data type, 108 Boolean data type, 109

Data Definition Language (DDL)

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

HOW TO CREATE AND MAINTAIN DATABASES AND TABLES. By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL

The Relational Model. Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC)

INFORMATION TECHNOLOGY NOTES

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

MTAT Introduction to Databases

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates

SQL: Data Definition Language

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama

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

Chapter # 7 Introduction to Structured Query Language (SQL) Part I

Basis Data Terapan. Yoannita

Chapter 8 How to work with data types

Structured Query Language (SQL)

Database Programming with PL/SQL

COMP 430 Intro. to Database Systems

The Structured Query Language Get Started

Relational Database Systems Part 01. Karine Reis Ferreira

Physical Design of Relational Databases

Tool/Web URL Features phpmyadmin. More on phpmyadmin under User Intefaces. MySQL Query Browser

Data Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time.

The Relational Model of Data (ii)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL)

Daffodil DB. Design Document (Beta) Version 4.0

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

GridDB Advanced Edition SQL reference

SQL: A COMMERCIAL DATABASE LANGUAGE. Complex Constraints

Chapter 3: Introduction to SQL

SQL DATA DEFINITION LANGUAGE

Requirement Analysis & Conceptual Database Design

General References on SQL (structured query language) SQL tutorial.

The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014

Private Institute of Aga NETWORK DATABASE LECTURER NIYAZ M. SALIH

An Introduction to Structured Query Language

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

An Introduction to Structured Query Language

An Introduction to Structured Query Language

SQL: The Query Language Part 1. Relational Query Languages

An Introduction to Structured Query Language

SQL: Data Definition Language. csc343, Introduction to Databases Diane Horton Fall 2017

The SQL data-definition language (DDL) allows defining :

Transcription:

Standard Query Language: Current standard Logical Schema Design: Schema Definition with SQL (DDL) 1999: standard (ANSI SQL-3) about 2200 pages as full standard SQL history and standards SQL type system Specifying constraints with SQL Various parts (not finished): Framework (SQL/Framework), introduction Foundation (SQL/Foundation), core SQL Call-Level Interface (SQL/CLI), ODBC 3 Persistent Stored Modules (SQL/PSM), stored procedures Host Language Bindings (SQL/ Bindings), embedded SQL Temporal data (SQL/Temporal) Management of external data (SQL/MED) Object Language Bindings (SQL/OLB), embedded SQL- Java Multimedia (SQL/MM), full-text and spatial data SQL and XML 4 Standard Query Language: Introduction Standard Query Language: Standards No pure relations in DBMS but tables Duplicate data not deleted Tuples rows, Attributes columns SQL-92 compliance levels: (1) Entry SQL: basically SQL-89, essential (2) Intermediate SQL, (3) Full SQL No implementation of SQL-92 on level 2 or3 Standard Query Language (SQL) Declarative language for DB Available in all relational DBMS Support of two interfaces: Interactive Interface: User friendly Interface (UFI) Application-program Interface: embedded SQL 2 levels: SQL: essential for standard compliance Additional Features, e.g. multimedia enhanced New standards replace old ones In DBMS implementations much added / left out 5 Standard Query Language: History Standard Query Language: Course Information 1974 1975 1986 1989 1992 Prototype System R (IBM, San Jose) First relational DBMS based on Codd s relational model Structured English Query Language (SEQUEL) SEQUEL renamed SQL (pronounced Sequel in US) First standardization attempt based on system R SQL standard ANSI SQL-1, SQL-89 about 120 pages SQL2 standard ANSI SQL-2, SQL-92 about 600 pages 3 Within the course: Basic concepts of Oracle10i (commercial) compliant + additional features PostgreSQL (open source) compliant MySQL (open source) traditionally not SQL compliant (no subqueries, foreign keys, ) Self study of further SQL concepts 6 1

Standard Query Language: Components SQL / DDL: Namespaces Data definition Language (DDL) Definition and change of data structures on all three database levels: Namespaces, relations with attributes, domains, data types, integrity constraints, triggers, functions on the database,views, placement of data, space needed, access structures, Data manipulation language (DML) Create, change, delete data Interactive query formulation Embedding of SQL commands in host language Specification of begin, abort, and end of transaction Data Administration language Access rights, authorization 7 Confusing terminology implemented Oracle Database = set of physical storage areas ("tablespaces") Schema name = dbusername Object names prefixed with <dbusername> PostgreSQL Database = schema Schema name = database name MySQL Database = directory in File system where data rese Schema not defined in MySQL 10 SQL / DDL: SQL Objects SQL / DDL: Predefined data types Catalog, schema, table, trigger, Descriptor = Object entificator (e.g., name) Object hierarchy: catalog schema Basic data types: Numbers Characters, strings Date and time Binary objects table Catalog: Named group of schemas Created implicitly column 8 Type systems of different DBS very different Use standard compatible types if possible 11 SQL / DDL: Schema Named group of SQL-objects by particular user Creates namespace Unambiguous object names <catalog>.<schema>.<table>.<column> <catalog>.<schema>.<trigger> SQL / DDL: Predefined data types Numeric data types NUMERIC(p,s) e.g. 300.00 DECIMAL(p,s) INTEGER (alias: INT) e.g. 32767 SMALLINT small integers FLOAT(p,s) e.g. -1E+03 REAL (for short floats) DOUBLE (for long floats) Not supported by all systems Always supported: <table>.<column> Syntax: CREATE SCHEMA <schemaname>; 9 Oracle: NUMBER(precision, scale) PostgreSQL: SMALLINT, INTEGER, BIGINT, REAL, NUMERIC(precision,scale), DECIMAL(precision, scale), MONEY, SERIAL (=autoincrement!) MySQL: TINYINT[(M)], SMALLINT[(M)], MEDIUMINT[(M)], INT[(M)], BIGINT[(M)], FLOAT(precision), FLOAT[(M,D)], DOUBLE[(M,D)], DOUBLE PRECISION[(M,D)], REAL[(M,D)], DECIMAL[(M[,D])], NUMERIC[(M[,D])] 12 2

SQL / DDL: Predefined data types SQL / DDL: Domain definition, Type definition Some string data types CHARACTER(n) (fixed length) CHARACTER (variable lenght) CHARACTER VARYING(n) (alias: VARCHAR(n)) CLOB (Character Large Object, e.g., for large text), NCLOB (National CLOB) Oracle: VARCHAR2(size), CHAR(size), CLOB, RAW, LONG RAW PostgreSQL: CHARACTER(size), CHAR(size), VARYING(size), VARCHAR(size), TEXT MySQL: CHAR(M), VARCHAR(M), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT 13 User-created domains Named sets of values Helps avoing semantically meaningless operations, e.g., comparing money with length attributes Syntax: CREATE DOMAIN <domainname> [AS] <typedef>; CREATE TYPE <typename> as <typedef> FINAL; Example: CREATE DOMAIN Money AS DECIMAL(10,2 CREATE TYPE Euro AS DECIMAL(8,2) FINAL; Oracle: hdomain - not supp., Type implemented differently PostgreSQL: hdomain supp.,type implemented differently MySQL: hdomain - not supp., Type not supp. 16 SQL / DDL: Predefined data types SQL / DDL: Table definition Date data types DATE e.g. DATE '1993-01-02' TIME e.g. TIME '13:14:15' TIMESTAMP e.g. TIMESTAMP '1993-01-02 13:14:15.000001' INTERVAL FirstUnitofTime [to LastUnitofTime] e.g. INTERVAL '01-01' YEAR TO MONTH Oracle: DATE, INTERVAL DAY TO SECOND, INTERVAL YEAR TO MONTH, TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE PostgreSQL: DATE, TIME, TIME WITH TIMEZONE, TIMESTAMP, INTERVAL MySQL: DATE, DATETIME, TIMESTAMP[(M)], TIME, YEAR[(2 4)] 14 Syntax: CREATE TABLE <TableName> ( <attributname><attributetype>[<constraint>] [, <attributname><attributetype>[<constraint>]] {, <tableconstraints>} Example: CREATE TABLE Troll( Name CHAR(10) primary key, Height DECIMAL (3,2) SQL is case-insensitive for restricted words 17 SQL / DDL: Predefined data types Binary data types BIT[(n)] e.g. B'01000100' BLOB[(n)] e.g. X'49FE' (Binary Large Objects, e.g., for multimedia) Oracle: BLOB, BFILE, RAW, LONG RAW, ROWID PostgreSQL: TEXT, BYTEA, or in large object MySQL: TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB Additionally: BOOLEAN (true, false or unknown) 15 Syntax: [CONSTRAINT [<name>]]<def> Important technique Column constraints Example: must not be NULL, larger than 1.50 Specified as part of column definition Cardinalities Column constraints on keys and foreign keys Complex semantic constraints ("business rules") Example: "The percentage of movies not older than one year must be 25% or more More than one row involved, specify after column definitions (table constraint) 18 3

PRIMARY KEY Only once per table Not necessary, but omission is very bad style Column constraint (single attribute) or table constraint Examples: CREATE TABLE Troll( Name CHAR(10) primary key, Height DECIMAL (3,2) Column constraint: CREATE TABLE BankAccount( accountno NUMBER(10) primary key, amount DECIMAL(9,2) CHECK (amount > 0), credit DECIMAL(7,2) Multicolumn constraint: CREATE TABLE Troll( Name CHAR(10) primary key, Height DECIMAL (3,2), Weight INTEGER, CONSTRAINT pk primary key(name, Height) 19 CREATE TABLE BankAccount( accountno NUMBER(10) primary key, amount DECIMAL(9,2), credit DECIMAL(7,2), CONSTRAINT account CHECK (amount+credit>0) 22 SQL / DDL: Referential Integrity NOT NULL Value must not be NULL Column constraint Example: CREATE TABLE Format ( name CHAR(10) primary key, charge DECIMAL(3,2) not NULL UNIQUE Column contains only unique values Requires NOT NULL Should be used for candate keys Column constraint, (table constraint) 20 Foreign Key Important concept Conser relation R with key k and relation S fk S is foreign key if for all tuples s S holds: 1. s.fk contains only NULL values or only values NULL 2. If s.fk contains no NULL values tuple r R: s.fk=r.k Referential integrity: Foreign key constraint (above) holds Referential Integrity in SQL Candate keys with UNIQUE Primary keys with PRIMARY KEY Foreign keys with REFERENCES 23 CHECK clause: Defines predicates that must hold for each row Enumeration: CHECK( VALUES IN ('comedy','suspense', 'drama','action', SciFi')) Interval restriction: CHECK(Charge >= 0 AND Charge < 10) 21 FOREIGN KEY Important technique References keys in other tables Ensures references to existing key values only CREATE TABLE Tape( INTEGER PRIMARY KEY, format CHAR(5) NOT NULL, movie_ INTEGER NOT NULL, CONSTRAINT tapenotempty FOREIGN KEY (movie_) REFERENCES Movie(), CONSTRAINT formatcheck FOREIGN KEY (format) REFERENCES Format(name) 24 4

Important technique FOREIGN KEY prevents execution of SQL statements which violate Referential Integrity Update and delete may cause violation Cardinality constraints Tape (1,1) (1,*) hold Movie Define actions: On delete cascade: delete all referencing tuples On delete set NULL On delete set default On update cascade: update key in referencing table On update set NULL On update set default 25 NOT NULL ensures min = 1 CREATE TABLE Tape( INTEGER PRIMARY KEY, format CHAR(10) NOT NULL, movie_ INTEGER NOT NULL, CONSTRAINT tapenotempty FOREIGN KEY (movie_) REFERENCES Movie(), CONSTRAINT formatcheck FOREIGN KEY (format) REFERENCES Format(name) 28 Example: CREATE TABLE Tape( INTEGER PRIMARY KEY, format CHAR(5) NOT NULL, movie_ INTEGER NOT NULL, CONSTRAINT tapenotempty FOREIGN KEY (movie_) REFERENCES Movie() ON DELETE CASCADE, CONSTRAINT formatcheck FOREIGN KEY (format) REFERENCES Format(name) ON DELETE SET NULL Tape Movie 0001 0004 0005 0009. format DVD DVD VHS VHS. movie_ 095. 095 title Psycho Star Wars I 26 Cardinality constraints Country NOT NULL ensures min = 1 UNIQUE ensures max= 1 (1,1) (0,1) is_mayor Person CREATE TABLE Country( INTEGER PRIMARY KEY, mayor INTEGER UNIQUE NOT NULL, CONSTRAINT mayorfk FOREIGN KEY (mayor) REFERENCES Person() 29 Example: Example: (1,*) born_in (1,1) Tape format movie_ Movie title Country Person 0001 DVD 095 0004 DVD 0005 VHS 0009 VHS... Delete from Movie Where = ; Tape format movie_ 0001 DVD 095... 095 095 Psycho Star Wars I Movie title Psycho 27 (1,1) (0,1) is_mayor How to define circular constraints? Specify constraints after table definition ALTER TABLE Person ADD (CONSTRAINT birthplacereference FOREIGN KEY (birthplace) REFERENCES country() ALTER TABLE Person MODIFY COLUMN( birthplace not null 30 5

The Chicken-Egg problem CREATE TABLE chicken(cid INT PRIMARY KEY, eid INT CREATE TABLE egg(eid INT PRIMARY KEY, cid INT -- Example by J. Wom et al. ALTER TABLE chicken ADD CONSTRAINT chickenrefegg FOREIGN KEY (eid) REFERENCES egg(eid ALTER TABLE egg ADD CONSTRAINT eggrefchicken FOREIGN KEY (cid) REFERENCES chicken(cid) ; What happens if an egg / chicken is inserted? 31 Trigger Specify trigger on table Movie: CREATE TRIGGER alwaystape AFTER INSERT ON Movie REFERENCING NEW ROW AS m FOR EACH ROW WHEN NOT EXISTS ( SELECT * From Tape WHERE movie_=m.) <do something>; Very flexible and expressive Later more 34 SQL / DDL: Alter table definitions Insertion violates foreign key constraint INSERT INTO chicken VALUES(1, 2 ORA-02291: integrity constraint (chickenrefegg.sys_c0067174) violated - parent key not found INSERT INTO egg VALUES(2, 1 ORA-02291: integrity constraint (eggrefchicken.sys_c0067174) violated - parent key not found Defer constraint checking ALTER TABLE chicken ADD CONSTRAINT chickenrefegg FOREIGN KEY (eid) REFERENCES egg(eid) INITIALLY DEFERRED DEFERRABLE; 32 Syntax: ALTER TABLE<tableName><redefinition>; Add an attribute ALTER TABLE Tape ADD COLUMN (AquiredBy char(20) Change an attribute Attribute names cannot be changed ALTER TABLE Tape MODIFY (AquiredBy char(30) Add constraints, 35 SQL / DDL: More statements Deferred constraints checked at the end of a transaction. Transaction: unit of work consisting of one or more operations on the DB Delete table Delete table only if not referenced DROP TABLE <tablename> restrict COMMIT closes a transaction Delete table and reference INSERT INTO chicken VALUES(1, 2 -- constraint not checked here INSERT INTO egg VALUES(2, 1 COMMIT; -- but here DROP TABLE <tablename> cascade; Oracle: DROP TABLE <tablename> cascade constraints; Variants INITIALLY DEFERRED DEFERRABLE INITIALLY IMMEDIATE DEFERRABLE SET CONSTRAINT <name> [DEFERED IMMEDIATE] allow checking at arbitrary times 33 Attributes can have default values <attributename> <attributetype> DEFAULT <value> 36 6

SQL / DDL: Example SQL / DDL: Example CREATE TABLE Movie ( INTEGER PRIMARY KEY, title VARCHAR(60) NOT NULL, category CHAR(10), year DATE, director VARCHAR(30), pricepday DECIMAL(4,2), length INTEGER, CONSTRAINT plausible_year CHECK (year > TO_DATE('01.01.1900','DD.MM.YYYY')), CONSTRAINT allowedprice CHECK ( (pricepday >= 0) AND (pricepday < 100.0)) 37 CREATE TABLE Customer ( mem_no INTEGER PRIMARY KEY, last_name VARCHAR (30) NOT NULL, first_name VARCHAR(20), address VARCHAR (60), telephone VARCHAR (15) CREATE TABLE Rental( tape_ INTEGER, mem_no INTEGER, from_date DATE NOT NULL, until_date DATE, PRIMARY KEY (tape_, mem_no, from_date), CONSTRAINT fk_tape FOREIGN KEY (tape_) REFERENCES Tape(), CONSTRAINT fk_customer FOREIGN KEY (mem_no) REFERENCES Customer(mem_no) 40 SQL / DDL: Example SQL / DDL: Implementations CREATE TABLE Format( Name CHAR(5) primary key, Charge DECIMAL (3,2) Oracle PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN KEY, REFERENCES, CHECK supported Unique artificial key values: use sequence-object CREATE TABLE Tape( INTEGER PRIMARY KEY, format CHAR(5) NOT NULL, movie_ INTEGER NOT NULL, CONSTRAINT tapenotempty FOREIGN KEY (movie_) REFERENCES Movie() ON DELETE CASCADE, CONSTRAINT formatcheck FOREIGN KEY (format) REFERENCES Format(name) ON DELETE SET NULL 38 PostgresSQL PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN KEY, REFERENCES, CHECK supported Unique artificial key values: serial data type and sequences MySQL: PRIMARY KEY, NOT NULL, UNIQUE supported FOREIGN KEY, REFERENCES, CHECK accepted (for compatibility) but not supported Unique artificial key values: AUTO_INCREMENT Many changes in new versions (!) 41 SQL / DDL: Example SQL / DDL: Metadata management CREATE TABLE Actor ( stage_name VARCHAR(30)NOT NULL UNIQUE, real_name VARCHAR(30), birthday DATE CREATE TABLE Play ( movie_ INTEGER, actor_name VARCHAR(30), CONSTRAINT pkstarr PRIMARY KEY (movie_, actor_name), CONSTRAINT foreignkeymovieid FOREIGN KEY (movie_) REFERENCES Movie (), CONSTRAINT foreignkeystagename FOREIGN KEY (actor_name) REFERENCES Actor(stage_name) 39 Metadata: SQL object definitions Stored in system data structures ("the catalogue ) Mostly accessed as tables All user-tables: All constraints: SELECT table_name FROM user_tables; SELECT constraint_name,search_condition FROM user_constraints WHERE table_name = 'MOVIE'; CONSTRAINT_NAME C SEARCH_CONDITION ----------------------------------------------------------------- SYS_C002723 C "TITLE" IS NOT NULL PLAUSIBLE_YEAR C year > TO_DATE('01.01.1900','DD.MM.YYYY') ALLOWEDPRICE C (pricepday >= 0) AND (pricepday < 100.0) SYS_C002726 P 42 7

SQL / DDL: Summary Standard Query Language (SQL) Data definition language (DDL) Data manipulation language (DML) In almost all current DBMS All SQL implementations differ from standard Important terms and concepts: Data types Create, change, delete tables Referential integrity Integrity constraints 43 8