This document provides an overview of basic SQL concepts including:
- The main clauses of an SQL query: SELECT, FROM, WHERE
- Common SQL operations like selection, projection, joins, aggregation, renaming, pattern matching and string operations
- How to order and group query results
- Set operations in SQL like UNION, INTERSECT, EXCEPT
- Examples of SQL queries on bank database schemas and relations
The document discusses SQL DML commands like INSERT, UPDATE, and DELETE. It provides the syntax for these commands and examples of how to use them to manipulate data in database tables. Domain types in SQL like CHAR, VARCHAR, INT and DATE are also outlined. The document contains examples of creating tables, inserting data, updating and deleting rows with the DML commands in Oracle SQL.
The document discusses various SQL integrity constraints and authorization commands. It describes primary key, foreign key, not null, check, unique, and default constraints that can be applied during table creation. It also covers the GRANT and REVOKE commands used to manage user permissions to tables. Examples are provided for each constraint and command to illustrate their proper syntax.
This document discusses embedded SQL, functions, procedures, and triggers. Embedded SQL allows SQL statements to be embedded within host languages like C/C++ and Java. Functions and procedures can be written in SQL or an external language and used to perform calculations on data. Triggers are stored programs that automatically execute in response to data changes or other events. The document provides examples of how to create and use these database objects to query and manipulate data.
a) More SQL: Aggregates - Write queries in SQL using aggregates, grouping and ordering.
b) Nested sub queries and SQL updates: Write queries in SQL using concept of nested sub
queries and SQL update commands.
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
The document discusses SQL DML commands like INSERT, UPDATE, and DELETE. It provides the syntax for these commands and examples of how to use them to manipulate data in database tables. Domain types in SQL like CHAR, VARCHAR, INT and DATE are also outlined. The document contains examples of creating tables, inserting data, updating and deleting rows with the DML commands in Oracle SQL.
The document discusses various SQL integrity constraints and authorization commands. It describes primary key, foreign key, not null, check, unique, and default constraints that can be applied during table creation. It also covers the GRANT and REVOKE commands used to manage user permissions to tables. Examples are provided for each constraint and command to illustrate their proper syntax.
This document discusses embedded SQL, functions, procedures, and triggers. Embedded SQL allows SQL statements to be embedded within host languages like C/C++ and Java. Functions and procedures can be written in SQL or an external language and used to perform calculations on data. Triggers are stored programs that automatically execute in response to data changes or other events. The document provides examples of how to create and use these database objects to query and manipulate data.
a) More SQL: Aggregates - Write queries in SQL using aggregates, grouping and ordering.
b) Nested sub queries and SQL updates: Write queries in SQL using concept of nested sub
queries and SQL update commands.
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
This document provides an overview of SQL and relational database concepts. It discusses how SQL is used to interact with relational database management systems like MySQL, including inserting and querying data. The summary also provides a brief history of SQL and explains some basic SQL syntax. Examples are given to demonstrate creating tables and relating data between tables to represent real-world entities and their relationships.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
in this presentation the commands let you help to understand the basic of the database system software. how to retrieve data, how to feed data and manipulate it very efficiently by using this commands.
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
This document provides an overview and goals for a book on advanced SQL tips and tricks. It discusses topics covered in the book such as scalar functions, analytic functions, complex subqueries, common table expressions, and XML tricks. The document also provides examples of SQL code snippets demonstrating various techniques, including finding values containing percentages, combining values into a single row, correlating vs simple subqueries, and using common table expressions.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document provides an introduction to SQL and 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.
The document discusses topics related to database management systems including database users, architecture, data definition language, data manipulation language, entity relationship modeling, and SQL commands. It provides examples of using SQL commands like CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, ALTER TABLE, DROP TABLE, RENAME, COMMIT, ROLLBACK, GRANT and REVOKE. It also explains concepts of entity sets, relationship sets, attributes, and ER diagram notations and provides examples of ER diagrams.
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.
This document provides information about relational algebra operators including select, project, join, set operations, and more. It defines each operator, provides examples of how to write them using relational algebra notation, and explains how to apply them to sample tables and queries. Key learning outcomes covered are using relational algebra operators to retrieve information and write expressions based on relational tables.
The document discusses SQL database concepts including:
- The SQL data definition language allows specification of schemas, integrity constraints, and other metadata.
- Relations are defined using CREATE TABLE statements which specify attributes and their data types.
- Basic queries use SELECT, FROM, and WHERE clauses to retrieve and filter tuples from one or more relations.
- Integrity constraints like PRIMARY KEY and NOT NULL can be defined to enforce data validity.
- SQL supports operations like JOIN, aggregation, sorting, and more.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
The document provides information about Structured Query Language (SQL) including its basic concepts, data types, CREATE TABLE and INSERT commands, constraints, operators and data modifications. It defines key SQL concepts such as relations, attributes, tuples, primary keys, foreign keys and discusses SQL's capabilities for data definition, manipulation, queries and transaction control. Examples are given for creating a table and inserting records into the table.
The document defines various normal forms for database normalization including 1NF, 2NF, 3NF and BCNF. It explains the concepts of functional dependencies, full functional dependencies, partial dependencies and transitive dependencies. The goals of normalization are to eliminate data anomalies, reduce data redundancy and improve data integrity. Normalization is achieved by decomposing relations and removing dependencies between attributes.
This document provides an overview of Chapter 3 from the textbook "Database System Concepts, 7th Ed." by Silberschatz, Korth and Sudarshan. It covers the history and components of SQL, data definition and manipulation languages, basic query structure, predicates, null values, and set operations in SQL. Key topics include the CREATE TABLE statement, data types, integrity constraints, SELECT statements, joins, ordering results, and aggregate functions.
SQL is a standard language used to communicate with relational database management systems. It allows users to define, manipulate, and query data within these databases. The basic structure of an SQL query consists of SELECT, FROM, and WHERE clauses that correspond to operations in relational algebra like projection, Cartesian product, and selection. SQL provides tools for managing data like DDL/DML commands, views, aggregates, and subqueries to retrieve and analyze data flexibly.
This document provides an overview of SQL (Structured Query Language) including its history, data definition and manipulation capabilities. Key topics covered include SQL's data types, basic queries using SELECT, FROM and WHERE clauses, joins, aggregation, null values, triggers and indexes. The document also discusses SQL standards over time and commercial database implementations of SQL features.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
This document provides an overview of SQL and relational database concepts. It discusses how SQL is used to interact with relational database management systems like MySQL, including inserting and querying data. The summary also provides a brief history of SQL and explains some basic SQL syntax. Examples are given to demonstrate creating tables and relating data between tables to represent real-world entities and their relationships.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
in this presentation the commands let you help to understand the basic of the database system software. how to retrieve data, how to feed data and manipulate it very efficiently by using this commands.
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
This document provides an overview and goals for a book on advanced SQL tips and tricks. It discusses topics covered in the book such as scalar functions, analytic functions, complex subqueries, common table expressions, and XML tricks. The document also provides examples of SQL code snippets demonstrating various techniques, including finding values containing percentages, combining values into a single row, correlating vs simple subqueries, and using common table expressions.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
This document provides an introduction to SQL and 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.
The document discusses topics related to database management systems including database users, architecture, data definition language, data manipulation language, entity relationship modeling, and SQL commands. It provides examples of using SQL commands like CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, ALTER TABLE, DROP TABLE, RENAME, COMMIT, ROLLBACK, GRANT and REVOKE. It also explains concepts of entity sets, relationship sets, attributes, and ER diagram notations and provides examples of ER diagrams.
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.
This document provides information about relational algebra operators including select, project, join, set operations, and more. It defines each operator, provides examples of how to write them using relational algebra notation, and explains how to apply them to sample tables and queries. Key learning outcomes covered are using relational algebra operators to retrieve information and write expressions based on relational tables.
The document discusses SQL database concepts including:
- The SQL data definition language allows specification of schemas, integrity constraints, and other metadata.
- Relations are defined using CREATE TABLE statements which specify attributes and their data types.
- Basic queries use SELECT, FROM, and WHERE clauses to retrieve and filter tuples from one or more relations.
- Integrity constraints like PRIMARY KEY and NOT NULL can be defined to enforce data validity.
- SQL supports operations like JOIN, aggregation, sorting, and more.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
The document provides information about Structured Query Language (SQL) including its basic concepts, data types, CREATE TABLE and INSERT commands, constraints, operators and data modifications. It defines key SQL concepts such as relations, attributes, tuples, primary keys, foreign keys and discusses SQL's capabilities for data definition, manipulation, queries and transaction control. Examples are given for creating a table and inserting records into the table.
The document defines various normal forms for database normalization including 1NF, 2NF, 3NF and BCNF. It explains the concepts of functional dependencies, full functional dependencies, partial dependencies and transitive dependencies. The goals of normalization are to eliminate data anomalies, reduce data redundancy and improve data integrity. Normalization is achieved by decomposing relations and removing dependencies between attributes.
This document provides an overview of Chapter 3 from the textbook "Database System Concepts, 7th Ed." by Silberschatz, Korth and Sudarshan. It covers the history and components of SQL, data definition and manipulation languages, basic query structure, predicates, null values, and set operations in SQL. Key topics include the CREATE TABLE statement, data types, integrity constraints, SELECT statements, joins, ordering results, and aggregate functions.
SQL is a standard language used to communicate with relational database management systems. It allows users to define, manipulate, and query data within these databases. The basic structure of an SQL query consists of SELECT, FROM, and WHERE clauses that correspond to operations in relational algebra like projection, Cartesian product, and selection. SQL provides tools for managing data like DDL/DML commands, views, aggregates, and subqueries to retrieve and analyze data flexibly.
This document provides an overview of SQL (Structured Query Language) including its history, data definition and manipulation capabilities. Key topics covered include SQL's data types, basic queries using SELECT, FROM and WHERE clauses, joins, aggregation, null values, triggers and indexes. The document also discusses SQL standards over time and commercial database implementations of SQL features.
This chapter discusses SQL and relational database concepts. It covers the basic structure of SQL queries involving SELECT, FROM, and WHERE clauses. It describes key SQL features like aggregate functions, null values, nested subqueries, and modification of databases through insertion, deletion, and updating of records. The document provides examples to illustrate concepts like joins, grouping, ordering results, and use of comparison and string operators in SQL queries.
The document describes a set of PowerPoint slides for a Database Management Systems course. It includes an index listing the topics covered in each lecture and the corresponding slide numbers. The slides cover the basics of SQL queries, including the SELECT, FROM, and WHERE clauses. They also describe concepts like aggregates, null values, triggers, and designing active databases. Integrity constraints and different data types are discussed in the context of the CREATE TABLE statement.
This document provides a summary of the basic structure and key concepts of SQL, including:
1) SQL queries typically involve a SELECT statement to retrieve attributes from one or more relations based on conditions in a WHERE clause.
2) Common SQL clauses include SELECT, FROM, WHERE, GROUP BY, HAVING, and aggregate functions are used to perform calculations on groups of records.
3) Null values, three valued logic, and handling of duplicates are important concepts when working with SQL queries and relations.
Data Warehouse: Basic Concepts
Data Warehouse Modeling: Data Cube and OLAP
Data Cube Computation: Preliminary Concepts
Data Cube Computation Methods
Summary
This document provides an introduction and overview of MySQL, including how to access and use MySQL, basic SQL commands, and examples of queries, modifications, and joins that can be performed in MySQL. It describes MySQL as an SQL-based relational database management system that is commonly used with PHP and Perl. It also gives instructions on downloading and accessing MySQL along with explanations of common commands.
The document provides an overview of SQL and reasons for learning SQL. It discusses what SQL is, why learn SQL, and provides an overview of SQL functions including retrieving data using SELECT statements, arithmetic expressions, null values, column aliases, concatenation operators, literal character strings, and alternative quote operators. It also covers restricting and sorting data using WHERE clauses, comparison operators, logical operators, pattern matching, and null conditions.
The document provides an overview of the basic structure and features of the SQL language, including: select, from, where clauses; aggregate functions; set operations; null values; and more. It describes the typical components of an SQL query, how they map to relational algebra operations, and provides examples to illustrate various SQL concepts and capabilities.
This document provides an introduction and overview of MySQL, including how to download and access MySQL, basic commands to manage databases and tables, examples of SQL queries, and how to modify data. It covers topics such as creating databases and tables, selecting, joining, aggregating data, and updating records in MySQL. Examples demonstrate how to retrieve customer names, loan amounts, branch details, and more from the sample banking database.
This document provides an overview of Chapter 3 of the textbook "Database System Concepts". It discusses the following topics in SQL:
1. Data definition language allows specification of schemas, integrity constraints, and authorization information for relations.
2. Basic queries in SQL involve SELECT, FROM, and WHERE clauses that correspond to projection, Cartesian product, and selection in relational algebra.
3. SQL supports data types, integrity constraints, insertion and deletion of tuples, and modification of tables through DROP, ALTER, and CREATE statements.
4. Advanced query features include aggregation, null values, subqueries, joins, views and modification of the database.
The document provides an overview of Query-by-Example (QBE) and Datalog, two relational query languages. QBE allows graphical queries to be expressed "by example" using relation templates. It supports queries on single and multiple relations, negation, conditions, ordering results, and aggregate functions. Datalog is a logic-based query language based on rules that define views. It allows recursion and negation. Key features include safety and the power of recursive queries.
Mysql classes in navi-mumbai,mysql course-provider-in-navi-mumbaianshkhurana01
1. Create the employee database using CREATE DATABASE employee;
2. Create the employee table using CREATE TABLE employee(...);
3. Insert a new record into the employee table using INSERT INTO employee VALUES(...);
4. Update a record in the employee table using UPDATE employee SET ... WHERE ...;
5. Delete a record from the employee table using DELETE FROM employee WHERE ...;
The document provides an overview of SQL (Structured Query Language) including its basic concepts, components, and capabilities. SQL is a non-procedural language used to query and manipulate data in relational database management systems. It allows users to select, insert, update, and delete data. The main components of SQL are the data definition language for defining database structure and the data manipulation language for retrieving and updating data.
This document provides examples of SQL queries using aggregation functions such as SUM, AVG, MIN, MAX, and COUNT. It demonstrates how to use aggregation functions to calculate values across entire tables or groups of rows. It also shows how to use the GROUP BY clause to aggregate values for each unique value in a column, and the HAVING clause to filter groups based on aggregation results. Proper order of operations for aggregation queries is also discussed.
MySQL is an SQL-based database management system that is compatible with standard SQL. It can be downloaded from the MySQL website. The document provides information on accessing MySQL, describes databases and tables, gives SQL commands and examples using a banking database, and covers topics like queries, joins, views, and modifying databases.
MySQL is an SQL-based database management system that is commonly used with PHP and Perl. It allows users to create, access, and modify databases and their tables. The document provides information on downloading and accessing MySQL, describes basic SQL commands like SELECT and CREATE DATABASE, and provides examples of queries, joins, and modifying databases using MySQL.
MySQL is an SQL-based database management system that is compatible with standard SQL. It can be downloaded from the MySQL website. The document provides information on accessing MySQL, entering and editing commands, retrieving information about databases and tables, examples using a banking database, SQL queries, modifications to databases, and more. Resources for SQL scripts to create sample databases and tables are also included.
The document discusses different types of joins in SQL including inner joins, left outer joins, right outer joins, and full outer joins. It provides visual illustrations and examples of each join type using sample tables and fields. Inner joins return records that match between both tables, while outer joins also return records from one or both tables that don't meet the join condition between the tables.
The document discusses SQL views and provides examples of creating views. It defines a view as a query expression that computes and stores results but does not persist them on disk. Views allow restricting access to only specific columns of a table. Examples shown create views to list faculty without salaries, biology course sections, and total salaries by department.
The document discusses nested SQL subqueries and various operations that can be performed with them such as set membership tests, set comparisons, and determining set cardinality. It provides examples of using subqueries with operators like IN, NOT IN, > ALL, > SOME, and EXISTS to find course information taught during certain semesters, instructor names and salaries, and departments with the highest average salary.
The document discusses various SQL aggregate functions like COUNT, AVG, SUM, and MAX. It provides examples of finding the average salary of instructors in the Computer Science department, giving a column an alias name, and counting the number of instructors teaching in spring 2010. It also covers the GROUP BY clause for aggregating data by groups like department, and the HAVING clause for filtering groups based on aggregate conditions like departments with average salary over $42,000.
This document discusses SQL queries and provides examples of different types of queries:
1) Queries on a single relation to retrieve instructor names, department names, and salaries.
2) Queries with joins across multiple relations to retrieve instructor names, department names, and building names.
3) Queries to find instructor names and courses taught using a Cartesian product between the instructor and teaches relations.
The document discusses the SQL INSERT command which is used to insert data into tables in a database. It describes the basic syntax for inserting a single row with and without specifying column names. It also provides the syntax for inserting multiple rows or selecting data from one table to insert into another table. The UPDATE command is also summarized, providing the syntax for updating column values in a table.
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 discusses SQL and its components including data definition language, data manipulation language, views, transactions, and integrity constraints. It also describes common domain types in SQL like character strings, integers, and floating point numbers. Finally, it outlines the key entities and relationships in a university database including departments, courses, instructors, students, classrooms, and course registrations.
The document discusses the design of a database for a university. It identifies the major entities like departments, courses, instructors, students, classrooms and their attributes. It also identifies the relationships between these entities like the relationship between instructors and departments, students and departments, instructors and sections, students and sections etc. Finally, it provides an entity-relationship diagram that depicts the conceptual model of the university database including all the entity sets, attributes, relationship sets and their mapping cardinalities.
The document discusses three-address code, which is an intermediate representation used in compilers. It describes three-address code as consisting of statements in the form of x := y op z, where x, y, and z are operands and op is an operator. There are several types of three-address statements including assignment, copy, jump, conditional jump, procedure calls, indexed assignments, and pointer assignments. Three-address code can be implemented using quadruples, triples, or indirect triples, which represent the statements using records with fields for operands and operators.
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Sinan KOZAK
Sinan from the Delivery Hero mobile infrastructure engineering team shares a deep dive into performance acceleration with Gradle build cache optimizations. Sinan shares their journey into solving complex build-cache problems that affect Gradle builds. By understanding the challenges and solutions found in our journey, we aim to demonstrate the possibilities for faster builds. The case study reveals how overlapping outputs and cache misconfigurations led to significant increases in build times, especially as the project scaled up with numerous modules using Paparazzi tests. The journey from diagnosing to defeating cache issues offers invaluable lessons on maintaining cache integrity without sacrificing functionality.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
International Conference on NLP, Artificial Intelligence, Machine Learning an...gerogepatton
International Conference on NLP, Artificial Intelligence, Machine Learning and Applications (NLAIM 2024) offers a premier global platform for exchanging insights and findings in the theory, methodology, and applications of NLP, Artificial Intelligence, Machine Learning, and their applications. The conference seeks substantial contributions across all key domains of NLP, Artificial Intelligence, Machine Learning, and their practical applications, aiming to foster both theoretical advancements and real-world implementations. With a focus on facilitating collaboration between researchers and practitioners from academia and industry, the conference serves as a nexus for sharing the latest developments in the field.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Assignment#04
1. Database System Sunita M. Dol
Page 1
HANDOUT#04
Aim:
Basic SQL: Write simple queries in SQL on the schema created for a specific application.
Theory:
SQL is based on set and relational operations with certain modifications and enhancements. A
typical SQL query has the form:
select A1, A2, ..., An
from r1, r2, ..., rm
where P
– Ai represents an attribute,
– Ri represents a relation and
– P is a predicate.
The SELECT Clause
The select clause list the attributes desired in the result of a query. SQL allows duplicates in
relations as well as in query results. To force the elimination of duplicates, insert the keyword
distinct after select. The keyword all specifies that duplicates not be removed. An asterisk in the
select clause denotes “all attributes”. The select clause can contain arithmetic expressions
involving the operation, +, –, *, and /, and operating on constants or attributes of tuples.
The WHERE Clause
The where clause specifies conditions that the result must satisfy. Comparison results can be
combined using the logical connectives and, or, and not. Comparisons can be applied to results
of arithmetic expressions. SQL includes a between comparison operator.
The FROM Clause
The from clause lists the relations involved in the query.
The RENAME Operation
The SQL allows renaming relations and attributes using the as clause:
old-name as new-name
Tuple Variables
Tuple variables are defined in the from clause via the use of the as clause. Keyword as is
optional and may be omitted
borrower as T ≡ borrower T
2. Database System Sunita M. Dol
Page 2
String Operations
SQL includes a string-matching operator for comparisons on character strings. The operator
“like” uses patterns that are described using two special characters:
• percent (%). The % character matches any substring.
• underscore (_). The _ character matches any character.
SQL supports a variety of string operations such as
• concatenation (using “||”)
• converting from upper to lower case (and vice versa)
• Finding string length, extracting substrings, etc.
Ordering the display of tuples
SQL offers the user some control over the order in which tuples in a relation are displayed. The
order by clause causes the tuples in the result of a query to appear in sorted order. We may
specify desc for descending order or asc for ascending order, for each attribute; ascending order
is the default.
Set Operations:
The SQL operations union, intersect, and except operate on relations and correspond to the
relational-algebra operations ∪, ∩, and −. Like union, intersection, and set difference in
relational algebra, the relations participating in the operations must be compatible; that is, they
must have the same set of attributes.
• In union operation, the number of duplicate tuples in the result is equal to the total
number of duplicates that appear in both d and b. Thus, if Jones has three accounts and
two loans at the bank, then there will be five tuples with the name Jones in the result.
• In intersection operation, the number of duplicate tuples that appear in the result is equal
to the minimum number of duplicates in both d and b. Thus, if Jones has three accounts
and two loans at the bank, then there will be two tuples with the name Jones in the result.
In except operation, the number of duplicate copies of a tuple in the result is equal to the number
of duplicate copies of the tuple in d minus the number of duplicate copies of the tuple in b,
provided that the difference is positive. Thus, if Jones has three accounts and one loan at the
bank, then there will be two tuples with the name Jones in the result. If, instead, this customer
has two accounts and three loans at the bank, there will be no tuple with the name Jones in the
result.
Queries and Output:
Select-From-Where Clause
Find the names of all branches in the loan relation
SQL> select branch_name from loan;
3. Database System Sunita M. Dol
Page 3
BRANCH_NAME
---------------
Round Hill
Downtown
Perryridge
Perryridge
Downtown
Redwood
Mianus
7 rows selected.
List the tuples of loan relation with amount multiplied by 100.
SQL> select * from loan;
LOAN_NUMBE BRANCH_NAME AMOUNT
---------- --------------- ----------
L-11 Round Hill 900
L-14 Downtown 1500
L-15 Perryridge 1500
L-16 Perryridge 1300
L-17 Downtown 1000
L-23 Redwood 2000
L-93 Mianus 500
7 rows selected.
SQL> select loan_number,branch_name,amount*100 from loan;
LOAN_NUMBE BRANCH_NAME AMOUNT*100
---------- --------------- ----------
L-11 Round Hill 90000
L-14 Downtown 150000
L-15 Perryridge 150000
L-16 Perryridge 130000
L-17 Downtown 100000
L-23 Redwood 200000
L-93 Mianus 50000
7 rows selected.
4. Database System Sunita M. Dol
Page 4
Find all loan numbers for the loans made at Perryridge branch with amount greater than
$1200.
SQL> select * from loan;
LOAN_NUMBE BRANCH_NAME AMOUNT
---------- --------------- ----------
L-11 Round Hill 900
L-14 Downtown 1500
L-15 Perryridge 1500
L-16 Perryridge 1300
L-17 Downtown 1000
L-23 Redwood 2000
L-93 Mianus 500
7 rows selected.
SQL> select loan_number from loan where branch_name='Perryridge' and amount>1200;
LOAN_NUMBE
----------
L-15
L-16
Rename Operation
SQL> select * from loan;
LOAN_NUMBE BRANCH_NAME AMOUNT
---------- --------------- ----------
L-11 Round Hill 900
L-14 Downtown 1500
L-15 Perryridge 1500
L-16 Perryridge 1300
L-17 Downtown 1000
L-23 Redwood 2000
L-93 Mianus 500
7 rows selected.
SQL> select customer_name,borrower.loan_number as loan_id,amount
2 from borrower,loan
5. Database System Sunita M. Dol
Page 5
3 where borrower.loan_number=loan.loan_number;
CUSTOMER_NAME LOAN_ID AMOUNT
-------------------- ---------- ----------
Smith L-11 900
Hayes L-15 1500
Adams L-16 1300
Williams L-17 1000
Jones L-17 1000
Smith L-23 2000
Curry L-93 500
7 rows selected.
Tuple Variables
Find the names of all branches that have assets greater than at least one branch located in
Brooklyn.
SQL> select * from branch;
BRANCH_NAME BRANCH_CITY ASSETS
--------------- --------------- ----------
Brighton Brooklyn 7100000
Downtown Brooklyn 9000000
Mianus Horseneck 400000
North Town Rye 3700000
Perryridge Horseneck 1700000
Pownal Bennington 300000
Redwood Palo Alto 2100000
Round Hill Horseneck 8000000
8 rows selected.
SQL> select distinct T.branch_name
2 from branch T,branch S
3 where T.assets>S.assets
4 and S.branch_city='Brooklyn';
BRANCH_NAME
---------------
Round Hill
6. Database System Sunita M. Dol
Page 6
Downtown
String Operations
Find the names of all customers whose street address includes substring 'Main'.
SQL> select * from customer;
CUSTOMER_NAME CUSTOMER_STREET
-------------------- ------------------------------
CUSTOMER_CITY
------------------------------
Adams Spring
Pittsfield
Brooks Senator
Brooklyn
Curry North
Rye
CUSTOMER_NAME CUSTOMER_STREET
-------------------- ------------------------------
CUSTOMER_CITY
------------------------------
Glenn Sand Hill
Woodside
Green Walnut
Stamford
Hayes Main
Harrison
CUSTOMER_NAME CUSTOMER_STREET
-------------------- ------------------------------
CUSTOMER_CITY
------------------------------
Johnson Alma
Palo Alto
7. Database System Sunita M. Dol
Page 7
Jones Main
Harrison
Lindsay Park
Pittsfield
CUSTOMER_NAME CUSTOMER_STREET
-------------------- ------------------------------
CUSTOMER_CITY
------------------------------
Smith North
Rye
Turner Putnam
Stamford
Williams Nassau
Princeton
12 rows selected.
SQL> select customer_name from customer where customer_street like '%Main%';
CUSTOMER_NAME
--------------------
Hayes
Jones
Ordering the display of tuples
List the entire loan relation in descending order of amount.If several loans have the same
amount then order them in ascending order by loan number.
SQL> select * from loan;
LOAN_NUMBE BRANCH_NAME AMOUNT
---------- --------------- ----------
L-11 Round Hill 900
8. Database System Sunita M. Dol
Page 8
L-14 Downtown 1500
L-15 Perryridge 1500
L-16 Perryridge 1300
L-17 Downtown 1000
L-23 Redwood 2000
L-93 Mianus 500
7 rows selected.
SQL> select * from loan
2 order by amount desc,loan_number asc;
LOAN_NUMBE BRANCH_NAME AMOUNT
---------- --------------- ----------
L-23 Redwood 2000
L-14 Downtown 1500
L-15 Perryridge 1500
L-16 Perryridge 1300
L-17 Downtown 1000
L-11 Round Hill 900
L-93 Mianus 500
7 rows selected.
Set Operations
The set of all customers who have an account at the bank
SQL> select * from depositor;
CUSTOMER_NAME ACCOUNT_NU
-------------------- ----------
Hayes A-102
Johnson A-101
Johnson A-201
Jones A-217
Lindsay A-222
Smith A-215
Turner A-305
7 rows selected.
9. Database System Sunita M. Dol
Page 9
SQL> select customer_name from depositor;
CUSTOMER_NAME
--------------------
Hayes
Johnson
Johnson
Jones
Lindsay
Smith
Turner
7 rows selected.
The set of customers who have loan at the bank.
SQL> select * from borrower;
CUSTOMER_NAME LOAN_NUMBE
-------------------- ----------
Adams L-16
Curry L-93
Hayes L-15
Jones L-17
Smith L-11
Smith L-23
Williams L-17
7 rows selected.
SQL> select customer_name from borrower;
CUSTOMER_NAME
--------------------
Adams
Curry
Hayes
Jones
Smith
Smith
Williams
10. Database System Sunita M. Dol
Page 10
7 rows selected.
Find all the bank customer having loan,an account or both at the bank.
SQL> (select customer_name from depositor)
2 union
3 (select customer_name from borrower);
CUSTOMER_NAME
--------------------
Adams
Curry
Hayes
Johnson
Jones
Lindsay
Smith
Turner
Williams
9 rows selected.
SQL> (select customer_name from depositor)
2 union all
3 (select customer_name from borrower);
CUSTOMER_NAME
--------------------
Hayes
Johnson
Johnson
Jones
Lindsay
Smith
Turner
Adams
Curry
Hayes
Jones
11. Database System Sunita M. Dol
Page 11
CUSTOMER_NAME
--------------------
Smith
Smith
Williams
14 rows selected.
Find all the bank customer having loan and an account at the bank.
SQL> (select customer_name from depositor)
2 intersect
3 (select customer_name from borrower);
CUSTOMER_NAME
--------------------
Hayes
Jones
Smith
Find all customers who have an account but no loan at the bank.
SQL> (select customer_name from depositor) minus (select customer_name from borrower);
CUSTOMER_NAME
--------------------
Johnson
Lindsay
Turner
Conclusion:
We have written simple queries in SQL using
• Select-from-where
• Rename operation
• Tuple variables
• String Operation
• Ordering the display of tuples
• Set operations
References:
12. Database System Sunita M. Dol
Page 12
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) sixth edition.
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) fifth edition.
• http://codex.cs.yale.edu/avi/db-book/db4/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db5/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/