Docs for ydbDocs for ydb
  • Contents
  • Getting started
    • Overview
    • Creating a database
    • Authentication
    • YDB command line interface (CLI)
    • YQL query language
    • YDB SDK
    • Single-node cluster deployment
      • Overview
      • Docker
      • Binary file
      • Minikube
    • Useful links
    • How to edit the documentation
      • Overview
      • Content creation guide
      • Structure of subject directories
      • Building documentation
      • How to participate in the development of documentation
      • Creating customized documentation
  • Concepts
    • Overview
    • Terms and definitions
    • Connecting to a database
    • Authentication
    • Data model and schema
      • Overview
      • Directory
      • Table
      • Topic
    • Serverless and Dedicated operation modes
    • Transactions
    • Secondary indexes
    • Change Data Capture (CDC)
    • Time to Live (TTL)
    • Scan queries
    • Database limits
    • YDB cluster
      • Overview
      • General YDB schema
      • Disk subsystem of a cluster
  • Practical guidelines
    • Custom attributes in tables
  • Recommendations
    • Overview
    • Selecting a primary key for maximum performance
    • Secondary indexes
    • Change Data Capture
    • Paginated output
    • Uploading large data volumes
    • Using timeouts
  • Managing databases
    • Overview
    • Backup and recovery
    • DB system views
  • Managing a cluster
    • Overview
    • Deployment
      • Overview
      • System requirements and recommendations
      • Logging
      • Topology
      • Kubernetes
        • Overview
        • Deploying in Yandex Managed Service for Kubernetes
        • Deploying in AWS Elastic Kubernetes Service
        • Use
      • VM / Baremetal
      • Configuration
      • BlobStorage production configurations
    • Access management
    • Maintaining a cluster's disk subsystem
      • Overview
      • How to stay within the failure model
      • Disk load balancing
      • Methods to free up space on physical devices
      • Cluster extension
      • Adding storage groups
      • Safe restart and shutdown of nodes
      • Working with SelfHeal
      • Enabling/disabling Scrubbing
      • Moving VDisks
      • Updating configurations via CMS
      • Updating configuration of the actor system
      • Decomission of a part of the cluster
    • Embedded UI
      • Overview
      • YDB Monitoring
      • Hive web-viewer
      • Connections overview
      • Logs
      • Charts
    • Cluster system views
    • Audit logs
    • Monitoring
      • Setting up monitoring for a local YDB cluster
      • Grafana dashboards
    • YDB updating
  • YQL
    • Overview
    • Data types
      • Overview
      • Simple
      • Optional
      • Containers
      • Special
      • Type casting
      • Text representation of data types
      • JSON
    • Syntax
      • Overview
      • Lexical structure
      • Expressions
      • ACTION
      • ALTER GROUP
      • ALTER TABLE
      • ALTER USER
      • CREATE GROUP
      • CREATE TABLE
      • CREATE USER
      • DECLARE
      • DELETE
      • DISCARD
      • DROP GROUP
      • DROP TABLE
      • DROP USER
      • GROUP BY
      • FLATTEN
      • INSERT
      • INTO RESULT
      • JOIN
      • PRAGMA
      • REPLACE
      • SELECT
      • UPDATE
      • UPSERT
      • VALUES
      • WINDOW
      • Unsupported statements
    • Built-in functions
      • Overview
      • Basic
      • Aggregate
      • Window
      • For lists
      • For dictionaries
      • For structures
      • For types
      • For JSON
      • C++ libraries
        • Overview
        • Hyperscan
        • Pcre
        • Pire
        • Re2
        • String
        • Unicode
        • DateTime
        • Url
        • Ip
        • Yson
        • Digest
        • Math
        • Histogram
    • YQL tutorial
      • Overview
      • Creating a table
      • Adding data to a table
      • Selecting data from all columns
      • Selecting data from specific columns
      • Sorting and filtering
      • Data aggregation
      • Additional selection criteria
      • Joining tables with JOIN
      • Inserting and updating data with REPLACE
      • Inserting and updating data with UPSERT
      • Inserting data with INSERT
      • Updating data with UPDATE
      • Deleting data
      • Adding and deleting columns
      • Deleting a table
  • Working with the YDB CLI
    • Overview
    • Installation
    • All commands in alphabetical order
    • Service commands
    • Connecting to and authenticating with a database
    • Global parameters
    • YDB CLI commands
      • table attribute add
      • table attribute drop
    • Working with the DB schema
      • List of objects
      • Information about the object
      • Directories
      • Secondary indexes
      • Copying tables
      • Renaming tables
      • Setting TTL parameters
      • Deleting TTL parameters
      • Deleting a table
    • Operations with data
      • Getting a query execution plan and AST
      • Streaming table reads
      • Scan queries
    • Importing and exporting data
      • Overview
      • File structure of data export
      • Exporting data to the file system
      • Importing data from the file system
      • Connecting to and authenticating with S3
      • Exporting data to S3
      • Importing data from S3
      • Importing data from a file to an existing table
    • Working with topics
      • Commands for topics
      • Creating a topic
      • Updating a topic
      • Deleting a topic
      • Adding a topic consumer
      • Deleting a topic consumer
      • Reading messages from a topic
      • Writing messages to a topic
      • Message pipeline processing
    • YQL execution
      • Overview
      • Running a script (with streaming support)
      • Running a script
      • Running a query
    • Managing long running operations
      • Getting a list of long running operations
      • Obtaining the status of long running operations
      • Canceling long running operations
      • Deleting long running operations from the list
    • Managing profiles
      • Overview
      • Creating and updating profile
      • Using a profile in requests
      • Getting profile information
      • Deleting a profile
      • Activated profile
    • Information services
      • List of endpoints
      • Authentication
      • Getting the YDB CLI version
    • Load testing
      • Overview
      • Stock load
      • ClickBench load
      • Key-Value load
  • Working with the YDB SDK
    • Overview
    • Installation
    • Authentication
    • Working with topics
    • Test app
      • Overview
      • C++
      • C# (.NET)
      • Go
      • Java
      • Node.js
      • PHP
      • Python
      • Archive
        • Go v1
        • Go v2
    • Handling errors in the API
    • gRPC API
      • Overview
      • Health Check API
    • Code recipes
      • Overview
      • Initialize the driver
      • Authentication
        • Overview
        • Using a token
        • Anonymous
        • Service account file
        • Metadata service
        • Using environment variables
        • Username and password based
      • Balancing
        • Overview
        • Random choice
        • Prefer the nearest data center
        • Prefer the specific availability zone
      • Running repeat queries
      • Setting the session pool size
      • Upserting data
      • Bulk-upserting data
      • Troubleshooting
        • Overview
        • Enable logging
        • Enable metrics in Prometheus
        • Enable tracing in Jaeger
    • Comparison of SDK features
  • Questions and answers
    • Overview
    • General questions
    • SDK
    • Errors
    • YQL
    • Serverless
    • All questions on one page
  • Downloads
  • Public talks
  • What's new
    • Changelog
    • Security changelog

YQL Tutorial - Overview

    From this tutorial, you will learn how to perform basic operations with data in YDB and get familiar with the YQL syntax.

    The tutorial consists of 15 steps:

    1. Creating a table
    2. Adding data to a table
    3. Selecting data from all columns
    4. Selecting data from specific columns
    5. Sorting and filtering
    6. Data aggregation
    7. Additional selection criteria
    8. Joining tables with JOIN
    9. Inserting and updating data with REPLACE
    10. Inserting and updating data with UPSERT
    11. Inserting data with INSERT
    12. Updating data with UPDATE
    13. Deleting data
    14. Adding and deleting columns
    15. Deleting a table

    Was the article helpful?