SQL is a standard language for managing relational databases and querying data. It allows users to perform tasks like retrieving, inserting, updating, and deleting data. Some key SQL statements include SELECT to query data, INSERT to add new records, UPDATE to modify existing records, and DELETE to remove records. SQL is widely used with database management systems like MySQL, SQL Server, and Oracle.
This document provides an introduction and overview of SQL (Structured Query Language). It defines SQL as a standard language for managing and accessing relational database management systems (RDBMS). It describes some key SQL commands like SELECT, UPDATE, DELETE, and INSERT. It also notes that while SQL is a standard, different database systems may have their own proprietary extensions. The document uses examples from the Northwind sample database to demonstrate basic SQL statements and clauses.
This document provides an introduction to structured query language (SQL). It outlines the objectives of learning SQL, which are to use SQL for data administration and data manipulation. The agenda covers SQL concepts like data types, constraints, database relationships, queries, and commands. It discusses SQL database objects and how to retrieve, customize, group and join data. It also covers inserting, updating, deleting data and working with tables, views, constraints, stored procedures and functions.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document provides an introduction to SQL and relational database concepts. It explains that SQL is used to manipulate and retrieve data from relational databases. It also outlines the main SQL commands: DDL for data definition, DML for data manipulation, DCL for data control, and DQL for data queries. Key relational database concepts like tables, records, columns, and relationships are defined. Constraints, data types and integrity are discussed. Examples are provided for SQL statements like CREATE, INSERT, UPDATE, DELETE, and SELECT.
This document provides an overview of SQL (Structured Query Language). It discusses that SQL is used to define, manipulate, and control data in a relational database. It can define database schemas, insert, modify, retrieve, and delete data from databases. The document also provides a brief history of SQL and describes its main components like DDL, DML, and DCL. It provides examples of common SQL commands and functions. Finally, it discusses SQL Plus which is a basic Oracle utility used to interact with databases through a command line interface.
Introduction to structured query language (sql)Sabana Maharjan
This document provides an introduction to structured query language (SQL). It discusses the two broad categories of SQL functions: data definition language and data manipulation language. The data definition language includes commands for creating database objects like tables and views, while the data manipulation language includes commands for inserting, updating, deleting, and retrieving data from tables. The document then covers topics like SQL data types, table structures, constraints, indexes, and basic data manipulation commands. It also discusses more advanced SQL concepts such as joins, aggregate functions, and views.
This document provides an overview of Oracle database including:
- Oracle is a powerful relational database management system (RDBMS) that allows sharing of data across multiple users through a centralized database server.
- It supports both relational and object-oriented features, making it an object-relational database management system (ORDBMS).
- SQL is the standard language used to access and manage data within an Oracle or other relational database.
This document provides an introduction and overview of SQL (Structured Query Language). It defines SQL as a standard language for managing and accessing relational database management systems (RDBMS). It describes some key SQL commands like SELECT, UPDATE, DELETE, and INSERT. It also notes that while SQL is a standard, different database systems may have their own proprietary extensions. The document uses examples from the Northwind sample database to demonstrate basic SQL statements and clauses.
This document provides an introduction to structured query language (SQL). It outlines the objectives of learning SQL, which are to use SQL for data administration and data manipulation. The agenda covers SQL concepts like data types, constraints, database relationships, queries, and commands. It discusses SQL database objects and how to retrieve, customize, group and join data. It also covers inserting, updating, deleting data and working with tables, views, constraints, stored procedures and functions.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document provides an introduction to SQL and relational database concepts. It explains that SQL is used to manipulate and retrieve data from relational databases. It also outlines the main SQL commands: DDL for data definition, DML for data manipulation, DCL for data control, and DQL for data queries. Key relational database concepts like tables, records, columns, and relationships are defined. Constraints, data types and integrity are discussed. Examples are provided for SQL statements like CREATE, INSERT, UPDATE, DELETE, and SELECT.
This document provides an overview of SQL (Structured Query Language). It discusses that SQL is used to define, manipulate, and control data in a relational database. It can define database schemas, insert, modify, retrieve, and delete data from databases. The document also provides a brief history of SQL and describes its main components like DDL, DML, and DCL. It provides examples of common SQL commands and functions. Finally, it discusses SQL Plus which is a basic Oracle utility used to interact with databases through a command line interface.
Introduction to structured query language (sql)Sabana Maharjan
This document provides an introduction to structured query language (SQL). It discusses the two broad categories of SQL functions: data definition language and data manipulation language. The data definition language includes commands for creating database objects like tables and views, while the data manipulation language includes commands for inserting, updating, deleting, and retrieving data from tables. The document then covers topics like SQL data types, table structures, constraints, indexes, and basic data manipulation commands. It also discusses more advanced SQL concepts such as joins, aggregate functions, and views.
This document provides an overview of Oracle database including:
- Oracle is a powerful relational database management system (RDBMS) that allows sharing of data across multiple users through a centralized database server.
- It supports both relational and object-oriented features, making it an object-relational database management system (ORDBMS).
- SQL is the standard language used to access and manage data within an Oracle or other relational database.
SQL is a standard language for accessing and manipulating databases. It allows users to perform functions like querying data, inserting records, updating records, and deleting records. The main SQL statements are SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, and DROP. SQL also includes clauses like WHERE, ORDER BY, GROUP BY and JOIN that allow users to filter and sort query results. Common data definition language statements are used to create and modify database structures like tables, indexes, and relationships.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
SQL is a language used to communicate with databases and manage data. It allows users to create, update, and retrieve data from databases. The document outlines the history of SQL and its evolution over time. It also describes key SQL concepts like data types, commands, primary keys, database normalization, and techniques for ensuring data integrity.
This document provides an overview of SQL (Structured Query Language) including what it is, what it can do, and some key SQL statements. SQL is a standard language for accessing and manipulating databases and allows users to retrieve, insert, update, and delete data. The document describes common statements like SELECT, UPDATE, DELETE, and INSERT and provides examples of basic usage.
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
SQL is a language used to store, retrieve, and manage data in relational database management systems. It contains commands like SELECT, INSERT, UPDATE, DELETE to query and manipulate data. SQL also allows functions, operators, transactions, and other capabilities to ensure data integrity and security. Integrity constraints like primary keys and foreign keys help maintain relational integrity between tables.
Here are the SQL commands for the questions:
Q1: SELECT PNAME FROM PROJECT WHERE PLOCATION='Houston';
Q2: SELECT FNAME, LNAME FROM EMPLOYEE WHERE HOURS>20;
Q3: SELECT FNAME, LNAME FROM EMPLOYEE, DEPARTMENT WHERE MGRSSN=SSN;
The document provides instructions on how to create tables, insert data, and write queries for a database with tables for students, library memberships, books, and book issue records. It includes examples of creating the tables with primary and foreign keys, inserting sample data, and queries to list student names and issued books, count books issued per student, and create views of issue records and daily issues.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
SQL is a relational database language used to define, manipulate, and control access to data in a relational database. SQL statements are used to perform tasks like data retrieval, insertion, deletion, updating and table/database management. The basic structure of an SQL query involves selecting data from one or more tables to display or use. SQL supports features like constraints, indexes, views, triggers that enforce data integrity and security.
The document provides an overview of SQL basics, including its three sublanguages: DDL for data declaration, DML for data manipulation, and DCL for data control. It describes each sublanguage and some key SQL concepts like tables representing entities, relationships represented through references between tables, and the differences between rows and records and columns and fields. It also briefly introduces schema objects that can be created by users with admin privileges in a database.
SQL is a standard language for managing relational databases and querying data. Key features of SQL include:
- SQL allows users to retrieve, insert, update and delete data in databases. Common commands include SELECT, UPDATE, DELETE, and INSERT.
- SQL queries use clauses like WHERE to filter records and return only the desired data. Operators like =, <, > can be used in the WHERE clause.
- SQL statements are divided into DML (Data Manipulation Language) for queries and DDL (Data Definition Language) for managing database structure.
SQL is a standard language for managing relational databases and querying data. Key features of SQL include retrieving, inserting, updating, and deleting data. The document provides examples of common SQL statements like SELECT, WHERE, ORDER BY, INSERT, UPDATE, and DELETE and how they can be used to work with data in database tables. It also explains concepts like SQL data manipulation language (DML) and data definition language (DDL) as well as SQL data types, operators, and syntax.
SQL is a standard language for accessing and manipulating databases. The document provides an introduction to SQL basics including SQL statements to select, insert, update and delete data from database tables. It explains key SQL components like the WHERE clause for filtering records and the ORDER BY clause for sorting query results. Examples are given for each SQL statement and concept discussed.
This document provides an overview of SQL and relational database concepts. It discusses how SQL is used to interact with relational database management systems like MySQL, including inserting and querying data. The summary also provides a brief history of SQL and explains some basic SQL syntax. Examples are given to demonstrate creating tables and relating data between tables to represent real-world entities and their relationships.
This document provides an overview of SQL data definition and integrity constraints. It discusses:
1) SQL data types and integrity constraints such as required fields, domain constraints, entity integrity, referential integrity, and general constraints. It provides examples of defining these constraints using SQL.
2) SQL DDL statements for creating, altering and dropping schemas, domains, tables, views and other database objects. Examples are provided for creating tables with constraints and altering tables.
3) Views - how they provide a dynamic result set defined by a query. The document describes creating, dropping and resolving views in SQL. Examples include horizontal, vertical and grouped/joined views.
This document provides an overview of working with multiple tables in SQL, including topics like joins, aliases, inner joins, outer joins, and joining more than two tables. It discusses how joins interact with the relational database structure and ERD diagrams. It provides examples of different join types and how they handle discrepancies in the data. It also covers adding calculations to queries using functions like COUNT and aggregate functions. The document uses the sample sTunes database to demonstrate various SQL queries and joins.
SQL is a standard language for working with databases that allows users to retrieve, insert, update, and delete data. Some key capabilities of SQL include executing queries against a database, retrieving data from tables, and creating/modifying database objects like tables and views. SQL statements like SELECT, UPDATE, and DELETE allow users to interact with data in relational databases from different vendors like MySQL, Oracle, and SQL Server.
SQL is a standard language for querying, manipulating, and defining data in relational database management systems (RDBMS). Some key points:
- SQL can be used to access and manipulate data in an RDBMS which stores data in tables that consist of rows and columns.
- Common SQL commands allow users to retrieve data from databases through queries, as well as insert, update, and delete records in tables.
- SQL statements follow a defined syntax and keywords are not case sensitive. For example, the SELECT statement is used to extract data from a table.
This document provides an introduction to SQL and relational database concepts. It explains that SQL is used to manipulate and retrieve data from relational databases. It then defines key SQL commands like SELECT, UPDATE, DELETE, and INSERT which allow users to query, modify, and manage data. The document also introduces SQL clauses and syntax like WHERE, ORDER BY, AND, OR to filter and sort query results. It provides examples of these commands using sample database tables.
SQL is a standard language for accessing and manipulating databases. It allows users to perform functions like querying data, inserting records, updating records, and deleting records. The main SQL statements are SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, and DROP. SQL also includes clauses like WHERE, ORDER BY, GROUP BY and JOIN that allow users to filter and sort query results. Common data definition language statements are used to create and modify database structures like tables, indexes, and relationships.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
SQL is a language used to communicate with databases and manage data. It allows users to create, update, and retrieve data from databases. The document outlines the history of SQL and its evolution over time. It also describes key SQL concepts like data types, commands, primary keys, database normalization, and techniques for ensuring data integrity.
This document provides an overview of SQL (Structured Query Language) including what it is, what it can do, and some key SQL statements. SQL is a standard language for accessing and manipulating databases and allows users to retrieve, insert, update, and delete data. The document describes common statements like SELECT, UPDATE, DELETE, and INSERT and provides examples of basic usage.
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
SQL is a language used to store, retrieve, and manage data in relational database management systems. It contains commands like SELECT, INSERT, UPDATE, DELETE to query and manipulate data. SQL also allows functions, operators, transactions, and other capabilities to ensure data integrity and security. Integrity constraints like primary keys and foreign keys help maintain relational integrity between tables.
Here are the SQL commands for the questions:
Q1: SELECT PNAME FROM PROJECT WHERE PLOCATION='Houston';
Q2: SELECT FNAME, LNAME FROM EMPLOYEE WHERE HOURS>20;
Q3: SELECT FNAME, LNAME FROM EMPLOYEE, DEPARTMENT WHERE MGRSSN=SSN;
The document provides instructions on how to create tables, insert data, and write queries for a database with tables for students, library memberships, books, and book issue records. It includes examples of creating the tables with primary and foreign keys, inserting sample data, and queries to list student names and issued books, count books issued per student, and create views of issue records and daily issues.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
SQL is a relational database language used to define, manipulate, and control access to data in a relational database. SQL statements are used to perform tasks like data retrieval, insertion, deletion, updating and table/database management. The basic structure of an SQL query involves selecting data from one or more tables to display or use. SQL supports features like constraints, indexes, views, triggers that enforce data integrity and security.
The document provides an overview of SQL basics, including its three sublanguages: DDL for data declaration, DML for data manipulation, and DCL for data control. It describes each sublanguage and some key SQL concepts like tables representing entities, relationships represented through references between tables, and the differences between rows and records and columns and fields. It also briefly introduces schema objects that can be created by users with admin privileges in a database.
SQL is a standard language for managing relational databases and querying data. Key features of SQL include:
- SQL allows users to retrieve, insert, update and delete data in databases. Common commands include SELECT, UPDATE, DELETE, and INSERT.
- SQL queries use clauses like WHERE to filter records and return only the desired data. Operators like =, <, > can be used in the WHERE clause.
- SQL statements are divided into DML (Data Manipulation Language) for queries and DDL (Data Definition Language) for managing database structure.
SQL is a standard language for managing relational databases and querying data. Key features of SQL include retrieving, inserting, updating, and deleting data. The document provides examples of common SQL statements like SELECT, WHERE, ORDER BY, INSERT, UPDATE, and DELETE and how they can be used to work with data in database tables. It also explains concepts like SQL data manipulation language (DML) and data definition language (DDL) as well as SQL data types, operators, and syntax.
SQL is a standard language for accessing and manipulating databases. The document provides an introduction to SQL basics including SQL statements to select, insert, update and delete data from database tables. It explains key SQL components like the WHERE clause for filtering records and the ORDER BY clause for sorting query results. Examples are given for each SQL statement and concept discussed.
This document provides an overview of SQL and relational database concepts. It discusses how SQL is used to interact with relational database management systems like MySQL, including inserting and querying data. The summary also provides a brief history of SQL and explains some basic SQL syntax. Examples are given to demonstrate creating tables and relating data between tables to represent real-world entities and their relationships.
This document provides an overview of SQL data definition and integrity constraints. It discusses:
1) SQL data types and integrity constraints such as required fields, domain constraints, entity integrity, referential integrity, and general constraints. It provides examples of defining these constraints using SQL.
2) SQL DDL statements for creating, altering and dropping schemas, domains, tables, views and other database objects. Examples are provided for creating tables with constraints and altering tables.
3) Views - how they provide a dynamic result set defined by a query. The document describes creating, dropping and resolving views in SQL. Examples include horizontal, vertical and grouped/joined views.
This document provides an overview of working with multiple tables in SQL, including topics like joins, aliases, inner joins, outer joins, and joining more than two tables. It discusses how joins interact with the relational database structure and ERD diagrams. It provides examples of different join types and how they handle discrepancies in the data. It also covers adding calculations to queries using functions like COUNT and aggregate functions. The document uses the sample sTunes database to demonstrate various SQL queries and joins.
SQL is a standard language for working with databases that allows users to retrieve, insert, update, and delete data. Some key capabilities of SQL include executing queries against a database, retrieving data from tables, and creating/modifying database objects like tables and views. SQL statements like SELECT, UPDATE, and DELETE allow users to interact with data in relational databases from different vendors like MySQL, Oracle, and SQL Server.
SQL is a standard language for querying, manipulating, and defining data in relational database management systems (RDBMS). Some key points:
- SQL can be used to access and manipulate data in an RDBMS which stores data in tables that consist of rows and columns.
- Common SQL commands allow users to retrieve data from databases through queries, as well as insert, update, and delete records in tables.
- SQL statements follow a defined syntax and keywords are not case sensitive. For example, the SELECT statement is used to extract data from a table.
This document provides an introduction to SQL and relational database concepts. It explains that SQL is used to manipulate and retrieve data from relational databases. It then defines key SQL commands like SELECT, UPDATE, DELETE, and INSERT which allow users to query, modify, and manage data. The document also introduces SQL clauses and syntax like WHERE, ORDER BY, AND, OR to filter and sort query results. It provides examples of these commands using sample database tables.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
This document provides an overview of SQL, DBMS, and databases. It discusses what SQL is and its uses. The core SQL commands like SELECT, INSERT, UPDATE, and DELETE are explained along with syntax examples. Key concepts like database, DBMS, different data models (hierarchical, network, relational), and database objectives are defined. The document is written by a group of five students and covers the essential topics at a high level for understanding SQL and relational databases.
Introduction To STRUCTURED QUERY LANGUAGE (PART_1).pptxadnanashraf794146
Explore the fundamentals and advanced concepts of SQL (Structured Query Language) in this comprehensive slide. Gain insights into database management, data retrieval, and manipulation using SQL commands and queries. Learn about:
SQL Basics: Understanding syntax, data types, and basic commands.
Data Manipulation: How to insert, update, delete, and select data.
Joins and Subqueries: Combining data from multiple tables and advanced querying techniques.
Database Design: Normalization, relationships, and schema design.
Performance Tuning: Tips and techniques for optimizing SQL queries for better performance.
Security Best Practices: Protecting your database from SQL injection and other security threats.
Ideal for beginners to intermediate users, this slide provides a solid foundation for mastering SQL and effectively managing relational databases
This document introduces Structured Query Language (SQL) by explaining what SQL is, what it can do, and some basic SQL concepts and syntax. SQL is a standard language for storing and retrieving data from relational database management systems (RDBMS). It introduces key SQL elements like tables, records, fields, SELECT statements, and semicolons separating statements. The document also explains how SQL is used to extract data from databases for display on websites.
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
The document discusses MySQL and SQL concepts including relational databases, database management systems, and the SQL language. It introduces common SQL statements like SELECT, INSERT, UPDATE, and DELETE and how they are used to query and manipulate data. It also covers topics like database design with tables, keys, and relationships between tables.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
SQL is a programming language used to define, manipulate, and retrieve data from relational databases. It includes commands for data definition, manipulation, and retrieval. XAMPP is a free and easy to install package containing Apache, MariaDB, PHP, and Perl. It provides a local development environment for testing databases, servers, and web applications. The document provides examples of SQL commands for creating databases and tables, inserting, updating, and deleting data, and retrieving data using select statements.
This document provides an overview of using SQLite and the sTunes database for SQL and scripting training. It discusses launching the DB Browser software and opening the sTunes database for exploration. It also covers getting started with SQLite queries, including notation techniques, basic query structure, sorting results, limiting results, and using various SQL operators in queries. The document provides examples of queries using concepts like aliases, WHERE clauses, wildcards, dates, logical operators, and CASE statements.
The document is an introduction to SQL that covers the basic SQL statements and concepts. It defines SQL and its uses, including retrieving, inserting, updating, and deleting data from databases. It also covers key SQL statements like SELECT, WHERE, ORDER BY, JOIN, and aggregate functions. The document provides syntax examples for each SQL statement and concept discussed.
SQL is a language used to retrieve and manipulate data stored in relational database tables. It allows users to perform operations like selecting data, inserting rows, updating records, and deleting data. The four fundamental SQL statements are SELECT, INSERT, UPDATE, and DELETE. SQL statements follow a basic syntax and include keywords like SELECT, FROM, WHERE to query data and sort results.
MySQL is an open-source relational database management system. The document discusses MySQL including its introduction, development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. Key points include that MySQL is popular, free, works with many operating systems, supports SQL, and is used by many large websites. It provides details on installing and using basic functions of MySQL.
MySQL is an open-source relational database management system. The document discusses the introduction to MySQL, its development history, installation, features, data types, basic commands like CREATE, SELECT, UPDATE, DELETE. It also covers MySQL constraints. MySQL is widely used for web applications due to its speed, ease of use and open source nature. It can store and manage large volumes of data across different tables using relationships.
The document discusses Structured Query Language (SQL) and its basic statements. It covers:
- SQL is used to request and retrieve data from databases. The DBMS processes SQL queries and returns results.
- SQL statements are divided into DDL (data definition language) for managing schema, DML (data manipulation language) for data queries/modification, and DCL (data control language) for managing transactions and access control.
- The document provides examples of using SQL commands like CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, UPDATE, DELETE, SELECT and indexes. It also covers data types, constraints and operators used in SQL queries.
SQL is a standard language for querying, manipulating, and defining data in databases. It allows users to retrieve, insert, update, and delete data as well as create databases and tables. Common SQL commands include SELECT, UPDATE, DELETE, INSERT, and WHERE. SQL databases also typically have proprietary extensions beyond the SQL standard. To build a website that displays database data, a developer needs an RDBMS database, a server-side scripting language like PHP, SQL, and HTML/CSS.
SQL is a standard language for querying, manipulating, and defining data in databases. It allows users to retrieve, insert, update, and delete data as well as create databases, tables, stored procedures, and views. While SQL is an ANSI standard, different database systems have their own proprietary extensions. To build a dynamic website that interacts with a database, a developer needs an RDBMS like MySQL, a scripting language like PHP, knowledge of SQL, and HTML/CSS.
This document provides an overview of SQL (Structured Query Language) and how it can be used to access and manipulate data within relational database management systems (RDBMS). It describes what SQL is, common SQL commands like SELECT, INSERT, UPDATE and DELETE, SQL data types, database tables, and key clauses like WHERE that are used to filter SQL queries. Examples are provided throughout to illustrate SQL syntax and usage.
Gives you the complete knowledge of different channel allocation techniques, reverse and forward CDMA, GSM Frame Structure, GSM channel Types, cellular concepts, handoff strategies, Frequency reuse and GSM call structure.
This PDF provides a in-depth explanation for all the concepts and practices used before.
Theory of Computer Science - Post Correspondence ProblemKaran Thakkar
The document discusses recursive and recursively enumerable languages, and undecidability. It can be summarized as:
1. Recursive languages are accepted by Turing machines that halt on all inputs, while recursively enumerable languages are accepted by machines that may halt or loop.
2. Whether a Turing machine halts on a given input is undecidable, as is determining if a context-free grammar is ambiguous.
3. Rice's Theorem states that any non-trivial property of recursively enumerable languages is undecidable to determine. The Post Correspondence Problem is also undecidable in general.
The document summarizes the Turing machine. It describes a Turing machine as having three main elements: an input/output tape, a read/write head that moves bidirectionally along the tape, and a finite state control. It operates by examining the symbol under the head along with its current state to determine the symbol to write, the head's movement, and the next state. The document then provides a formal definition of a Turing machine as a 7-tuple and describes some variations including those with different tape configurations and those that are nondeterministic or have multiple tapes/heads.
This document discusses Turing machines and their variations, including universal Turing machines. It compares the power of pushdown automata and Turing machines, and examines finite automata, pushdown automata, and Turing machines. The document also covers the halting problem, applications of formal language theory, and amplification of recursively enumerable languages and finite automata using context-free grammars.
All the concepts of 8051 Micro controller have been explained in detail. Also some information on Embedded Systems. The Presentation deals with Processors & Microcontrollers from first generation to the present generation. This presentation an invaluable compendium of knowledge to the individuals trying to explore the field of electronics. Moreover, a complete coverage for Mumbai University students have been made available.
Operating system - Process and its conceptsKaran Thakkar
This presentation gives an overview of Process concepts in Operating System. The presentation aims at alleviating most of the overheads while understanding the process concept in operating system. this tailor made presentation will help individuals to understand the overall meaning of process and its underlying concepts used in an operating system.
This presentation provides you with the invaluable compendium of useful information on 'SEO' that is Search Engine Optimization.
The Agenda here are as follows:
1. What are Search Engines?
2. How do Search Engines Work?
3. Examples of popular Search Engines
4. Search Engine Statistics
5. What is Search Engine Optimization (SEO)?
6. Goals of Search Engine Optimization
7. History of Search Engine Optimization
8. Techniques for Search Engine Optimization
9. Algorithm for Search Engine Optimization
10. Ranking factors for Search Engine Optimization
11. Tools for Search Engine Optimization.
This presentation aims at the industries currently trying to seek different solutions for SEO techniques.
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMHODECEDSIET
Time Division Multiplexing (TDM) is a method of transmitting multiple signals over a single communication channel by dividing the signal into many segments, each having a very short duration of time. These time slots are then allocated to different data streams, allowing multiple signals to share the same transmission medium efficiently. TDM is widely used in telecommunications and data communication systems.
### How TDM Works
1. **Time Slots Allocation**: The core principle of TDM is to assign distinct time slots to each signal. During each time slot, the respective signal is transmitted, and then the process repeats cyclically. For example, if there are four signals to be transmitted, the TDM cycle will divide time into four slots, each assigned to one signal.
2. **Synchronization**: Synchronization is crucial in TDM systems to ensure that the signals are correctly aligned with their respective time slots. Both the transmitter and receiver must be synchronized to avoid any overlap or loss of data. This synchronization is typically maintained by a clock signal that ensures time slots are accurately aligned.
3. **Frame Structure**: TDM data is organized into frames, where each frame consists of a set of time slots. Each frame is repeated at regular intervals, ensuring continuous transmission of data streams. The frame structure helps in managing the data streams and maintaining the synchronization between the transmitter and receiver.
4. **Multiplexer and Demultiplexer**: At the transmitting end, a multiplexer combines multiple input signals into a single composite signal by assigning each signal to a specific time slot. At the receiving end, a demultiplexer separates the composite signal back into individual signals based on their respective time slots.
### Types of TDM
1. **Synchronous TDM**: In synchronous TDM, time slots are pre-assigned to each signal, regardless of whether the signal has data to transmit or not. This can lead to inefficiencies if some time slots remain empty due to the absence of data.
2. **Asynchronous TDM (or Statistical TDM)**: Asynchronous TDM addresses the inefficiencies of synchronous TDM by allocating time slots dynamically based on the presence of data. Time slots are assigned only when there is data to transmit, which optimizes the use of the communication channel.
### Applications of TDM
- **Telecommunications**: TDM is extensively used in telecommunication systems, such as in T1 and E1 lines, where multiple telephone calls are transmitted over a single line by assigning each call to a specific time slot.
- **Digital Audio and Video Broadcasting**: TDM is used in broadcasting systems to transmit multiple audio or video streams over a single channel, ensuring efficient use of bandwidth.
- **Computer Networks**: TDM is used in network protocols and systems to manage the transmission of data from multiple sources over a single network medium.
### Advantages of TDM
- **Efficient Use of Bandwidth**: TDM all
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
A review on techniques and modelling methodologies used for checking electrom...nooriasukmaningtyas
The proper function of the integrated circuit (IC) in an inhibiting electromagnetic environment has always been a serious concern throughout the decades of revolution in the world of electronics, from disjunct devices to today’s integrated circuit technology, where billions of transistors are combined on a single chip. The automotive industry and smart vehicles in particular, are confronting design issues such as being prone to electromagnetic interference (EMI). Electronic control devices calculate incorrect outputs because of EMI and sensors give misleading values which can prove fatal in case of automotives. In this paper, the authors have non exhaustively tried to review research work concerned with the investigation of EMI in ICs and prediction of this EMI using various modelling methodologies and measurement setups.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Embedded machine learning-based road conditions and driving behavior monitoring
DBMS
1. DATABASE MANAGEMENT SYSTEM
SQL is a standard language for accessing and manipulating databases.
What is SQL?
SQL stands for Structured Query Language
SQL lets you access and manipulate databases
SQL is an ANSI (American National Standards Institute) standard
What Can SQL do?
SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database
SQL can delete records from a database
SQL can create new databases
SQL can create new tables in a database
SQL can create stored procedures in a database
SQL can create views in a database
SQL can set permissions on tables, procedures, and views
SQL is a Standard - BUT....
Although SQL is an ANSI (American National Standards Institute) standard, there are different versions of the
SQL language.
However, to be compliant with the ANSI standard, they all support at least the major commands (such as
SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
Note: Most of the SQL database programs also have their own proprietary extensions in addition to the SQL
standard!
Using SQL in Your Web Site
To build a web site that shows data from a database, you will need:
An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
To use a server-side scripting language, like PHP or ASP
To use SQL to get the data you want
To use HTML / CSS
RDBMS
2. DATABASE MANAGEMENT SYSTEM
RDBMS stands for Relational Database Management System.
RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle,
MySQL, and Microsoft Access.
The data in RDBMS is stored in database objects called tables.
A table is a collection of related data entries and it consists of columns and rows.
Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or
"Orders"). Tables contain records (rows) with data.
In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS SQL
Server).
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
The table above contains five records (one for each customer) and seven columns (CustomerID,
CustomerName, ContactName, Address, City, PostalCode, and Country).
SQL Statements
Most of the actions you need to perform on a database are done with SQL statements.
The following SQL statement selects all the records in the "Customers" table:
3. DATABASE MANAGEMENT SYSTEM
SELECT * FROM Customers;
Keep in Mind That...
SQL is NOT case sensitive: select is the same as SELECT
In this tutorial we will write all SQL keywords in upper-case.
Semicolon after SQL Statements?
Some database systems require a semicolon at the end of each SQL statement.
Semicolon is the standard way to separate each SQL statement in database systems that allow more than one
SQL statement to be executed in the same call to the server.
In this tutorial, we will use semicolon at the end of each SQL statement.
Some of the Most Important SQL Commands
SELECT - extracts data from a database
UPDATE - updates data in a database
DELETE - deletes data from a database
INSERT INTO - inserts new data into a database
CREATE DATABASE - creates a new database
ALTER DATABASE - modifies a database
CREATE TABLE - creates a new table
ALTER TABLE - modifies a table
DROP TABLE - deletes a table
CREATE INDEX - creates an index (search key)
DROP INDEX - deletes an index
The SQL SELECT Statement
The SELECT statement is used to select data from a database.
The result is stored in a result table, called the result-set.
SQL SELECT Syntax
SELECT column_name, column_name
FROM table_name;
And
SELECT * FROM table_name;
4. DATABASE MANAGEMENT SYSTEM
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
SELECT Column Example
The following SQL statement selects the "CustomerName" and "City" columns from the "Customers" table:
SELECT CustomerName, City FROM Customers;
SELECT * Example
The following SQL statement selects all the columns from the "Customers" table:
SELECT * FROM Customers;
The SQL SELECT DISTINCT Statement
In a table, a column may contain many duplicate values; and sometimes you only want to list the different
(distinct) values.
The DISTINCT keyword can be used to return only distinct (different) values.
The SELECT DISTINCT statement is used to return only distinct (different) values.
5. DATABASE MANAGEMENT SYSTEM
SQL SELECT DISTINCT Syntax
SELECT DISTINCT column_name, column_name
FROM table_name;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
SELECT DISTINCT Example
The following SQL statement selects only the distinct values from the "City" columns from the "Customers"
table:
SELECT DISTINCT City FROM Customers;
The SQL WHERE Clause
The WHERE clause is used to extract only those records that fulfill a specified criterion.
The WHERE clause is used to filter records.
SQL WHERE Syntax
SELECT column_name, column_name
FROM table_name
WHERE column_name operator value;
Demo Database
6. DATABASE MANAGEMENT SYSTEM
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
WHERE Clause Example
The following SQL statement selects all the customers from the country "Mexico", in the "Customers" table:
SELECT * FROM Customers
WHERE Country='Mexico';
Text Fields vs. Numeric Fields
SQL requires single quotes around text values (most database systems will also allow double quotes).
However, numeric fields should not be enclosed in quotes:
SELECT * FROM Customers
WHERE CustomerID=1;
Operators in the WHERE Clause
The following operators can be used in the WHERE clause:
Operator Description
= Equal
<> Not equal. Note: In some versions of SQL this operator may be written as !=
> Greater than
7. DATABASE MANAGEMENT SYSTEM
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
LIKE Search for a pattern
IN To specify multiple possible values for a column
The SQL AND & OR Operators
The AND operator displays a record if both the first condition AND the second condition are true.
The OR operator displays a record if either the first condition OR the second condition is true.
The AND & OR operators are used to filter records based on more than one condition.
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
AND Operator Example
The following SQL statement selects all customers from the country "Germany" AND the city "Berlin", in the
"Customers" table:
8. DATABASE MANAGEMENT SYSTEM
SELECT * FROM Customers
WHERE Country='Germany'
AND City='Berlin';
OR Operator Example
The following SQL statement selects all customers from the city "Berlin" OR "München", in the "Customers"
table:
SELECT * FROM Customers
WHERE City='Berlin'
OR City='München';
The SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set by one or more columns.
The ORDER BY keyword is used to sort the result-set.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in a descending
order, you can use the DESC keyword.
SQL ORDER BY Syntax
SELECT column_name, column_name
FROM table_name
ORDER BY column_name, column_name ASC|DESC;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y
helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
9. DATABASE MANAGEMENT SYSTEM
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
ORDER BY Example
The following SQL statement selects all customers from the "Customers" table, sorted by the "Country"
column:
SELECT * FROM Customers
ORDER BY Country;
ORDER BY DESC Example
The following SQL statement selects all customers from the "Customers" table, sorted DESCENDING by the
"Country" column:
SELECT * FROM Customers
ORDER BY Country DESC;
ORDER BY Several Columns Example
The following SQL statement selects all customers from the "Customers" table, sorted by the "Country" and the
"CustomerName" column:
SELECT * FROM Customers
ORDER BY Country, CustomerName;
The SQL INSERT INTO Statement
The INSERT INTO statement is used to insert new records in a table.
SQL INSERT INTO Syntax
It is possible to write the INSERT INTO statement in two forms.
The first form does not specify the column names where the data will be inserted, only their values:
INSERT INTO table_name
VALUES (value1, value2, value3,...);
The second form specifies both the column names and the values to be inserted:
10. DATABASE MANAGEMENT SYSTEM
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...);
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
87 Wartian Herkku Pirkko
Koskitalo
Torikatu 38 Oulu 90110 Finland
88 Wellington
Importadora
Paula Parente Rua do Mercado, 12 Resende 08737-363 Brazil
89 White Clover Markets Karl Jablonski 305 - 14th Ave. S. Suite
3B
Seattle 98128 USA
90 Wilman Kala Matti Karttunen Keskuskatu 45 Helsinki 21240 Finland
91 Wolski Zbyszek ul. Filtrowa 68 Walla 01-012 Poland
INSERT INTO Example
Assume we wish to insert a new row in the "Customers" table.
We can use the following SQL statement:
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal’, ‘Tom B. Erichsen’, ‘Skagen 21','Stavanger','4006','Norway');
The selection from the "Customers" table will now look like this:
CustomerID CustomerName ContactName Address City PostalCode Country
87 Wartian Herkku Pirkko
Koskitalo
Torikatu 38 Oulu 90110 Finland
88 Wellington
Importadora
Paula Parente Rua do Mercado, 12 Resende 08737-363 Brazil
89 White Clover
Markets
Karl Jablonski 305 - 14th Ave. S.
Suite 3B
Seattle 98128 USA
11. DATABASE MANAGEMENT SYSTEM
90 Wilman Kala Matti
Karttunen
Keskuskatu 45 Helsinki 21240 Finland
91 Wolski Zbyszek ul. Filtrowa 68 Walla 01-012 Poland
92 Cardinal Tom B.
Erichsen
Skagen 21 Stavanger 4006 Norway
Did you notice that we did not insert any number into the CustomerID field?
The CustomerID column is automatically updated with a unique number for each record in the table.
Insert Data Only in Specified Columns
It is also possible to only insert data in specific columns.
The following SQL statement will insert a new row, but only insert data in the "CustomerName", "City", and
"Country" columns (and the CustomerID field will of course also be updated automatically):
INSERT INTO Customers (CustomerName, City, Country)
VALUES ('Cardinal', 'Stavanger', 'Norway');
The selection from the "Customers" table will now look like this:
CustomerID CustomerName ContactName Address City PostalCode Country
87 Wartian Herkku Pirkko
Koskitalo
Torikatu 38 Oulu 90110 Finland
88 Wellington
Importadora
Paula Parente Rua do Mercado, 12 Resende 08737-363 Brazil
89 White Clover
Markets
Karl Jablonski 305 - 14th Ave. S.
Suite 3B
Seattle 98128 USA
90 Wilman Kala Matti Karttunen Keskuskatu 45 Helsinki 21240 Finland
91 Wolski Zbyszek ul. Filtrowa 68 Walla 01-012 Poland
92 Cardinal null null Stavanger null Norway
12. DATABASE MANAGEMENT SYSTEM
The SQL UPDATE Statement
The UPDATE statement is used to update existing records in a table.
SQL UPDATE Syntax
UPDATE table_name
SET column1=value1, column2=value2,...
WHERE some_column=some_value;
Notice the WHERE clause in the SQL UPDATE statement!
The WHERE clause specifies which record or records that should be updated. If you omit the WHERE clause, a
records will be updated!
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
SQL UPDATE Example
Assume we wish to update the customer "Alfreds Futterkiste" with a new contact person and city.
We use the following SQL statement:
13. DATABASE MANAGEMENT SYSTEM
UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg'
WHERE CustomerName='Alfreds Futterkiste';
The selection from the "Customers" table will now look like this:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Alfred Schmidt Obere Str. 57 Hamburg 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
Update Warning!
Be careful when updating records. If we had omitted the WHERE clause, in the example above, like this:
UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg';
The "Customers" table would have looked like this:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Alfred
Schmidt
Obere Str. 57 Hamburg 12209 Germany
2 Ana Trujillo
Emparedados y helados
Alfred
Schmidt
Avda. de la
Constitución 2222
Hamburg 05021 Mexico
3 Antonio Moreno
Taquería
Alfred
Schmidt
Mataderos 2312 Hamburg 05023 Mexico
4 Around the Horn Alfred
Schmidt
120 Hanover Sq. Hamburg WA1 1DP UK
5 Berglunds snabbköp Alfred
Schmidt
Berguvsvägen 8 Hamburg S-958 22 Sweden
14. DATABASE MANAGEMENT SYSTEM
The SQL DELETE Statement
The DELETE statement is used to delete rows in a table.
SQL DELETE Syntax
DELETE FROM table_name
WHERE some_column=some_value;
Notice the WHERE clause in the SQL DELETE statement!
The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE clause, al
records will be deleted!
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
SQL DELETE Example
Assume we wish to delete the customer "Alfreds Futterkiste" from the "Customers" table.
We use the following SQL statement:
DELETE FROM Customers
WHERE CustomerName='Alfreds Futterkiste' AND ContactName='Maria Anders';
15. DATABASE MANAGEMENT SYSTEM
The "Customers" table will now look like this:
CustomerID CustomerName ContactName Address City PostalCode Country
2 Ana Trujillo
Emparedados y helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
Delete All Data
It is possible to delete all rows in a table without deleting the table. This means that the table structure,
attributes, and indexes will be intact:
DELETE FROM table_name;
or
DELETE * FROM table_name;
Note: Be very careful when deleting records. You cannot undo this statement!
The SQL SELECT TOP Clause
The SELECT TOP clause is used to specify the number of records to return.
The SELECT TOP clause can be very useful on large tables with thousands of records. Returning a large
number of records can impact on performance.
Note: Not all database systems support the SELECT TOP clause.
SQL Server / MS Access Syntax
SELECT TOP number|percent column_name(s)
FROM table_name;
SQL SELECT TOP Equivalent in MySQL and Oracle
16. DATABASE MANAGEMENT SYSTEM
MySQL Syntax
SELECT column_name(s)
FROM table_name
LIMIT number;
Example
SELECT *
FROM Persons
LIMIT 5;
Oracle Syntax
SELECT column_name(s)
FROM table_name
WHERE ROWNUM <= number;
Example
SELECT *
FROM Persons
WHERE ROWNUM <=5;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y
helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
17. DATABASE MANAGEMENT SYSTEM
SQL SELECT TOP Example
The following SQL statement selects the two first records from the "Customers" table:
SELECT TOP 2 * FROM Customers;
SQL SELECT TOP PERCENT Example
The following SQL statement selects the first 50% of the records from the "Customers" table:
SELECT TOP 50 PERCENT * FROM Customers;
The SQL LIKE Operator
The LIKE operator is used to search for a specified pattern in a column.
SQL LIKE Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y
helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
18. DATABASE MANAGEMENT SYSTEM
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
SQL LIKE Operator Examples
The following SQL statement selects all customers with a City starting with the letter "s":
SELECT * FROM Customers
WHERE City LIKE 's%';
Tip: The "%" sign is used to define wildcards (missing letters) both before and after the pattern. You will learn
more about wildcards in the next chapter.
The following SQL statement selects all customers with a City ending with the letter "s":
SELECT * FROM Customers
WHERE City LIKE '%s';
The following SQL statement selects all customers with a Country containing the pattern "land":
SELECT * FROM Customers
WHERE Country LIKE '%land%';
Using the NOT keyword allows you to select records that does NOT match the pattern.
The following SQL statement selects all customers with a Country NOT containing the pattern "land":
SELECT * FROM Customers
WHERE Country NOT LIKE '%land%';
SQL Wildcard Characters
In SQL, wildcard characters are used with the SQL LIKE operator.
SQL wildcards are used to search for data within a table.
With SQL, the wildcards are:
Wildcard Description
% A substitute for zero or more characters
_ A substitute for a single character
19. DATABASE MANAGEMENT SYSTEM
[charlist] Sets and ranges of characters to match
[^charlist]
or
[!charlist]
Matches only a character NOT specified within the brackets
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y
helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
Using the SQL % Wildcard
The following SQL statement selects all customers with a City starting with "ber":
SELECT * FROM Customers
WHERE City LIKE 'ber%';
The following SQL statement selects all customers with a City containing the pattern "es":
SELECT * FROM Customers
WHERE City LIKE '%es%';
Using the SQL _ Wildcard
The following SQL statement selects all customers with a City starting with any character, followed by "erlin":
20. DATABASE MANAGEMENT SYSTEM
SELECT * FROM Customers
WHERE City LIKE '_erlin';
The following SQL statement selects all customers with a City starting with "L", followed by any character,
followed by "n", followed by any character, followed by "on":
SELECT * FROM Customers
WHERE City LIKE 'L_n_on';
Using the SQL [charlist] Wildcard
The following SQL statement selects all customers with a City starting with "b", "s", or "p":
SELECT * FROM Customers
WHERE City LIKE '[bsp]%';
The following SQL statement selects all customers with a City starting with "a", "b", or "c":
SELECT * FROM Customers
WHERE City LIKE '[a-c]%';
The following SQL statement selects all customers with a City NOT starting with "b", "s", or "p":
SELECT * FROM Customers
WHERE City LIKE '[!bsp]%';
or
SELECT * FROM Customers
WHERE City NOT LIKE '[bsp]%';
The IN Operator
The IN operator allows you to specify multiple values in a WHERE clause.
SQL IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...);
Demo Database
In this tutorial we will use the well-known Northwind sample database.
21. DATABASE MANAGEMENT SYSTEM
Below is a selection from the "Customers" table:
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo
Emparedados y
helados
Ana Trujillo Avda. de la
Constitución 2222
México
D.F.
05021 Mexico
3 Antonio Moreno
Taquería
Antonio
Moreno
Mataderos 2312 México
D.F.
05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina
Berglund
Berguvsvägen 8 Luleå S-958 22 Sweden
IN Operator Example
The following SQL statement selects all customers with a City of "Paris" or "London":
SELECT * FROM Customers
WHERE City IN ('Paris','London');
The SQL BETWEEN Operator
The BETWEEN operator selects values within a range. The values can be numbers, text, or dates.
SQL BETWEEN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Below is a selection from the "Products" table:
22. DATABASE MANAGEMENT SYSTEM
ProductID ProductName SupplierID CategoryID Unit P
1 Chais 1 1 10 boxes x 20 bags 1
2 Chang 1 1 24 - 12 oz. bottles 1
3 Aniseed Syrup 1 2 12 - 550 ml bottles 1
4 Chef Anton's Cajun Seasoning 1 2 48 - 6 oz. jars 2
5 Chef Anton's Gumbo Mix 1 2 36 boxes 2
BETWEEN Operator Example
The following SQL statement selects all products with a price BETWEEN 10 and 20:
SELECT * FROM Products
WHERE Price BETWEEN 10 AND 20;
NOT BETWEEN Operator Example
To display the products outside the range of the previous example, use NOT BETWEEN:
SELECT * FROM Products
WHERE Price NOT BETWEEN 10 AND 20;
BETWEEN Operator with IN Example
The following SQL statement selects all products with a price BETWEEN 10 and 20, but products with a
CategoryID of 1, 2, or 3 should not be displayed:
SELECT * FROM Products
WHERE (Price BETWEEN 10 AND 20)
AND NOT CategoryID IN (1, 2, 3);
BETWEEN Operator with Text Value Example
The following SQL statement selects all products with a ProductName beginning with any of the letter
BETWEEN 'C' and 'M':
SELECT * FROM Products
WHERE ProductName BETWEEN 'C' AND 'M';
NOT BETWEEN Operator with Text Value Example
The following SQL statement selects all products with a ProductName beginning with any of the letter NOT
BETWEEN 'C' and 'M':
23. DATABASE MANAGEMENT SYSTEM
SELECT * FROM Products
WHERE ProductName NOT BETWEEN 'C' AND 'M';
Sample Table
Below is a selection from the "Orders" table:
OrderID CustomerID EmployeeID OrderDate ShipperID
10248 90 5 7/4/1996 3
10249 81 6 7/5/1996 1
10250 34 4 7/8/1996 2
10251 84 3 7/9/1996 1
10252 76 4 7/10/1996 2
BETWEEN Operator with Date Value Example
The following SQL statement selects all orders with an OrderDate BETWEEN '04-July-1996' and '09-July-
1996':
SELECT * FROM Orders
WHERE OrderDate BETWEEN #07/04/1996# AND #07/09/1996#;
Notice that the BETWEEN operator can produce different result in different databases!
In some databases, BETWEEN selects fields that are between and excluding the test values.
In other databases, BETWEEN selects fields that are between and including the test values.
And in other databases, BETWEEN selects fields between the test values, including the first test value
and excluding the last test value.
Therefore: Check how your database treats the BETWEEN operator!