1 / 16

Structured query language

Structured query language. This is a presentation by JOSEPH ESTRada on the beauty of Structured Query Language. So, what is SQL you ask?. Language designed for the retrieval and management of data. Standard Data Manipulation Language(DML).

lynne
Télécharger la présentation

Structured query language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structured query language • This is a presentation by JOSEPH ESTRada on the beauty of Structured Query Language

  2. So, what is SQL you ask? • Language designed for the retrieval and management of data. • Standard Data Manipulation Language(DML). • Data definition language(DDL). Defines structure of the database.

  3. MYSql language structure • Literal values (Strings, numbers, hexadecimal values, boolean values, bit-field values, null values) • database, table, index, column, and alias names • reserved words • user-defined variables • comments

  4. literal values • string: character sequence in single or double quotes. optional “collate” clause used to specify collation. • numbers: sequence of digits. • hexadecimal values: Act as binary strings or 64-bit precision integers. • Boolean values: booleans. • bit-field values • null values

  5. mysql language structure cont... • Identifiers: DB, table, index, column, and alias names. • reserved words: SELECT, UPDATE, DELETE, etc... (pg 570) • user-defined variables: SET @varr=value. allows shared data between statements. • comments: #, --, /* */

  6. Data Definition statements • ALTER DATABASE: change characteristics of db. • ALTER TABLE: change table structure/schema. • CREATE DATABASE: creates new db. • CREATE TABLE: creates new table. • DROP DATABASE: removes a dB. • DROP TABLE: removes a table. • RENAME TABLE: changes table name.

  7. Data manipulation statements (not complete) • DELETe: deletes tuples • insert: Insert tuples into a given table • select: Relational projection operator • update: Updates attribute/s

  8. Aggregate functions • avg(column): AVg of a column • COUnt(column): number of rows w/o null value • MAX(column): highest value of a column. • MIN(column): Lowest value of a column. • SUM(column): Total sum of a column.

  9. Create TABLE (DDL)

  10. INSERT INTO Course (DML)

  11. group by • Number of classes taught per instructor with GROUP by clause.

  12. predicate • Classes under CS department with units 3 or greater.

  13. count • Amount of courses taught by each department.

  14. delete (DML) • delete all tuples.

  15. DROP TABLE (DDL) • delete the table from the db.

  16. EXIT(0)

More Related