This document provides an introduction to SQL (Structured Query Language). SQL is a language used to define, query, modify, and control relational databases. The document outlines the main SQL commands for data definition (CREATE, ALTER, DROP), data manipulation (INSERT, UPDATE, DELETE), and data control (GRANT, REVOKE). It also discusses SQL data types, integrity constraints, and how to use SELECT statements to query databases using projections, selections, comparisons, logical conditions, and ordering. The FROM clause is introduced as specifying the relations involved in a query.
This document provides an overview of SQL data definition and manipulation commands including INSERT, UPDATE, DELETE, SELECT and the CASE expression. It describes how to add, modify and remove rows from tables. It also covers selecting columns, arithmetic expressions, column aliases, concatenation, literals, DISTINCT, and conditional logic using the CASE expression. Care is advised when using DELETE and UPDATE to avoid removing unintended data.
An tutorial for sql learners in very easy way. It contains all the sql commands like ddl, dml, etc. with suitable examples.
at the end there are 3 sets of question with their solution with explanation. each set contains 40+ questions.
DDL(Data defination Language ) Using OracleFarhan Aslam
The document discusses DDL and DCL commands in Oracle including naming rules for objects, data types, creating tables, constraints, defining constraints, updating and violating constraints, creating tables using subqueries, altering tables, views, sequences, granting and revoking privileges, and dropping tables. It also discusses the Oracle data dictionary.
The document discusses SQL DML statements like SELECT, INSERT, UPDATE, and DELETE. It provides examples of using each statement to manipulate data in tables. It also covers additional SQL clauses and functions like WHERE, ORDER BY, GROUP BY, JOIN, and aggregate functions that can be used with the SELECT statement to filter, sort, group, and perform calculations on the result set.
PL/SQL provides three collection types: associative arrays, nested tables, and variable-size arrays. Associative arrays use keys to access unbounded elements, nested tables are like one-dimensional arrays with an arbitrary number of elements, and variable-size arrays store a fixed number of elements in sequential order. Both associative arrays and nested tables can have object types as elements, but only nested tables can be stored in database columns.
The document discusses various SQL concepts like database and tables, RDBMS terminology, SQL commands categories, data types, creating and manipulating tables. It explains concepts like primary key, foreign key, aggregate functions like MAX(), MIN(), AVG(), SUM(). Examples are provided for queries using SELECT, WHERE, ORDER BY, UPDATE and DELETE statements. Logical and relational operators used for filtering data in WHERE clause are also explained.
The document summarizes topics that will be covered in an advanced SQL training seminar, including SQL statement types, data types, aggregate functions, NULL handling, comparison operators, mathematical functions, joins, subqueries, views, materialized views, inline views, and optimizing SQL queries. Techniques for data sharing between databases are also mentioned. The seminar aims to provide in-depth knowledge of SQL concepts through explanations, examples, exercises and discussion.
This document discusses various data definition language (DDL) statements in SQL. It describes DDL statements to create, modify, and delete database objects like schemas, tables, views, and indexes. Specifically, it covers the CREATE, ALTER, and DROP statements for schemas, tables, views, indexes, and constraints. Examples are provided for each statement type.
This document provides an overview of SQL data definition and manipulation commands including INSERT, UPDATE, DELETE, SELECT and the CASE expression. It describes how to add, modify and remove rows from tables. It also covers selecting columns, arithmetic expressions, column aliases, concatenation, literals, DISTINCT, and conditional logic using the CASE expression. Care is advised when using DELETE and UPDATE to avoid removing unintended data.
An tutorial for sql learners in very easy way. It contains all the sql commands like ddl, dml, etc. with suitable examples.
at the end there are 3 sets of question with their solution with explanation. each set contains 40+ questions.
DDL(Data defination Language ) Using OracleFarhan Aslam
The document discusses DDL and DCL commands in Oracle including naming rules for objects, data types, creating tables, constraints, defining constraints, updating and violating constraints, creating tables using subqueries, altering tables, views, sequences, granting and revoking privileges, and dropping tables. It also discusses the Oracle data dictionary.
The document discusses SQL DML statements like SELECT, INSERT, UPDATE, and DELETE. It provides examples of using each statement to manipulate data in tables. It also covers additional SQL clauses and functions like WHERE, ORDER BY, GROUP BY, JOIN, and aggregate functions that can be used with the SELECT statement to filter, sort, group, and perform calculations on the result set.
PL/SQL provides three collection types: associative arrays, nested tables, and variable-size arrays. Associative arrays use keys to access unbounded elements, nested tables are like one-dimensional arrays with an arbitrary number of elements, and variable-size arrays store a fixed number of elements in sequential order. Both associative arrays and nested tables can have object types as elements, but only nested tables can be stored in database columns.
The document discusses various SQL concepts like database and tables, RDBMS terminology, SQL commands categories, data types, creating and manipulating tables. It explains concepts like primary key, foreign key, aggregate functions like MAX(), MIN(), AVG(), SUM(). Examples are provided for queries using SELECT, WHERE, ORDER BY, UPDATE and DELETE statements. Logical and relational operators used for filtering data in WHERE clause are also explained.
The document summarizes topics that will be covered in an advanced SQL training seminar, including SQL statement types, data types, aggregate functions, NULL handling, comparison operators, mathematical functions, joins, subqueries, views, materialized views, inline views, and optimizing SQL queries. Techniques for data sharing between databases are also mentioned. The seminar aims to provide in-depth knowledge of SQL concepts through explanations, examples, exercises and discussion.
This document discusses various data definition language (DDL) statements in SQL. It describes DDL statements to create, modify, and delete database objects like schemas, tables, views, and indexes. Specifically, it covers the CREATE, ALTER, and DROP statements for schemas, tables, views, indexes, and constraints. Examples are provided for each statement type.
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 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.
1. The document contains SQL queries to perform operations on student and course tables like creating tables, inserting data, updating records, joining tables, aggregating data, and more.
2. Basic queries include creating the tables, inserting sample data, adding columns, applying constraints, updating records, deleting records, and selecting records based on conditions.
3. More advanced queries demonstrate using joins, aggregation, sorting, subqueries and other SQL features to retrieve and manipulate the data in various ways.
SQL is a standard language for storing, manipulating and retrieving data in databases. It allows users to access and manipulate data in databases. Some key functions of SQL include executing queries against a database, retrieving data from a database, inserting, updating and deleting records in a database, and creating, altering and dropping database objects like tables.
This document provides an overview of SQL (Structured Query Language) and its main components. It discusses SQL query types like SELECT, INSERT, UPDATE, and DELETE statements. It also covers SQL joins, aliases, clauses, functions, conditions, tables and views. Finally, it provides examples and practice exercises for the SELECT and INSERT statements.
The document describes various data definition language (DDL) and data manipulation language (DML) commands in MySQL. Some key commands include using CREATE to add new databases, tables, indexes, and constraints. ALTER is used to modify existing database objects. DROP removes databases, tables, columns or indexes. DML commands like SELECT are used to query data, WHERE filters rows, JOIN combines tables, and INSERT, UPDATE, DELETE modify data. COUNT, SUM, DISTINCT and other functions can be used to aggregate or transform result sets.
This document provides information about SQL and database management systems. It discusses:
- SQL is a standard language for querying, manipulating, and defining data in databases. It was developed by IBM in the 1970s.
- SQL can be used to perform functions like retrieving data from a database, inserting new records, updating existing records, and deleting records.
- The main components of SQL are DDL, DML, DCL, and DQL which allow creating, modifying and deleting database structures, manipulating data, controlling access to data, and querying data respectively.
- Common SQL statements are discussed including SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE TABLE, and DROP TABLE. Data types and
The document provides information on various SQL commands used to create and manage databases and tables. It explains how to use SHOW, CREATE DATABASE, USE, SHOW TABLES, CREATE TABLE, DESCRIBE, ALTER TABLE, SELECT, UPDATE, DELETE, INSERT, CREATE VIEW commands. It also discusses table constraints like NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and provides examples of how to implement them in CREATE TABLE and ALTER TABLE statements.
Adbms 21 sql 99 schema definition constraints and queriesVaibhav Khanna
In SQL2, can use the CREATE TABLE command for specifying the primary key attributes, secondary keys, and referential integrity constraints (foreign keys).
Key attributes can be specified via the PRIMARY KEY and UNIQUE phrases
SQL (Structured Query Language) is a standard language for accessing and manipulating databases. It allows users to execute queries against a database, retrieve data from a database, insert records into a database, update records in a database, and delete records from a database. Common SQL statements include SELECT to retrieve data, INSERT to add data, UPDATE to modify data, DELETE to remove data, and CREATE/ALTER to manage tables and databases.
This document provides an overview of database concepts including creating, altering, and dropping databases and tables. It discusses data definition language (DDL) commands like CREATE, ALTER, DROP as well as data manipulation language (DML) commands like INSERT, SELECT, UPDATE, DELETE. It also covers database constraints, joins, functions for aggregation, strings, numbers, dates and more. The document is an introduction to core SQL concepts for a course on data management and database design.
1. The document describes experiments related to SQL DDL, DML commands and SELECT statements.
2. It discusses commands like CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, SELECT, UPDATE, DELETE and provides syntax and examples for each.
3. Queries are provided at the end of each experiment to create tables, insert data, modify structure, retrieve and manipulate data using the studied commands.
The document provides an overview of SQL commands and syntax for creating and managing databases, tables, and querying data. Key points covered include:
- SQL commands for defining schema (CREATE TABLE), manipulating data (INSERT, UPDATE, DELETE), and querying data (SELECT).
- Data types, constraints, indexes and joins.
- Examples of SQL syntax for common queries and operations like filtering, sorting, aggregation, and joining tables.
This document discusses how to limit the rows returned from a query using a WHERE clause, comparison operators, logical operators, and null conditions. It also explains how to sort the rows returned using an ORDER BY clause. Finally, it covers the use of substitution variables in SQL*Plus to make queries more flexible by prompting for values.
This document provides an outline and overview of key concepts in SQL including:
1. Data types that can be used in SQL and considerations when choosing a data type.
2. The two basic classes of SQL - DDL (data definition language) for defining database objects and DML (data manipulation language) for manipulating data.
3. Key DDL operations like CREATE, ALTER, and DROP for creating, modifying and deleting database objects as well as creating primary keys, foreign keys, views and more.
SQL is a language for managing and manipulating databases. It includes languages for data definition (DDL), data manipulation (DML), data retrieval (DRL), transaction control (TCL), and data control (DCL). The document provides detailed syntax examples for creating tables, inserting data, selecting data using conditions, updating and deleting records, and managing transactions using commands like commit, rollback, and savepoints. It also covers altering tables and dropping or renaming database objects.
The document discusses Structured Query Language (SQL) and its uses. It covers SQL statements like SELECT, INSERT, UPDATE, DELETE to manipulate databases. It also covers SQL data definition language statements like CREATE TABLE to create tables, ALTER TABLE to modify tables, and DROP TABLE to delete tables. Additionally, it discusses SQL data types, constraints like PRIMARY KEY, UNIQUE, FOREIGN KEY and CHECK constraints.
Les09 (using ddl statements to create and manage tables)Achmad Solichin
Using DDL Statements to Create and Manage Tables
The document discusses using DDL statements to create and manage database tables. It covers categorizing database objects like tables, views, indexes, and sequences. It also covers the syntax for creating tables, specifying column names and data types, creating constraints, and dropping tables. Examples are provided for creating a simple table, adding constraints, creating a table using a subquery, and altering or dropping existing tables.
This document contains the personal details, education history, skills, work experience, and references of Mohd Syuhairey Bin Siron. He was born in 1990 in Hospital Kulim, Kedah, Malaysia. He completed his SPM in 2007 and has skills in Microsoft applications and the Windows operating system. His work experience includes positions as an operator at Aicello Malaysia and a machine operator at Hoya Electronics, where he has experience running various machines. He provides two references from his previous employers to contact.
This study analyzes the impact of Indonesia's Village Midwife program on health outcomes between 1993 and 1997 using data from the Indonesian Family Life Survey. The analysis finds that:
1) Villages that gained a midwife saw a significant increase in average BMI among women of reproductive age (19-45) but not in other groups.
2) This effect remained even after controlling for individual characteristics and differences in infrastructure between villages.
3) The results provide evidence that the Village Midwife program had a causal impact on improving health outcomes for its target population of reproductive-age women.
Mountains form through tectonic plate collisions that cause the land surface to buckle upwards. They are raised portions of land that are usually at least 1,000 feet above the surrounding terrain, with their highest point called the summit. Mountains influence weather patterns by blocking or redirecting wind and precipitation, creating rain shadows and altering climates on their windward and leeward sides. The Himalayas formed 55 million years ago during the collision of the Indo-Australian and Eurasian plates.
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 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.
1. The document contains SQL queries to perform operations on student and course tables like creating tables, inserting data, updating records, joining tables, aggregating data, and more.
2. Basic queries include creating the tables, inserting sample data, adding columns, applying constraints, updating records, deleting records, and selecting records based on conditions.
3. More advanced queries demonstrate using joins, aggregation, sorting, subqueries and other SQL features to retrieve and manipulate the data in various ways.
SQL is a standard language for storing, manipulating and retrieving data in databases. It allows users to access and manipulate data in databases. Some key functions of SQL include executing queries against a database, retrieving data from a database, inserting, updating and deleting records in a database, and creating, altering and dropping database objects like tables.
This document provides an overview of SQL (Structured Query Language) and its main components. It discusses SQL query types like SELECT, INSERT, UPDATE, and DELETE statements. It also covers SQL joins, aliases, clauses, functions, conditions, tables and views. Finally, it provides examples and practice exercises for the SELECT and INSERT statements.
The document describes various data definition language (DDL) and data manipulation language (DML) commands in MySQL. Some key commands include using CREATE to add new databases, tables, indexes, and constraints. ALTER is used to modify existing database objects. DROP removes databases, tables, columns or indexes. DML commands like SELECT are used to query data, WHERE filters rows, JOIN combines tables, and INSERT, UPDATE, DELETE modify data. COUNT, SUM, DISTINCT and other functions can be used to aggregate or transform result sets.
This document provides information about SQL and database management systems. It discusses:
- SQL is a standard language for querying, manipulating, and defining data in databases. It was developed by IBM in the 1970s.
- SQL can be used to perform functions like retrieving data from a database, inserting new records, updating existing records, and deleting records.
- The main components of SQL are DDL, DML, DCL, and DQL which allow creating, modifying and deleting database structures, manipulating data, controlling access to data, and querying data respectively.
- Common SQL statements are discussed including SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE TABLE, and DROP TABLE. Data types and
The document provides information on various SQL commands used to create and manage databases and tables. It explains how to use SHOW, CREATE DATABASE, USE, SHOW TABLES, CREATE TABLE, DESCRIBE, ALTER TABLE, SELECT, UPDATE, DELETE, INSERT, CREATE VIEW commands. It also discusses table constraints like NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and provides examples of how to implement them in CREATE TABLE and ALTER TABLE statements.
Adbms 21 sql 99 schema definition constraints and queriesVaibhav Khanna
In SQL2, can use the CREATE TABLE command for specifying the primary key attributes, secondary keys, and referential integrity constraints (foreign keys).
Key attributes can be specified via the PRIMARY KEY and UNIQUE phrases
SQL (Structured Query Language) is a standard language for accessing and manipulating databases. It allows users to execute queries against a database, retrieve data from a database, insert records into a database, update records in a database, and delete records from a database. Common SQL statements include SELECT to retrieve data, INSERT to add data, UPDATE to modify data, DELETE to remove data, and CREATE/ALTER to manage tables and databases.
This document provides an overview of database concepts including creating, altering, and dropping databases and tables. It discusses data definition language (DDL) commands like CREATE, ALTER, DROP as well as data manipulation language (DML) commands like INSERT, SELECT, UPDATE, DELETE. It also covers database constraints, joins, functions for aggregation, strings, numbers, dates and more. The document is an introduction to core SQL concepts for a course on data management and database design.
1. The document describes experiments related to SQL DDL, DML commands and SELECT statements.
2. It discusses commands like CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, SELECT, UPDATE, DELETE and provides syntax and examples for each.
3. Queries are provided at the end of each experiment to create tables, insert data, modify structure, retrieve and manipulate data using the studied commands.
The document provides an overview of SQL commands and syntax for creating and managing databases, tables, and querying data. Key points covered include:
- SQL commands for defining schema (CREATE TABLE), manipulating data (INSERT, UPDATE, DELETE), and querying data (SELECT).
- Data types, constraints, indexes and joins.
- Examples of SQL syntax for common queries and operations like filtering, sorting, aggregation, and joining tables.
This document discusses how to limit the rows returned from a query using a WHERE clause, comparison operators, logical operators, and null conditions. It also explains how to sort the rows returned using an ORDER BY clause. Finally, it covers the use of substitution variables in SQL*Plus to make queries more flexible by prompting for values.
This document provides an outline and overview of key concepts in SQL including:
1. Data types that can be used in SQL and considerations when choosing a data type.
2. The two basic classes of SQL - DDL (data definition language) for defining database objects and DML (data manipulation language) for manipulating data.
3. Key DDL operations like CREATE, ALTER, and DROP for creating, modifying and deleting database objects as well as creating primary keys, foreign keys, views and more.
SQL is a language for managing and manipulating databases. It includes languages for data definition (DDL), data manipulation (DML), data retrieval (DRL), transaction control (TCL), and data control (DCL). The document provides detailed syntax examples for creating tables, inserting data, selecting data using conditions, updating and deleting records, and managing transactions using commands like commit, rollback, and savepoints. It also covers altering tables and dropping or renaming database objects.
The document discusses Structured Query Language (SQL) and its uses. It covers SQL statements like SELECT, INSERT, UPDATE, DELETE to manipulate databases. It also covers SQL data definition language statements like CREATE TABLE to create tables, ALTER TABLE to modify tables, and DROP TABLE to delete tables. Additionally, it discusses SQL data types, constraints like PRIMARY KEY, UNIQUE, FOREIGN KEY and CHECK constraints.
Les09 (using ddl statements to create and manage tables)Achmad Solichin
Using DDL Statements to Create and Manage Tables
The document discusses using DDL statements to create and manage database tables. It covers categorizing database objects like tables, views, indexes, and sequences. It also covers the syntax for creating tables, specifying column names and data types, creating constraints, and dropping tables. Examples are provided for creating a simple table, adding constraints, creating a table using a subquery, and altering or dropping existing tables.
This document contains the personal details, education history, skills, work experience, and references of Mohd Syuhairey Bin Siron. He was born in 1990 in Hospital Kulim, Kedah, Malaysia. He completed his SPM in 2007 and has skills in Microsoft applications and the Windows operating system. His work experience includes positions as an operator at Aicello Malaysia and a machine operator at Hoya Electronics, where he has experience running various machines. He provides two references from his previous employers to contact.
This study analyzes the impact of Indonesia's Village Midwife program on health outcomes between 1993 and 1997 using data from the Indonesian Family Life Survey. The analysis finds that:
1) Villages that gained a midwife saw a significant increase in average BMI among women of reproductive age (19-45) but not in other groups.
2) This effect remained even after controlling for individual characteristics and differences in infrastructure between villages.
3) The results provide evidence that the Village Midwife program had a causal impact on improving health outcomes for its target population of reproductive-age women.
Mountains form through tectonic plate collisions that cause the land surface to buckle upwards. They are raised portions of land that are usually at least 1,000 feet above the surrounding terrain, with their highest point called the summit. Mountains influence weather patterns by blocking or redirecting wind and precipitation, creating rain shadows and altering climates on their windward and leeward sides. The Himalayas formed 55 million years ago during the collision of the Indo-Australian and Eurasian plates.
This document provides instructions for installing and configuring an ADSL2+ modem. It includes sections on hardware installation, connecting to the internet, configuring local network and DHCP server settings, checking status, resetting to default settings, and specifications. The document contains diagrams of the modem hardware and definitions of acronyms used.
The document announces Murdoch University's annual counselor's workshop event and Murdoch University Comes to Your School Week. The events aim to equip high school leavers with the knowledge and skills needed for higher education. The week-long events include interactive workshops in media, business, IT and critical thinking. Schools can bring classes to the university campus for experiences in these fields.
This case study outlines the workings of the Consumer Exchange Network, or CXN
(www.cxn.com). CXN is a St. Louis, MO-based startup company with the mission of
providing an efficient online pricing mechanism to bring together buyers and sellers of
new consumer products.
Pendidikan agama islam tentang zina dan budi pekertiDinda R P
Dokumen tersebut membahas tentang larangan berduaan tanpa mahram dan larangan berzina menurut agama Islam. Terdapat hadis yang menjelaskan hukuman bagi pelaku zina yaitu cambuk 100 kali dan pengasingan selama setahun untuk laki-laki, serta hukuman rajam bagi perempuan. Dokumen ini juga membahas tentang kisah hukum yang diambil Rasulullah saw mengenai kasus zina.
Mountains form through tectonic plate movement and volcanism which pushes land upwards and causes plates to crumple. There are different types of mountains such as volcanic, fold, and block mountains. Mount Fuji in Japan emerged around 100,000 years ago through volcanic activity and is a well-known symbol of Japan. Mountains can impact the environment through precipitation changes and blocking winds.
Using DDL Statements to Create and Manage Tables
This document discusses using data definition language (DDL) statements to create and manage database tables. It covers categorizing database objects like tables, views, and indexes; defining table structures with columns and data types; creating tables with the CREATE TABLE statement; adding constraints at table creation; and dropping tables with DROP TABLE. The key topics are creating simple tables, understanding available data types, defining columns and constraints, and using DDL statements like CREATE TABLE, ALTER TABLE, and DROP TABLE to manage tables.
The document introduces common data types in SQL such as char, varchar, int, numeric, and date. It describes how to create databases and tables using SQL statements like CREATE DATABASE, CREATE TABLE, INSERT INTO, and ALTER TABLE. It also covers SQL queries using SELECT, FROM, WHERE, ORDER BY, LIKE and other clauses to retrieve and filter data from one or more tables.
The document describes Data Definition Language (DDL) commands in SQL. It explains that DDL allows the specification of relations, schemas, domains, integrity constraints, indices, security, and storage structures. The core DDL commands are CREATE, ALTER, and DROP. CREATE is used to define new tables with columns, data types, primary keys, foreign keys and other constraints. ALTER modifies existing tables by adding, dropping, renaming columns or modifying column properties. DROP removes tables from the database. Examples are provided for each command demonstrating how to define, modify and remove tables for a university database schema.
The document provides an introduction to the SQL language, including its main components of DML (Data Manipulation Language) and DDL (Data Definition Language). It discusses SQL concepts such as creating tables with data types, defining primary and foreign keys, and using basic queries with SELECT, FROM, WHERE and ORDER BY clauses.
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDev Chauhan
(i) DDL (Data Definition Language) is used to define the schema of the database. It is used to create, modify or delete definitions of database objects like tables, indexes, views etc.
(ii) DML (Data Manipulation Language) is used to manipulate the data present in the database. It is used to insert, update or delete rows/records from tables. Examples are SELECT, INSERT, UPDATE, DELETE statements.
(iii) Primary Key is a column or set of columns in a table that uniquely identifies each row/record in the table. It must contain unique values and cannot contain NULL values.
(iv) Candidate Key is a column or set of columns that can uniquely identify rows/records in a
This document provides an introduction and overview of MySQL. It discusses MySQL's use of SQL for defining, modifying, and querying databases. It describes SQL statements for creating databases and tables, inserting, updating, and deleting rows of data, and performing basic queries with SELECT statements. It also covers concepts like aggregate functions, GROUP BY clauses, and handling null values in queries.
This document provides an overview of SQL (Structured Query Language) including key statements and concepts. It discusses the different types of SQL statements including DDL for definitions, DML for data manipulation, and DCL for access control. It also summarizes important SQL statements and clauses like SELECT, INSERT, UPDATE, DELETE, WHERE, GROUP BY, HAVING, ORDER BY and more. The document is intended as an introduction to the SQL language and relational database concepts.
This document provides an overview of SQL (Structured Query Language). It discusses SQL functions including data manipulation language (DML) and data definition language (DDL). DML commands like SELECT, UPDATE, DELETE and INSERT are covered. The SELECT statement syntax and use of clauses like WHERE, ORDER BY, GROUP BY and JOINs are explained. Aggregate functions like COUNT, AVG, SUM etc and scalar functions are also summarized. Examples are provided throughout to illustrate the concepts and syntax.
This document provides an overview of Structured Query Language (SQL) including its core components: Data Definition Language (DDL) for defining database schemas, Data Manipulation Language (DML) for querying and modifying data, and Data Control Language (DCL) for managing permissions and transactions. It describes SQL statements for creating tables, defining constraints, and querying data using SELECT statements. Examples are provided to illustrate concepts like joins, aliases, and pattern matching. Data types, NULL handling, and nested queries are also summarized.
MySQL is an SQL-based relational database management system that is compatible with standard SQL. SQL is used for data definition and modification. Data definition statements like CREATE DATABASE and CREATE TABLE are used to define the schema. Data modification statements like INSERT, UPDATE, and DELETE are used to add, modify, and remove data from tables. Queries use SELECT statements to retrieve data from one or more tables, along with WHERE and JOIN clauses to filter rows and aggregate functions to perform calculations on groups of data.
SQL is a language used for managing data in relational database management systems. The core SQL statements are used for data definition, queries, and updates. The CREATE statement is used to define tables and other schema objects. Tables have attributes with specified data types. Constraints like primary keys, unique keys, foreign keys, checks, and defaults can be defined. The SELECT statement is used to query data using projections, selections from tables using a FROM clause and optional WHERE clause. Data can be inserted, updated, and deleted using the INSERT, UPDATE, and DELETE statements respectively. Views provide virtual tables derived from other base tables.
This document discusses SQL SELECT statements and their capabilities. It begins by listing the objectives and providing definitions of SQL and the Microsoft SQL Server database model. It then describes Data Definition Language and Data Manipulation Language statements. The document focuses on the capabilities of SELECT statements, including projecting columns, selecting rows, joining tables, and using arithmetic expressions, null values, column aliases, and the DISTINCT keyword to eliminate duplicate rows. Examples are provided for each concept.
The document provides an overview of key database concepts including:
- A database is a collection of logically related information stored and managed using database management system software.
- Relational databases organize data into tables with rows and columns and use keys to link related data across tables. Structured Query Language (SQL) is used to perform operations like data queries and manipulation.
- Database management involves tasks like defining the database structure with data definition language statements, manipulating data with data manipulation language statements, and running queries with the SELECT statement to retrieve and work with data in the database.
This document provides an overview of databases and SQL. It begins by defining what a database is and the different types, including relational and non-relational databases. It then explains what SQL is and how it is used to perform CRUD operations on relational databases. The document outlines database structure and what tables are. It also describes key SQL concepts like data types, commands, queries, constraints, joins and more.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
SQL is a database sublanguage used to query and modify relational databases. It consists of two categories of statements: DDL (data definition language) used to define database schema objects like tables and indexes, and DML (data manipulation language) used to manipulate data within those objects. Oracle's SQL*Plus tool allows users to enter, edit, run and format SQL statements against an Oracle database. Common Oracle database objects include tables, views, indexes, triggers, and users. SQL statements like CREATE TABLE, ALTER TABLE, INSERT, UPDATE, DELETE and SELECT are used to define and manipulate data in database tables.
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQueryAbhishek590097
Common table expressions (CTEs) allow users to define temporary result sets within a single SQL statement that can be referenced within that statement, making complex queries easier to read and maintain by breaking them down into simpler components, while subqueries return data from a nested SQL query to filter the results of the outer query. Joins combine data from two or more tables by linking common columns between them and come in various types like inner, left, right, full, and cross joins.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
3. SQL
SQL is acronym for
"Structured Query Language".
SQL is a high-level language for defining,
querying, modifying, and controlling the
data in a relational database.
SQL is not case sensitive (the verb
SELECT is the same as verb SelEcT).
4. SQL Commands
Category SQL Description
commands
CREATE Creation of tables
Data Description (DDL) ALTER Modification of tables
DROP Removal of tables
INSERT Insertion of rows in a table
Data Manipulation (DML) UPDATE Update of rows in a table
DELETE Removal of rows in a table
GRANT Grant of access rights
REVOKE Removal of access rights
Data Control (DCL)
COMMIT Treatment of updates
ROLLBACK Removal of updates
Interrogation SELECT Queries
5. Data Definition Language
The SQL data-definition language (DDL)
allows the specification of information about
relations, including:
The schema for each relation.
The domain of values associated with each attribute.
Integrity constraints
And as we will see later, also other information such as
– The set of indices to be maintained for each relations.
– Security and authorization information for each relation.
– The physical storage structure of each relation on disk.
6. Domain Types in SQL
char(n): Fixed length character string, with user-specified
length n.
varchar(n): Variable length character strings, with user-
specified maximum length n.
Int: Integer (a finite subset of the integers that is machine-
dependent).
Smallint: Small integer (a machine-dependent subset of the
integer domain type).
numeric(p,d): Fixed point number, with user-specified
precision of p digits, with n digits to the right of decimal point.
real, double precision: Floating point and double-
precision floating point numbers, with machine-dependent
precision.
float(n): Floating point number, with user-specified precision
of at least n digits.
More are covered later.
7. Create Table Construct
An SQL relation is defined using the create table
command:
create table r (A1 D1, A2 D2, ..., An Dn ,
(integrity-constraint1),
...,
(integrity-constraintk) );
– r is the name of the relation
– each Ai is an attribute name in the schema of
relation r
– Di is the data type of values in the domain of
attribute Ai
8. Integrity Constraints in Create Table
not null
primary key (A1, ..., An )
foreign key (Am, ..., An ) references r
Unique Key
Check
9. Create Example 1
create table instructor (
ID char (5),
name varchar (20) not null ,
dept_name varchar (20),
salary numeric (8,2) );
10. Create Example 2
Declare dept_name as the primary key for
department.
create table instructor (
ID char (5),
name varchar (20) not null,
dept_name varchar (20),
salary numeric (8,2),
primary key (ID),
foreign key (dept_name) references department );
primary key declaration on an attribute automatically
ensures not null
11. Create Example 3
Create table employee (
Fname varchar (20) NOT NULL ,
Lname varchar (20) NOT NULL ,
SSN char (9),
Bdate Date ,
Address varchar (30),
Sex Char NoT NULL ,
Salary decimal (10,2),
SuperSSN char (9),
Dno int NOT NULL ,
Primary key (SSN) );
12. And more still
create table course (
course_id varchar (8) primary key ,
title varchar( 50),
dept_name varchar (20),
credits numeric (2,0),
foreign key (dept_name) references
department) );
Primary key declaration can be combined with
attribute declaration as shown above
13. Alter Table Constructs
alter table r add A D ;
– where A is the name of the attribute to be added
to relation r and D is the domain of A.
– All tuples in the relation are assigned null as the
value for the new attribute.
alter table r drop A ;
– where A is the name of an attribute of relation r
– Dropping of attributes not supported by many
databases
14. Drop Table Constructs
drop table table_name ;
– Deletes the table and its contents
delete from table_name ;
– Deletes all contents of table, but retains table
18. UPDATE operation
General format
UPDATE table
SET field = scalar-expression
[, field = scalar-expression ] …..
[ WHERE condition ] ;
19. UPDATE examples
Increase salaries of instructors whose salary is over
$100,000 by 3%
update instructor
set salary = salary * 1.03
where salary > 100000;
UPDATE Store_Information
SET Sales = 500
WHERE store_name = "Los Angeles"
AND Date = "Jan-08-1999“;
20. DELETE operation
Delete all records in a “table” that satisfy a
“condition”
General format
DELETE FROM table [ WHERE condition ] ;
21. DELETE examples
Delete all instructors
delete from instructor ;
Delete all instructors from the Finance department
delete from instructor
where dept_name= ’Finance’;
22. Interrogation operation
Queries are done by using SELECT command
The result of an SQL query is a relation.
Syntax of the SELECT command
SELECT [DISTINCT ] {* | expr [AS alias], ... }
FROM table [alias], ...
[WHERE { conditions | under conditions} ]
[GROUP BY expr, ...] [HAVING conditions]
[ORDER BY {expr | num}{ASC | DESC }, ...];
23. SELECT command
Syntactical agreements
CAPITAL LETTERS : (SELECT) Enter values exactly as presented.
Italic : column, table. Parameter having to be replaced
by the suitable value.
Alias : Synonym of a name of table or column.
Conditions : Expression having the true or false value.
Under conditions : Expression containing a subquery.
Expr : Column, or calculated attribute (+,-, *, /)
Num : Column number
{} : Ex {ON|OFF}. One of the values separated by "|"
must obligatory be typed in.
[ ] : optional Value.
( ) : the brackets and commas must be type in as
presented.
... : The preceding values can be repeated several
times
_ Underlined : indicate the default value.
24. The select Clause
An asterisk in the select clause denotes “all
attributes”
To force the elimination of duplicates, insert the
keyword distinct after select.
25. SQL: Projection
The operation of projection consists in selecting the
name of the columns of table(s) which one wishes
to see appearing in the answer.
If one wants to display all the columns "*" should be
used.
The columns are given after the SELECT clause.
26. Projection examples
Display the contents of the table STUDENT
SELECT *
FROM STUDENT;
Display the Name and the ID of the students
SELECT st_name, st_id
FROM STUDENT;
27. SQL: Selection
The operation of selection consists in selecting
rows (tuples) of one (or several) table(s) which
satisfy certain conditions.
The conditions are expressed after the WHERE
clause.
28. Selection examples
Display the list of the students of male sex.
SELECT *
FROM STUDENT
WHERE Cdsexe=‘M';
Display department ID and name that are located in
Cairo
Select dept_id, dept_name
from departments
where location = ‘Cairo’;
29. Projection and Selection
The operations of projection and selection can
obviously be used in the same SQL request.
Display the number and the name of the students
born in 1980
SELECT st_id, st_name
FROM STUDENT
WHERE Dtnaiss >= '1980-01-01' AND Dtnaiss <=
'1980-12-31';
30. Comparison Conditions
= Equal
> greater than
>= greater than or equal
< less than
<= less than or equal
<> not equal
Between …… AND ….. (between two values)
IN (set) (Match any of a list of values)
All ( set) (Match all values in the list)
31. Examples
Select last_name, salary
from employees
where salary >1000 ;
SELECT *
FROM suppliers
WHERE supplier_id between 5000 AND 5010;
Select emp_id, last_name, salary, manager_id
From employees
where manager_id IN (100, 101, 200);
32. Logical Conditions
AND
OR
NOT
Select emp_id, last_name, salary, manager_id
From employees
where manager_id NOT IN (100, 101, 200);
33. Arithmetic Expressions
+-*/
Select last_name, salary, salary + 300
from employees;
Order of precedence: * , / , +, -
You can enforce priority by adding parentheses
Select last_name, salary, 10 * (salary + 300)
from employees;
34. Order by Clause
Retrieval with ordering (ASC, DESC)
ASC is the default
Select fname, dept_id, hire_date
from employees
Order by hire_date DESC;
Select fname, dept_id, salary
from employees
Order by dept_id, Salary ASC;
35. The FROM clause
The from clause lists the relations involved in the
query
– Corresponds to the Cartesian product operation
of the relational algebra.
Find the Cartesian product instructor X teaches
select ∗
from instructor, teaches
– generates every possible instructor – teaches
pair, with all attributes from both relations
Cartesian product not very useful directly, but useful
combined with where-clause condition