This document provides an overview of SQL and relational databases. It discusses basic SQL statements like SELECT, WHERE, and JOINs. It also covers more advanced topics like aggregate functions, views, creating/altering tables, and subqueries. The document uses sample tables to demonstrate how to write queries to retrieve, update, and analyze data stored in relational database tables.
This document provides an introduction to SQL and database systems. It begins with example tables to demonstrate SQL concepts. It then covers the objectives of SQL, including allowing users to create database structures, manipulate data, and perform queries. Various SQL concepts are introduced such as data types, comparison operators, logical operators, and arithmetic operators. The document also discusses SQL statements for schema and catalog definitions, data definition, data manipulation, and other operators. Example SQL queries are provided to illustrate concepts around selecting columns, rows, sorting, aggregation, grouping, and more.
This document contains questions and answers related to Oracle SQL and PL/SQL. It begins with 29 multiple choice questions about SQL queries, functions, joins, views, constraints and other database concepts. The questions are numbered and include possible answer choices with the correct answers marked in red.
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 summarizes a literature review and study on military recruitment of high school students. The literature review covers previous research on military demographics and benefits offered to students. The study hypothesized that students from lower socioeconomic backgrounds, racial minorities, and lower academic achievement would experience higher rates of military recruitment. Surveys and interviews with army recruiters found some support for this, with recruiters reporting focusing recruitment efforts on majority-black, lower-income schools. The results provided mixed support for theories on power structures and rational choice in decision making.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
This document provides an overview of SQL and database concepts. It discusses:
- The basic structure of tables, rows, columns, and data types
- The four main SQL languages: DDL, DML, TCL, and DCL and common commands like CREATE, INSERT, UPDATE, DELETE, etc.
- Database objects like tables, views, indexes, and how to query them
- Constraints like PRIMARY KEY, UNIQUE, NOT NULL and REFERENTIAL integrity
- Transactions with COMMIT, ROLLBACK, and SAVEPOINT
This document contains an SQL document with tables, sample data, and SQL queries with answers. It defines tables for locations, departments, jobs, employees, and includes sample data. It then lists 66 SQL queries with varying complexity using keywords like WHERE, GROUP BY, HAVING, ORDER BY, JOIN, SUBQUERY and SET OPERATORS. The queries retrieve and filter data from the tables in different ways, such as finding employees in a department or those earning a certain salary range.
This document discusses different types of SQL joins: inner join, outer join, and cross join. It explains that inner joins return only matching records from both tables, while outer joins return all records from one table and matching records from the other table. The three types of outer joins are left, right, and full outer joins. Cross joins return all possible combinations of records between the two tables. Syntax examples and sample queries are provided to illustrate each type of join.
This document provides an introduction to SQL and database systems. It begins with example tables to demonstrate SQL concepts. It then covers the objectives of SQL, including allowing users to create database structures, manipulate data, and perform queries. Various SQL concepts are introduced such as data types, comparison operators, logical operators, and arithmetic operators. The document also discusses SQL statements for schema and catalog definitions, data definition, data manipulation, and other operators. Example SQL queries are provided to illustrate concepts around selecting columns, rows, sorting, aggregation, grouping, and more.
This document contains questions and answers related to Oracle SQL and PL/SQL. It begins with 29 multiple choice questions about SQL queries, functions, joins, views, constraints and other database concepts. The questions are numbered and include possible answer choices with the correct answers marked in red.
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 summarizes a literature review and study on military recruitment of high school students. The literature review covers previous research on military demographics and benefits offered to students. The study hypothesized that students from lower socioeconomic backgrounds, racial minorities, and lower academic achievement would experience higher rates of military recruitment. Surveys and interviews with army recruiters found some support for this, with recruiters reporting focusing recruitment efforts on majority-black, lower-income schools. The results provided mixed support for theories on power structures and rational choice in decision making.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
This document provides an overview of SQL and database concepts. It discusses:
- The basic structure of tables, rows, columns, and data types
- The four main SQL languages: DDL, DML, TCL, and DCL and common commands like CREATE, INSERT, UPDATE, DELETE, etc.
- Database objects like tables, views, indexes, and how to query them
- Constraints like PRIMARY KEY, UNIQUE, NOT NULL and REFERENTIAL integrity
- Transactions with COMMIT, ROLLBACK, and SAVEPOINT
This document contains an SQL document with tables, sample data, and SQL queries with answers. It defines tables for locations, departments, jobs, employees, and includes sample data. It then lists 66 SQL queries with varying complexity using keywords like WHERE, GROUP BY, HAVING, ORDER BY, JOIN, SUBQUERY and SET OPERATORS. The queries retrieve and filter data from the tables in different ways, such as finding employees in a department or those earning a certain salary range.
This document discusses different types of SQL joins: inner join, outer join, and cross join. It explains that inner joins return only matching records from both tables, while outer joins return all records from one table and matching records from the other table. The three types of outer joins are left, right, and full outer joins. Cross joins return all possible combinations of records between the two tables. Syntax examples and sample queries are provided to illustrate each type of join.
The document provides an overview of basic concepts related to SQL server databases including database objects, file systems, storage structures, and query processing. It discusses topics like SQL server databases, storage files and file groups, data pages and extents, data organization in heaps vs indexed tables, and how queries are processed through either full table scans or using indexes.
SQL is a special-purpose programming language designed to manage data in relational database management systems (RDBMS). It allows users to define, manipulate, and control access to data in databases. SQL statements are divided into two main categories: DDL (Data Definition Language) statements are used to define database objects like tables, while DML (Data Manipulation Language) statements are used to query and manipulate data like SELECT, INSERT, UPDATE, DELETE. SQL was developed in the 1970s by IBM researchers Donald D. Chamberlin and Raymond F. Boyce and was initially called SEQUEL.
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | EdurekaEdureka!
This tutorial on data warehouse concepts will tell you everything you need to know in performing data warehousing and business intelligence. The various data warehouse concepts explained in this video are:
1. What Is Data Warehousing?
2. Data Warehousing Concepts:
i. OLAP (On-Line Analytical Processing)
ii. Types Of OLAP Cubes
iii. Dimensions, Facts & Measures
iv. Data Warehouse Schema
Presentation slides of Sequence Query Language (SQL)Punjab University
SQL is a language used to communicate with and perform operations on relational database management systems (RDBMS). The document outlines what SQL is, what it can do, important SQL commands like SELECT, INSERT, UPDATE and DELETE, how to create and drop databases and tables, and key concepts like primary keys, foreign keys, and constraints. SQL allows users to retrieve, manipulate and transform data stored in an RDBMS through statements that include keywords, clauses, aggregates, expressions, identifiers, parameters, and operators.
This presentation describes about the following topics
Logical Operators
LISTS (IN AND NOT IN)
RANGES (BETWEEN AND NOT BETWEEN)
ORDER BY
Aggregate functions
GROUP BY and HAVING
UNION
This document summarizes an overview presentation on SQL Server basics for non-database administrators. It covers SQL Server 2005 platform features, managing databases, database maintenance and protection, securing SQL Server, and managing database objects. The document provides high-level information on these SQL Server administration topics in less than 3 sentences.
This document provides an overview and introduction to Oracle SQL basics. It covers topics such as installing Oracle software like the database, Java SDK, and SQL Developer tool. It then discusses database concepts like what a database and table are. It also covers database fundamentals including SQL queries, functions, joins, constraints, views and other database objects. The document provides examples and explanations of SQL statements and database components.
Here i am giving some sql queries which is helpful for practicing in sql server for learning more sql interview questions you can refer this link http://skillgun.com/sql/interview-questions-and-answers
Data validation in Excel allows users to restrict the type of data entered into cells. This includes creating drop-down lists, restricting dates or numbers, and custom validation rules. The document provides steps to apply data validation to a cell by selecting the cell, going to the data validation menu, choosing the type of validation such as a list, selecting the source of the list options, and setting input and error messages. Data validation helps ensure accurate data entry by limiting users to valid options.
This document discusses different types of SQL joins, including inner joins, left joins, right joins, full joins, and self joins. It provides examples of the syntax for each type of join, along with sample queries and resulting tables to illustrate how each join works. Inner joins return rows where there is a match in both tables. Left and right joins return all rows from the left or right table respectively, along with matched or null rows from the other table. Full joins return all rows and fill in nulls for missing matches. Self joins allow a table to join with itself.
This document provides an overview of SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. It describes what SQL can do, such as execute queries, retrieve, insert, update and delete data. It also covers important SQL statements (SELECT, UPDATE, DELETE, INSERT), clauses (WHERE, ORDER BY), operators (LIKE), joins, and functions. In addition, it discusses SQL data types, constraints, creating tables and indexes.
This presentation gives a clear and concise description of joins in sql and several types of sql joins.
These slides also contains the pictorial representation as well as syntax for each type of joins.
This document discusses SQL set operators such as UNION, UNION ALL, INTERSECT, and MINUS. It provides examples of how to use each operator to combine result sets from multiple queries, eliminate duplicates, return common or unique rows, and control the order of rows in the final output. Tables used in the examples include the EMPLOYEES and JOB_HISTORY tables, which contain data on current and previous employee jobs. Guidelines are provided around matching columns in UNION queries and using parentheses and ORDER BY.
The document explains how to create a VLOOKUP formula in Microsoft Excel 2010 to search for data in a table and return matching values. It describes the four components of a VLOOKUP formula - the lookup value, table array, column index number, and optional range lookup parameter. An example is provided demonstrating how to use VLOOKUP to search an inventory database by part number and return the stock level and price.
This document contains questions from 5 units on the topic of database management systems. The questions cover a wide range of topics including DBMS architecture, data models, relational algebra, normalization, concurrency control, transaction management, distributed databases, data warehousing, and decision support systems. Specifically, some of the questions ask about ER modeling, functional dependencies, transaction processing, concurrency control protocols, ACID properties, client-server architecture, and OLAP.
Partitioning allows tables and indexes to be subdivided into smaller pieces called partitions. Tables can be partitioned using a partition key which determines which partition each row belongs to. Partitioning provides benefits like improved query performance for large tables, easier management of historical data, and increased high availability. Some disadvantages include additional licensing costs, storage space usage, and administrative overhead to manage partitions. Common partitioning strategies include range, list, hash and interval which divide tables in different ways based on column values.
This document provides instructions and exercises for an assignment on database development. It includes sample tables for employees and departments with sample data. It then lists a series of exercises involving writing SQL statements to retrieve, manipulate, and group data from the sample tables. The exercises cover basic SELECT statements, filtering with WHERE, sorting with ORDER BY, aggregation with GROUP BY, and data modification using INSERT, UPDATE, DELETE statements.
The document discusses the Indian business environment and various factors that affect businesses. It defines business and business environment. The macro environment consists of social, technological, economic, political, legal, ecological and other factors that indirectly impact businesses. It provides examples of how changes in these factors, such as new technology or legislation, can influence companies. Environmental scanning is important for businesses to identify opportunities and threats and adapt their strategies accordingly.
The document provides an overview of basic concepts related to SQL server databases including database objects, file systems, storage structures, and query processing. It discusses topics like SQL server databases, storage files and file groups, data pages and extents, data organization in heaps vs indexed tables, and how queries are processed through either full table scans or using indexes.
SQL is a special-purpose programming language designed to manage data in relational database management systems (RDBMS). It allows users to define, manipulate, and control access to data in databases. SQL statements are divided into two main categories: DDL (Data Definition Language) statements are used to define database objects like tables, while DML (Data Manipulation Language) statements are used to query and manipulate data like SELECT, INSERT, UPDATE, DELETE. SQL was developed in the 1970s by IBM researchers Donald D. Chamberlin and Raymond F. Boyce and was initially called SEQUEL.
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | EdurekaEdureka!
This tutorial on data warehouse concepts will tell you everything you need to know in performing data warehousing and business intelligence. The various data warehouse concepts explained in this video are:
1. What Is Data Warehousing?
2. Data Warehousing Concepts:
i. OLAP (On-Line Analytical Processing)
ii. Types Of OLAP Cubes
iii. Dimensions, Facts & Measures
iv. Data Warehouse Schema
Presentation slides of Sequence Query Language (SQL)Punjab University
SQL is a language used to communicate with and perform operations on relational database management systems (RDBMS). The document outlines what SQL is, what it can do, important SQL commands like SELECT, INSERT, UPDATE and DELETE, how to create and drop databases and tables, and key concepts like primary keys, foreign keys, and constraints. SQL allows users to retrieve, manipulate and transform data stored in an RDBMS through statements that include keywords, clauses, aggregates, expressions, identifiers, parameters, and operators.
This presentation describes about the following topics
Logical Operators
LISTS (IN AND NOT IN)
RANGES (BETWEEN AND NOT BETWEEN)
ORDER BY
Aggregate functions
GROUP BY and HAVING
UNION
This document summarizes an overview presentation on SQL Server basics for non-database administrators. It covers SQL Server 2005 platform features, managing databases, database maintenance and protection, securing SQL Server, and managing database objects. The document provides high-level information on these SQL Server administration topics in less than 3 sentences.
This document provides an overview and introduction to Oracle SQL basics. It covers topics such as installing Oracle software like the database, Java SDK, and SQL Developer tool. It then discusses database concepts like what a database and table are. It also covers database fundamentals including SQL queries, functions, joins, constraints, views and other database objects. The document provides examples and explanations of SQL statements and database components.
Here i am giving some sql queries which is helpful for practicing in sql server for learning more sql interview questions you can refer this link http://skillgun.com/sql/interview-questions-and-answers
Data validation in Excel allows users to restrict the type of data entered into cells. This includes creating drop-down lists, restricting dates or numbers, and custom validation rules. The document provides steps to apply data validation to a cell by selecting the cell, going to the data validation menu, choosing the type of validation such as a list, selecting the source of the list options, and setting input and error messages. Data validation helps ensure accurate data entry by limiting users to valid options.
This document discusses different types of SQL joins, including inner joins, left joins, right joins, full joins, and self joins. It provides examples of the syntax for each type of join, along with sample queries and resulting tables to illustrate how each join works. Inner joins return rows where there is a match in both tables. Left and right joins return all rows from the left or right table respectively, along with matched or null rows from the other table. Full joins return all rows and fill in nulls for missing matches. Self joins allow a table to join with itself.
This document provides an overview of SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. It describes what SQL can do, such as execute queries, retrieve, insert, update and delete data. It also covers important SQL statements (SELECT, UPDATE, DELETE, INSERT), clauses (WHERE, ORDER BY), operators (LIKE), joins, and functions. In addition, it discusses SQL data types, constraints, creating tables and indexes.
This presentation gives a clear and concise description of joins in sql and several types of sql joins.
These slides also contains the pictorial representation as well as syntax for each type of joins.
This document discusses SQL set operators such as UNION, UNION ALL, INTERSECT, and MINUS. It provides examples of how to use each operator to combine result sets from multiple queries, eliminate duplicates, return common or unique rows, and control the order of rows in the final output. Tables used in the examples include the EMPLOYEES and JOB_HISTORY tables, which contain data on current and previous employee jobs. Guidelines are provided around matching columns in UNION queries and using parentheses and ORDER BY.
The document explains how to create a VLOOKUP formula in Microsoft Excel 2010 to search for data in a table and return matching values. It describes the four components of a VLOOKUP formula - the lookup value, table array, column index number, and optional range lookup parameter. An example is provided demonstrating how to use VLOOKUP to search an inventory database by part number and return the stock level and price.
This document contains questions from 5 units on the topic of database management systems. The questions cover a wide range of topics including DBMS architecture, data models, relational algebra, normalization, concurrency control, transaction management, distributed databases, data warehousing, and decision support systems. Specifically, some of the questions ask about ER modeling, functional dependencies, transaction processing, concurrency control protocols, ACID properties, client-server architecture, and OLAP.
Partitioning allows tables and indexes to be subdivided into smaller pieces called partitions. Tables can be partitioned using a partition key which determines which partition each row belongs to. Partitioning provides benefits like improved query performance for large tables, easier management of historical data, and increased high availability. Some disadvantages include additional licensing costs, storage space usage, and administrative overhead to manage partitions. Common partitioning strategies include range, list, hash and interval which divide tables in different ways based on column values.
This document provides instructions and exercises for an assignment on database development. It includes sample tables for employees and departments with sample data. It then lists a series of exercises involving writing SQL statements to retrieve, manipulate, and group data from the sample tables. The exercises cover basic SELECT statements, filtering with WHERE, sorting with ORDER BY, aggregation with GROUP BY, and data modification using INSERT, UPDATE, DELETE statements.
The document discusses the Indian business environment and various factors that affect businesses. It defines business and business environment. The macro environment consists of social, technological, economic, political, legal, ecological and other factors that indirectly impact businesses. It provides examples of how changes in these factors, such as new technology or legislation, can influence companies. Environmental scanning is important for businesses to identify opportunities and threats and adapt their strategies accordingly.
This document provides an introduction and overview of software testing. It discusses the need for testing due to the unpredictable nature of software and bugs. It covers different models of software development and places testing within the software development life cycle. The document then explores concepts of testing including the testing mindset, types of testing like unit vs integration testing, and verification vs validation. It also covers topics like test planning, preparation, execution, reporting and metrics. The goal is to argue that testing is important and should be a fundamental part of the software development process.
Operations research is the discipline of applying advanced analytical methods to help make better decisions. It involves identifying problems, collecting and analyzing data to construct mathematical models, solving the models, testing and implementing solutions. Some key applications of OR include determining optimal resource allocation, scheduling, logistics and production planning to minimize costs and maximize profits. While OR provides scientific solutions, the models sometimes rely on simplifying assumptions and may not represent realistic problems.
The document discusses consumerism and consumer protection in India. It outlines several key points:
1) Consumerism aims to augment consumer rights and protect consumers from exploitation by businesses through unfair or unethical practices like adulteration or misleading advertising.
2) Several laws have been passed in India to safeguard consumer rights, such as the Consumer Protection Act of 1986, but consumers remain vulnerable due to factors like illiteracy and slow legal processes.
3) The Consumer Protection Act established consumer dispute redressal forums at the district, state, and national levels to hear complaints regarding defective goods or deficient services. It aims to promote fair trade practices and protect consumer interests in India.
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 key concepts for SQL Server development including:
- Database architecture including files, file groups, and I/O requests
- Performance considerations such as identifying large/heavily accessed tables
- Disaster recovery strategies
- Exploring system databases like master, model, tempdb, and msdb
- Database objects including tables, views, functions, triggers, and transactions
The document also covers database design concepts such as normalization, referential integrity, and strategies to improve database design and performance.
SQL constraints are rules that limit the type of data that can be stored in a table. They can be specified when a table is created or altered later. A primary key uniquely identifies each row and cannot be null. A composite key uses multiple columns as the primary key. A foreign key's values must exist in another table's primary key. Joins combine data from multiple tables and include inner, outer, cross, and other types of joins. Views are virtual tables that dynamically select data from other tables.
This document provides an introduction to SQL, including:
1) SQL is a high-level query language that expresses "what to do" rather than "how to do it", allowing the database management system to optimize queries.
2) SQL has a history dating back to the 1970s and is now an ANSI/ISO standard, though commercial systems may offer additional features.
3) SQL allows defining schemas, creating and dropping tables, and specifying data types, keys, and other integrity constraints.
The document provides 45 essential SQL interview questions and answers. It begins with basic questions about SQL clauses and functions like UNION, JOIN, and NULL values. It then covers more advanced topics like implicit vs explicit JOIN syntax, three-valued logic in SQL, and correcting logically invalid WHERE clauses. The questions test a variety of SQL skills from basic syntax and usage to more complex logical puzzles that exploit subtle behaviors.
NCERT Solutions for Class 12 Physics Chapter 2 Electrostatic Potential and Capacitance includes the usage of many complicated equations and formulas that students learn in their Class 12. Also, the PDF file of the NCERT Solutions for Class 12 Physics Electrostatic Potential and Capacitance is available here for free download. The PDF includes important questions, answers to questions from the textbook, worksheets and other assignments.
The NCERT Solutions for Class 12 are essential to score good marks in the Class 12 board examination. These solutions are curated by individual subject matter experts according to the latest CBSE Syllabus (2023-24) and the guidelines. Further, the NCERT Solutions for Class 12 Physics Chapter 2 Electrostatic Potential and Capacitance provided here can be used by students to understand the concepts discussed in the chapter in detail.
The document provides information about database concepts. It defines key terms like database, table, row, column, cell. It explains different data types like CHAR and VARCHAR. CHAR stores fixed length data while VARCHAR stores variable length data. The document also lists some commonly used database software and the difference between DBMS and RDBMS. It describes concepts like relationships, constraints, NULL values. It provides examples of different SQL statements.
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.
Relationships between tables in a database are implemented using keys, including primary keys that uniquely identify rows and foreign keys that link to primary keys in other tables. Different types of joins, including inner joins and outer joins, allow retrieving data from multiple tables based on the relationships between their keys. Primary keys, foreign keys, and different join types are essential concepts for querying and combining data from multiple related tables in a relational database.
Relationships between tables in a database are implemented using keys, including primary keys that uniquely identify rows and foreign keys that link to primary keys in other tables. Different types of joins, including inner joins and outer joins, allow retrieving data from multiple tables based on the relationships between their keys. Primary keys, foreign keys, and different join types are essential concepts for understanding how to query and retrieve data from related tables in a SQL database.
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.
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 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.
SELECT
FROM
AS
DISTINCT
Arithmetic Operations on Columns
WHERE Clause
Comparison Operators (<,>,<=,>=,<>,=)
Other Operators
BETWEEN… AND,
NOT BETWEEN… AND
IN for more info visit utkaluniversity.com
This document is an overview of a course on Advanced Database Systems taught by Ellen Grace Porras during the first semester of 2022-2023. It discusses how SQL can be used to query data from multiple tables using joins and subqueries, and how to filter records using the WHERE clause with different operators. It also demonstrates how to delete specific records or all records from a table using the DELETE statement.
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.
A classification of diseases may be defined as a system of categories to which
morbid entities are assigned according to established criteria. There are many
possible axes of classification and the one selected will depend upon the use to
be made of the statistics to be compiled. A statistical classification of diseases
must encompass the entire range of morbid conditions within a manageable
number of categories.
The 10th revision of the International statistical classification of diseases and
related health problems is the latest in a series that was formalized in 1893 as
the Bertillon classification or International list of causes of death. A complete
review of the historical background to the classification is given in Volume 2.
While the title has been amended to make clearer the content and purpose and
to reflect the progressive extension of the scope of the classification beyond
diseases and injuries, the familiar abbreviation ‘ICD’ has been retained. In the
updated classification, conditions have been grouped in a way that was felt to
be most suitable for general epidemiological purposes and the evaluation of
health care.
Work on the 10th revision of the ICD started in September 1983 when a
Preparatory Meeting on ICD-10 was convened in Geneva. The programme of
work was guided by regular meetings of heads of WHO collaborating centres
for classification of diseases. Policy guidance was provided by a number of
special meetings, including those of the expert committee on the International
classification of diseases – 10th revision, held in 1984 and 1987.
In addition to the technical contributions provided by many specialist groups
and individual experts, a large number of comments and suggestions were
received from WHO Member States and regional offices as a result of the
global circulation of draft proposals for revision in 1984 and 1986. From the
comments received, it was clear that many users wished the ICD to encompass
types of data other than the ‘diagnostic information’ (in the broadest sense of the
term) that it has always covered. In order to accommodate the perceived needs
of these users, the concept arose of a ‘family’ of classifications centred on the
traditional ICD with its familiar form and structure. The ICD itself would thus
meet the requirement for diagnostic information for general purposes, while a
variety of other classifications would be used in conjunction with it and would
deal either with different approaches to the same information or with different
information (notably medical and surgical procedures and disablement).
Following suggestions at the time of development of the ninth revision of
the classification that a different basic structure might better serve the needs
of the many and varied users, several alternative models were evaluated. It
became clear, however, that the traditional single-variable-axis design of
INTERNATIONAL CLASSIFICATION OF DISEASES
the classification, and other aspects of its structure th
Testing Terms & Definitions document defines over 50 types of software testing terms concisely. It includes definitions for acceptance testing, which validates a software meets acceptance criteria, accessibility testing for disabilities, and automated testing using tools without manual intervention. It also defines integration testing of modules, localization testing for different cultures, load/performance testing under normal and heavy usage, and negative/black box testing without knowledge of internal workings. The document provides brief yet informative definitions for a wide range of standard testing techniques.
This foreword discusses the author's initial uncertainty about software testing based on differences between academic descriptions of testing and his own experience testing software as a developer. The author describes going through phases of thinking he needed to radically change his approach, then seeing how other approaches could work but not adopting them fully, and finally deciding other approaches wouldn't work for him. The author concludes that experience from multiple projects over time leads one to trust their own judgment and preferences for how to prioritize and approach testing based on an ongoing process of learning from different ideas, discussions, trials and errors.
This document provides a retrospective on 50 years of research in software testing techniques. It examines how testing techniques have matured from ad hoc methods to a more systematic discipline. The document outlines the evolution of testing concepts over time and how this has guided research. It then summarizes several major theoretical and methodological contributions that have advanced the field, such as research establishing test data adequacy criteria and coverage-based models. The document uses frameworks to analyze how testing techniques have progressed from early formulation to broader adoption according to models of technology maturation and software engineering research paradigms.
This document discusses an introduction to a class on rapid software testing. It states that the class aims to make students stronger, smarter and more confident testers by challenging them to think for themselves rather than simply listening to what the instructors say. The class can be beneficial for testers of all experience levels who want to improve at their work. Heuristics are discussed as techniques that can help substitute for complete analysis and involve guidewords, triggers, reframing ideas, and procedures to help solve problems.
This document discusses model-based software testing. It defines a model as a depiction of software behavior. Model-based testing uses models to guide testing tasks like test selection and evaluation. Common models include finite state machines, statecharts, UML diagrams, and Markov chains. The document provides an overview of these models and discusses how they are applied to software testing. It also gives examples to illustrate finite state machines and model-based testing terminology.
This document contains several quotes related to software testing, testers, quality, codes, bugs, and software in general. Some key quotes include:
- "Software testing proves the existing of bugs not their absence" - highlighting that testing finds bugs, not guarantees their absence.
- "You must be a constructive schizophrenic" as both a programmer and tester with different mindsets.
- "The only certainties in life are death, taxes and bugs in code" emphasizing that bugs will always exist in software.
- "Software testers succeed where others fail" capturing the role of testers to improve software quality.
Email marketing is a form of direct marketing that uses electronic mail to reach potential and current customers. It allows marketers to identify, anticipate, and satisfy customer needs profitably using the 4Ps of marketing. Email marketing is an effective medium that provides measurable results and helps build relationships, but marketers must address challenges like spam and increasing deliverability rates.
This document provides an overview of management information systems (MIS) concepts and design. It discusses that information is critical but often not what is wanted or needed. It then defines MIS as a computer-based system that provides tools for managers to organize, evaluate, and efficiently run their departments. The document outlines the historical development of MIS from a focus on data processing in the 1950s-1960s to a focus on information analysis in the 1970s. It also discusses the components of an MIS including technology, databases, users, and procedures. Finally, it covers topics like information security, quality assurance, and the system development life cycle.
This document provides an overview of database management systems and conceptual modeling. It defines key terms like DBMS, database schema, instance, physical schema, logical schema, and data model. It also describes data abstraction levels, the entity-relationship model, relational model components like tuples and relations, and relational algebra and calculus operations. The document consists of questions and answers on database concepts and topics like data modeling, the storage manager, and the entity-relationship diagram.
The document provides an introduction to HTML (Hypertext Markup Language). It discusses what HTML is, the history and evolution of HTML standards from versions 1.0 to 4.0, and some key concepts in HTML like tags, elements, and attributes. It also covers what is needed to start designing basic web pages, including a text editor, browser, and naming HTML files with the .htm or .html extension.
The document provides an overview of managing the grievance process. It discusses the purpose of grievance procedures, how to prevent grievances, grievance timelines, benefits of early settlement, and the typical steps in the grievance process including oral grievances, written grievances, grievances advanced to employee relations, preparation for meetings, and potential arbitration.
The document describes the graphical method for solving linear programming problems with two decision variables. It provides the step-by-step procedure which involves plotting the constraints on a graph to identify the feasible region, determining the corner points of this region which represent the feasible solutions, substituting these points into the objective function to find the optimal value, and identifying the optimal solution. It then provides examples demonstrating this process and different types of solutions that can arise such as unbounded, infeasible, and optimal.
The document discusses linear programming problems and how to formulate them. It provides definitions of key terms like linear, programming, objective function, decision variables, and constraints. It then explains the steps to formulate a linear programming problem, including defining the objective, decision variables, mathematical objective function, and constraints. Several examples of formulated linear programming problems are provided to maximize profit or minimize costs subject to various constraints.
There are several factors that influence employee remuneration both external and internal to an organization. External factors include the labor market, cost of living, labor unions, government legislation, the economy, and society. Internal factors are an organization's strategy, job evaluation, performance appraisal, and characteristics of employees. Remuneration is determined by balancing these various factors to attract, retain, and motivate skilled labor within legal and social norms.
Compensation and remuneration are important factors for both employees and employers, as they impact motivation, loyalty, and standard of living. Components of remuneration typically include wages, salaries, incentives, fringe benefits, perquisites, and non-monetary benefits. However, compensation practices must be carefully managed to avoid issues like pay envy, high turnover, and damage to morale when disparities exist or the market changes rapidly.
The document defines an organization as a collection of people working together to achieve a common purpose. It discusses the functions of management including planning, organizing, leading, and controlling. It also discusses the nature of managerial work, the management process, and various managerial roles and skills needed at different levels including technical, human, and conceptual skills.
The document provides an overview of the simplex method for solving linear programming problems with more than two decision variables. It describes key concepts like slack variables, surplus variables, basic feasible solutions, degenerate and non-degenerate solutions, and using tableau steps to arrive at an optimal solution. Examples are provided to illustrate setting up and solving problems using the simplex method.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
1. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
Basics of the SELECT Statement www.thecodexpert.com
In a relational database, data is stored in tables. An example table would relate Social Security Number, Name, and
Address:
EmployeeAddressTable
SSN FirstName LastName Address City State
512687458 Joe Smith 83 First Street Howard Ohio
758420012 Mary Scott 842 Vine Ave. Losantiville Ohio
102254896 Sam Jones 33 Elm St. Paris New York
876512563 Sarah Ackerman 440 U.S. 110 Upton Michigan
Query 1 let’s say you want to see the address of each employee. Use the SELECT statement, like so:
Conditional Selection
To further discuss the SELECT statement, let's look at a new example table (for hypothetical purposes only):
EmployeeStatisticsTable
EmployeeIDNo Salary Benefits Position
010 75000 15000 Manager
105 65000 15000 Manager
152 60000 15000 Manager
215 60000 12500 Manager
244 50000 12000 Staff
300 45000 10000 Staff
335 40000 10000 Staff
400 32000 7500 Entry-Level
441 28000 7500 Entry-Level
Relational Operators
There are six Relational Operators in SQL, and after introducing them, we'll see how they're used:
= Equal
< or != (see
Not Equal
manual)
< Less Than
> Greater Than
<= Less Than or Equal To
>= Greater Than or Equal To
The WHERE clause is used to specify that only certain rows of the table are displayed, based on the criteria described
in that WHERE clause. It is most easily understood by looking at a couple of examples.
Query 2 EMPLOYEEIDNO's of those making at or over $50,000
2. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
More Complex Conditions: Compound Conditions / Logical Operators
www.thecodexpert.com
The AND operator joins two or more conditions, and displays a row only if that row's data satisfies ALL conditions
listed (i.e. all conditions hold true).
Query 3
To display all staff making over $40,000, use:
The OR operator joins two or more conditions, but returns a row if ANY of the conditions listed hold true.
Query 4
To see all those who make less than $40,000 or have less than $10,000 in benefits, listed together, use the following
query:
AND & OR can be combined, for example:
Query 5
Find all managers whose salary is greater than 60000 and benefits are greater than 12000
IN & BETWEEN
An easier method of using compound conditions uses IN or BETWEEN.
Query 6
For example, if you wanted to list all managers and staff:
Query 7
To list those making greater than or equal to $30,000, but less than or equal to $50,000, use:
Query 8
To list everyone not in this range, try:
Using LIKE
Query 9
Look at the EmployeeStatisticsTable, and say you wanted to see all people whose last names started with "S"; try:
Joins
In this section, we will only discuss inner joins, and equijoins, as in general, they are the most useful. For more
information, try the SQL links at the bottom of the page.
Good database design suggests that each table lists data only about a single entity, and detailed information can be
obtained in a relational database, by using additional tables, and by using a join.
3. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
First, take a look at these example tables: www.thecodexpert.com
AntiqueOwners
OwnerID OwnerLastName OwnerFirstName
01 Jones Bill
02 Smith Bob
15 Lawson Patricia
21 Akins Jane
50 Fowler Sam
Orders
OwnerID ItemDesired
02 Table
02 Desk
21 Chair
15 Mirror
Antiques
SellerID BuyerID Item
01 50 Bed
02 15 Table
15 02 Chair
21 50 Mirror
50 01 Desk
01 21 Cabinet
02 21 Coffee Table
15 50 Chair
01 15 Jewelry Box
02 21 Pottery
21 02 Bookcase
50 01 Plant Stand
Keys
First, let's discuss the concept of keys. A primary key is a column or set of columns that uniquely identifies the rest of
the data in any given row. For example, in the AntiqueOwners table, the OwnerID column uniquely identifies that row.
This means two things: no two rows can have the same OwnerID, and, even if two owners have the same first and last
names, the OwnerID column ensures that the two owners will not be confused with each other, because the unique
OwnerID column will be used throughout the database to track the owners, rather than the names.
A foreign key is a column in a table where that column is a primary key of another table, which means that any data in a
foreign key column must have corresponding data in the other table where that column is the primary key. In DBMS-
speak, this correspondence is known as referential integrity. For example, in the Antiques table, both the BuyerID and
SellerID are foreign keys to the primary key of the AntiqueOwners table (OwnerID; for purposes of argument, one has
to be an Antique Owner before one can buy or sell any items), as, in both tables, the ID rows are used to identify the
owners or buyers and sellers, and that the OwnerID is the primary key of the AntiqueOwners table. In other words, all
4. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
of this "ID" data is used to refer to the owners, www.thecodexpert.com
buyers, or sellers of antiques, themselves, without having to use the
actual names.
Performing a Join
The purpose of these keys is so that data can be related across tables, without having to repeat data in every table--this
is the power of relational databases. For example, you can find the names of those who bought a chair without having
to list the full name of the buyer in the Antiques table...you can get the name by relating those who bought a chair with
the names in the AntiqueOwners table through the use of the OwnerID, which relates the data in the two tables.
Query 10
To find the names of those who bought a chair, use the following query:
DISTINCT and Eliminating Duplicates
Let's say that you want to list the ID and names of only those people who have sold an antique. Obviously, you want a
list where each seller is only listed once--you don't want to know how many antiques a person sold, just the fact that
this person sold one (for counts, see the Aggregate Function section below). This means that you will need to tell SQL
to eliminate duplicate sales rows, and just list each person only once. To do this, use the DISTINCT keyword.
First, we will need an equijoin to the AntiqueOwners table to get the detail data of the person's LastName and
FirstName. However, keep in mind that since the SellerID column in the Antiques table is a foreign key to the
AntiqueOwners table, a seller will only be listed if there is a row in the AntiqueOwners table listing the ID and names.
We also want to eliminate multiple occurrences of the SellerID in our listing, so we use DISTINCT on the column
where the repeats may occur (however, it is generally not necessary to strictly put the Distinct in front of the column
name).
Miscellaneous SQL Statements
Aggregate Functions
I will discuss five important aggregate functions: SUM, AVG, MAX, MIN, and COUNT. They are called aggregate
functions because they summarize the results of a query, rather than listing all of the rows.
SUM () gives the total of all the rows, satisfying any conditions, of the given column, where the given column
is numeric.
AVG () gives the average of the given column.
MAX () gives the largest figure in the given column.
MIN () gives the smallest figure in the given column.
COUNT(*) gives the number of rows satisfying the conditions.
Looking at the tables at the top of the document, let's look at three examples:
SELECT SUM(SALARY), AVG(SALARY)
FROM EMPLOYEESTATISTICSTABLE;
This query shows the total of all salaries in the table, and the average salary of all of the entries in the table.
SELECT MIN(BENEFITS)
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Manager';
This query gives the smallest figure of the Benefits column, of the employees who are Managers, which is 12500.
5. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
SELECT COUNT(*) www.thecodexpert.com
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION = 'Staff';
This query tells you how many employees have Staff status (3).
Views
In SQL, you might (check your DBA) have access to create views for yourself. What a view does is to allow you to
assign the results of a query to a new, personal table, that you can use in other queries, where this new table is given the
view name in your FROM clause. When you access a view, the query that is defined in your view creation statement is
performed (generally), and the results of that query look just like another table in the query that you wrote invoking the
view. For example, to create a view:
CREATE VIEW ANTVIEW AS SELECT ITEMDESIRED FROM ORDERS;
Now, write a query using this view as a table, where the table is just a listing of all Items Desired from the Orders table:
SELECT SELLERID
FROM ANTIQUES, ANTVIEW
WHERE ITEMDESIRED = ITEM;
This query shows all SellerID's from the Antiques table where the Item in that table happens to appear in the Antview
view, which is just all of the Items Desired in the Orders table. The listing is generated by going through the Antique
Items one-by-one until there's a match with the Antview view. Views can be used to restrict database access, as well as,
in this case, simplify a complex query.
Creating New Tables
All tables within a database must be created at some point in time...let's see how we would create the Orders table:
CREATE TABLE ORDERS
(OWNERID INTEGER NOT NULL,
ITEMDESIRED CHAR(40) NOT NULL);
This statement gives the table name and tells the DBMS about each column in the table. Please note that this statement
uses generic data types, and that the data types might be different, depending on what DBMS you are using. As usual,
check local listings. Some common generic data types are:
Char(x) - A column of characters, where x is a number designating the maximum number of characters allowed
(maximum length) in the column.
Integer - A column of whole numbers, positive or negative.
Decimal(x, y) - A column of decimal numbers, where x is the maximum length in digits of the decimal numbers
in this column, and y is the maximum number of digits allowed after the decimal point. The maximum (4,2)
number would be 99.99.
Date - A date column in a DBMS-specific format.
Logical - A column that can hold only two values: TRUE or FALSE.
One other note, the NOT NULL means that the column must have a value in each row. If NULL was used, that column
may be left empty in a given row.
Altering Tables
Let's add a column to the Antiques table to allow the entry of the price of a given Item (Parentheses optional):
6. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
ALTER TABLE ANTIQUES ADD (PRICE DECIMAL(8,2) NULL);
www.thecodexpert.com
The data for this new column can be updated or inserted as shown later.
Adding Data
To insert rows into a table, do the following:
INSERT INTO ANTIQUES VALUES (21, 01, 'Ottoman', 200.00);
This inserts the data into the table, as a new row, column-by-column, in the pre-defined order. Instead, let's change the
order and leave Price blank:
INSERT INTO ANTIQUES (BUYERID, SELLERID, ITEM)
VALUES (01, 21, 'Ottoman');
Deleting Data
Let's delete this new row back out of the database:
DELETE FROM ANTIQUES
WHERE ITEM = 'Ottoman';
But if there is another row that contains 'Ottoman', that row will be deleted also. Let's delete all rows (one, in this case)
that contain the specific data we added before:
DELETE FROM ANTIQUES
WHERE ITEM = 'Ottoman' AND BUYERID = 01 AND SELLERID = 21;
Updating Data
Let's update a Price into a row that doesn't have a price listed yet:
UPDATE ANTIQUES SET PRICE = 500.00 WHERE ITEM = 'Chair';
This sets all Chair's Prices to 500.00. As shown above, more WHERE conditionals, using AND, must be used to limit
the updating to more specific rows. Also, additional columns may be set by separating equal statements with commas.
GROUP BY & HAVING
One special use of GROUP BY is to associate an aggregate function (especially COUNT; counting the number of rows
in each group) with groups of rows. If aggregate functions are included in the SELECT clause <select list>, GROUP
BY calculates a summary value for each group.
First, assume that the Antiques table has the Price column, and each row has a value for that column. We want to see
the price of the most expensive item bought by each owner. We have to tell SQL to group each owner's purchases, and
tell us the maximum purchase price:
SELECT BUYERID, MAX(PRICE)
FROM ANTIQUES
GROUP BY BUYERID;
7. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
Now, say we only want to see the maximum purchase price if the purchase is over $1000, so we use the HAVING
www.thecodexpert.com
clause:
SELECT BUYERID, MAX(PRICE)
FROM ANTIQUES
GROUP BY BUYERID
HAVING PRICE > 1000; .
Example using the SUM function
For example, you could also use the SUM function to return the name of the department and the total sales (in the
associated department). The HAVING clause will filter the results so that only departments with sales greater than
$1000 will be returned.
SELECT department, SUM(sales) as "Total sales"
FROM order_details
GROUP BY department
HAVING SUM(sales) > 1000;
Example using the COUNT function
For example, you could use the COUNT function to return the name of the department and the number of employees
(in the associated department) that make over $25,000 / year. The HAVING clause will filter the results so that only
departments with more than 10 employees will be returned.
SELECT department, COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department
HAVING COUNT(*) > 10;
Example using the MIN function
For example, you could also use the MIN function to return the name of each department and the minimum salary in
the department. The HAVING clause will return only those departments where the starting salary is $35,000.
SELECT department, MIN(salary) as "Lowest salary"
FROM employees
GROUP BY department
HAVING MIN(salary) = 35000;
Example using the MAX function
For example, you could also use the MAX function to return the name of each department and the maximum salary in
the department. The HAVING clause will return only those departments whose maximum salary is less than $50,000.
SELECT department, MAX(salary) as "Highest salary"
FROM employees
GROUP BY department
HAVING MAX(salary) < 50000;
More Subqueries
8. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
Another common usage of subqueries involveswww.thecodexpert.com a Where condition to include the Select
the use of operators to allow
output of a subquery. First, list the buyers who purchased an expensive item (the Price of the item is $100 greater than
the average price of all items purchased):
SELECT BUYERID
FROM ANTIQUES
WHERE PRICE >
(SELECT AVG(PRICE) + 100
FROM ANTIQUES);
The subquery calculates the average Price, plus $100, and using that figure, an OwnerID is printed for every item
costing over that figure. One could use DISTINCT BUYERID, to eliminate duplicates.
List the Last Names of those in the AntiqueOwners table, ONLY if they have bought an item:
SELECT OWNERLASTNAME
FROM ANTIQUEOWNERS
WHERE OWNERID IN
(SELECT DISTINCT BUYERID
FROM ANTIQUES);
The subquery returns a list of buyers, and the Last Name is printed for an Antique Owner if and only if the Owner's ID
appears in the subquery list (sometimes called a candidate list). Note: on some DBMS's, equals can be used instead of
IN, but for clarity's sake, since a set is returned from the subquery, IN is the better choice.
For an Update example, we know that the gentleman who bought the bookcase has the wrong First Name in the
database...it should be John:
UPDATE ANTIQUEOWNERS
SET OWNERFIRSTNAME = 'John'
WHERE OWNERID =
(SELECT BUYERID
FROM ANTIQUES
WHERE ITEM = 'Bookcase');
First, the subquery finds the BuyerID for the person(s) who bought the Bookcase, then the outer query updates his First
Name.
Remember this rule about subqueries: when you have a subquery as part of a WHERE condition, the Select clause in
the subquery must have columns that match in number and type to those in the Where clause of the outer query. In
other words, if you have "WHERE ColumnName = (SELECT...);", the Select must have only one column in it, to match
the ColumnName in the outer Where clause, and they must match in type (both being integers, both being character
strings, etc.).
EXISTS & ALL
EXISTS uses a subquery as a condition, where the condition is True if the subquery returns any rows, and False if the
subquery does not return any rows; this is a nonintuitive feature with few unique uses. However, if a prospective
customer wanted to see the list of Owners only if the shop dealt in Chairs, try:
SELECT OWNERFIRSTNAME, OWNERLASTNAME
FROM ANTIQUEOWNERS
WHERE EXISTS
(SELECT *
FROM ANTIQUES
WHERE ITEM = 'Chair');
9. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
If there are any Chairs in the Antiques column,www.thecodexpert.com a row or rows, making the EXISTS clause
the subquery would return
true, causing SQL to list the Antique Owners. If there had been no Chairs, no rows would have been returned by the
outside query.
ALL is another unusual feature, as ALL queries can usually be done with different, and possibly simpler methods; let's
take a look at an example query:
SELECT BUYERID, ITEM
FROM ANTIQUES
WHERE PRICE >= ALL
(SELECT PRICE
FROM ANTIQUES);
This will return the largest priced item (or more than one item if there is a tie), and its buyer. The subquery returns a list
of all Prices in the Antiques table, and the outer query goes through each row of the Antiques table, and if its Price is
greater than or equal to every (or ALL) Prices in the list, it is listed, giving the highest priced Item. The reason "=" must
be used is that the highest priced item will be equal to the highest price on the list, because this Item is in the Price list.
10. For useful Documents like this and Lots of more Educational and Technological Stuff Visit...
For useful Documents like
www.thecodexpert.com
this and
Lots of more
Educational and
Technological Stuff...
Visit...
www.thecodexpert.com