Constraints are rules used to define and restrict the type of data that can be placed within MySQL tables. The document discusses several constraint types including NOT NULL, DEFAULT, UNIQUE, PRIMARY KEY, and FOREIGN KEY. It provides examples of how to implement these constraints when creating or altering tables, and demonstrates the behavior that results from adhering to or violating the constraints, such as errors generated or default values used. Foreign keys link data between tables, helping to enforce relational integrity.
What is PL/SQL
Procedural Language – SQL
An extension to SQL with design features of programming languages (procedural and object oriented)
PL/SQL and Java are both supported as internal host languages within Oracle products.
Stored procedures allow for grouping SQL statements and parameters to be stored and executed on a database. They provide more capabilities than scripts such as error handling and security. Parameters can pass data into and out of stored procedures. Stored procedures use structures like IF/ELSE, CASE, and cursors to implement decision-making and looping functionality similar to programming languages. Transactions allow grouping statements to commit or rollback changes and ensure data integrity.
This document discusses the collection framework in Java. It provides an overview of the need for collections due to limitations of arrays. It then describes the key interfaces in the collection framework - Collection, List, Set, SortedSet, NavigableSet, Queue, Map, SortedMap, and NavigableMap. For each interface, it provides a brief description of its purpose and characteristics. It explains that collections allow storing heterogeneous data types with variable sizes, unlike arrays.
The document provides steps for installing MySQL on Windows, describes basic SQL commands like CREATE, SELECT, INSERT, UPDATE and DELETE. It also covers how to create databases and tables, grant user privileges, and includes examples of various SQL statements.
This document discusses the different data types in PHP, including integer, floating point, boolean, string, array, object, resource, and null. It provides examples and explanations of each data type. Integer is for whole numbers, floating point for numbers with decimals, boolean for true/false values, string for text values that can be declared with single, double, heredoc, or nowdoc quotes. Array stores multiple values, resource references external functions, and null represents a variable with no value.
The document provides information about Java's collection framework. It discusses the key interfaces like List, Set, and Map. It describes common implementations of these interfaces like ArrayList, LinkedList, HashSet, TreeSet, HashMap. It explains concepts like iterators, storage of elements in ArrayList and Vector, differences between ArrayList and Vector. It also provides examples of using ArrayList, Vector, HashSet and TreeMap.
The document discusses stored procedures in databases. It defines stored procedures as procedures that are stored in a database with a name, parameter list, and SQL statements. The key points covered include:
- Stored procedures are created using the CREATE PROCEDURE statement and can contain SQL statements and control flow statements like IF/THEN.
- Parameters can be used to pass data into and out of stored procedures.
- Variables can be declared and used within stored procedures.
- Cursors allow stored procedures to iterate through result sets row by row to perform complex logic.
- Error handling and exceptions can be managed within stored procedures using DECLARE HANDLER.
Stored procedures offer benefits
The document discusses String handling in Java. It describes how Strings are implemented as objects in Java rather than character arrays. It also summarizes various methods available in the String and StringBuffer classes for string concatenation, character extraction, comparison, modification, and value conversion. These methods allow extracting characters, comparing strings, modifying strings, and converting between string and other data types.
What is PL/SQL
Procedural Language – SQL
An extension to SQL with design features of programming languages (procedural and object oriented)
PL/SQL and Java are both supported as internal host languages within Oracle products.
Stored procedures allow for grouping SQL statements and parameters to be stored and executed on a database. They provide more capabilities than scripts such as error handling and security. Parameters can pass data into and out of stored procedures. Stored procedures use structures like IF/ELSE, CASE, and cursors to implement decision-making and looping functionality similar to programming languages. Transactions allow grouping statements to commit or rollback changes and ensure data integrity.
This document discusses the collection framework in Java. It provides an overview of the need for collections due to limitations of arrays. It then describes the key interfaces in the collection framework - Collection, List, Set, SortedSet, NavigableSet, Queue, Map, SortedMap, and NavigableMap. For each interface, it provides a brief description of its purpose and characteristics. It explains that collections allow storing heterogeneous data types with variable sizes, unlike arrays.
The document provides steps for installing MySQL on Windows, describes basic SQL commands like CREATE, SELECT, INSERT, UPDATE and DELETE. It also covers how to create databases and tables, grant user privileges, and includes examples of various SQL statements.
This document discusses the different data types in PHP, including integer, floating point, boolean, string, array, object, resource, and null. It provides examples and explanations of each data type. Integer is for whole numbers, floating point for numbers with decimals, boolean for true/false values, string for text values that can be declared with single, double, heredoc, or nowdoc quotes. Array stores multiple values, resource references external functions, and null represents a variable with no value.
The document provides information about Java's collection framework. It discusses the key interfaces like List, Set, and Map. It describes common implementations of these interfaces like ArrayList, LinkedList, HashSet, TreeSet, HashMap. It explains concepts like iterators, storage of elements in ArrayList and Vector, differences between ArrayList and Vector. It also provides examples of using ArrayList, Vector, HashSet and TreeMap.
The document discusses stored procedures in databases. It defines stored procedures as procedures that are stored in a database with a name, parameter list, and SQL statements. The key points covered include:
- Stored procedures are created using the CREATE PROCEDURE statement and can contain SQL statements and control flow statements like IF/THEN.
- Parameters can be used to pass data into and out of stored procedures.
- Variables can be declared and used within stored procedures.
- Cursors allow stored procedures to iterate through result sets row by row to perform complex logic.
- Error handling and exceptions can be managed within stored procedures using DECLARE HANDLER.
Stored procedures offer benefits
The document discusses String handling in Java. It describes how Strings are implemented as objects in Java rather than character arrays. It also summarizes various methods available in the String and StringBuffer classes for string concatenation, character extraction, comparison, modification, and value conversion. These methods allow extracting characters, comparing strings, modifying strings, and converting between string and other data types.
PHP provides built-in connectivity to many databases like MySQL, PostgreSQL, Oracle and more. To connect to a database in PHP, a connection is created using mysql_connect or mysql_pconnect, which may create a persistent connection. The high-level process involves connecting to the database, selecting a database, performing a SQL query, processing the results, and closing the connection. Key functions include mysql_query() to submit queries, mysql_fetch_array() to retrieve rows from the results, and mysql_close() to terminate the connection.
The document discusses collection framework in Java. It explains that arrays have fixed size and hold homogeneous elements while collections are growable and can hold heterogeneous elements. The key interfaces and classes of collection framework include Collection, List, Set, Queue, and Map. Common implementations like ArrayList, LinkedList, Vector, Stack are also covered along with their properties and usage. Cursors like Enumeration, Iterator and ListIterator are explained which can be used to traverse collection elements.
Spring tutorial for beginners - Learn Java Spring Framework version 3.1.0 starting from environment setup, inversion of control (IoC), dependency injection, bean scopes, bean life cycle, inner beans, autowiring, different modules, aspect oriented programming (AOP), database access (JDBC), Transaction Management, Web MVC framework, Web Flow, Exception handling, EJB integration and Sending email etc.
This keyword is a reference variable that refer the current object in java.
This keyword can be used for call current class constructor.
http://www.tutorial4us.com/java/java-this-keyword
The document discusses various SQL concepts like database and tables, RDBMS terminology, SQL commands categories, data types, creating and manipulating tables. It explains concepts like primary key, foreign key, aggregate functions like MAX(), MIN(), AVG(), SUM(). Examples are provided for queries using SELECT, WHERE, ORDER BY, UPDATE and DELETE statements. Logical and relational operators used for filtering data in WHERE clause are also explained.
This document provides an overview of the Java Collections Framework. It discusses core collection interfaces like List, Set, and Map and their common implementations like ArrayList, HashSet, and HashMap. It also covers sorting collections with Comparable and Comparator, searching collections with binary search, and using utility methods in the Collections class. Examples are provided to illustrate usage of various collection classes and methods.
Constructor is a special member method which will be called automatically when you create an object of any class.
The main purpose of using constructor is to initialize an object.
http://www.tutorial4us.com/java/java-constructor
This document provides an overview of SQL (Structured Query Language). It discusses that SQL is used to define, manipulate, and control data in a relational database. It can define database schemas, insert, modify, retrieve, and delete data from databases. The document also provides a brief history of SQL and describes its main components like DDL, DML, and DCL. It provides examples of common SQL commands and functions. Finally, it discusses SQL Plus which is a basic Oracle utility used to interact with databases through a command line interface.
The document discusses the XML DOM (Document Object Model). It defines the DOM as a standard for accessing and manipulating XML documents through a tree structure representation. The DOM defines all elements in an XML document as nodes that can be traversed and modified. It outlines DOM properties and methods for navigating and manipulating the node tree. Advantages of the DOM include its traversable and modifiable tree structure, while disadvantages include higher resource usage compared to SAX parsing.
The document discusses exception handling in PL/SQL. It defines exceptions as abnormal conditions that can occur during program execution. There are two types of exceptions: system-defined exceptions which are predefined by Oracle and user-defined exceptions which are declared by the user. The document provides examples of how to handle different system-defined exceptions like NO_DATA_FOUND, INVALID_CURSOR, CURSOR_ALREADY_OPENED, INVALID_NUMBER, and ZERO_DIVIDE. It also demonstrates how to declare and raise user-defined exceptions. The RAISE_APPLICATION_ERROR technique to specify custom error numbers and messages without an exception block is also covered.
This document discusses Java collections framework and various collection classes like ArrayList, LinkedList, HashSet, HashMap etc. It provides definitions and examples of commonly used collection interfaces like List, Set and Map. It explains key features of different collection classes like order, duplicates allowed, synchronization etc. Iterators and generic types are also covered with examples to iterate and create typed collection classes.
This document provides an overview of C# program structure and key concepts like namespaces, classes, structs, interfaces, enumerations, delegates, and abstract classes. It defines each concept, provides examples, and explains when to use each one and how they relate to each other. Namespaces help organize code, classes and structs define custom types, interfaces define common functionality, enumerations define named constants, delegates define callbacks, and abstract classes define common traits.
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.
The document discusses various PHP array functions including:
- Array functions like array_combine(), array_count_values(), array_diff() for comparing and merging arrays.
- Sorting arrays with asort(), arsort(), ksort(), krsort().
- Other functions like array_search(), array_sum(), array_rand() for searching, summing and random values.
- Modifying arrays with array_push(), array_pop(), array_shift() for adding/removing elements.
The document provides examples of using each array function in PHP code snippets.
This document discusses triggers in PL/SQL. It defines a trigger as a database event that fires before or after data manipulation language (DML) statements. Triggers can be created to fire before or after insert, update, or delete statements on a table. Row-level triggers fire for each row affected by a statement, while statement-level triggers fire once per statement regardless of rows affected. The document provides examples of creating triggers to uppercase names before insertion and to transfer rows between tables after deletion. It also discusses using the :new and :old references to access column values in row-level triggers.
Mysql is a popular open source database system. It can be downloaded from the mysql website for free. Mysql allows users to create, manipulate and store data in databases. A database contains tables which hold related information. Structured Query Language (SQL) is used to perform operations like querying and manipulating data within MySQL databases. Some common SQL queries include SELECT, INSERT, UPDATE and DELETE.
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
This document discusses exception handling in Java. It defines exceptions as abnormal conditions that disrupt normal program flow. Exception handling allows programs to gracefully handle runtime errors. The key aspects covered include the exception hierarchy, try-catch-finally syntax, checked and unchecked exceptions, and creating user-defined exceptions.
This ppt gives a general idea about the multithreading concepts in the java programming language. hope you find it useful
P.S :
sorry there is a correction in one of the slides
where i have entered implements thread
it is wrong it is actually implements Runnable
thank you!
A presentation about MySQL for beginners. It includes the following topics:
- Introduction
- Installation
- Executing SQL statements
- SQL Language Syntax
- The most important SQL commands
- MySQL Data Types
- Operators
- Basic Syntax
- SQL Joins
- Some Exercise
The document discusses best practices for relational database design including:
- Normalizing data to minimize redundancy and avoid anomalies
- Using primary, foreign, and composite keys to link tables
- Modeling one-to-one, one-to-many, and many-to-many relationships between tables
- Performing different types of joins to retrieve related data
- Following naming conventions for databases, tables, columns and other objects
- Implementing security measures to prevent SQL injection attacks
PHP provides built-in connectivity to many databases like MySQL, PostgreSQL, Oracle and more. To connect to a database in PHP, a connection is created using mysql_connect or mysql_pconnect, which may create a persistent connection. The high-level process involves connecting to the database, selecting a database, performing a SQL query, processing the results, and closing the connection. Key functions include mysql_query() to submit queries, mysql_fetch_array() to retrieve rows from the results, and mysql_close() to terminate the connection.
The document discusses collection framework in Java. It explains that arrays have fixed size and hold homogeneous elements while collections are growable and can hold heterogeneous elements. The key interfaces and classes of collection framework include Collection, List, Set, Queue, and Map. Common implementations like ArrayList, LinkedList, Vector, Stack are also covered along with their properties and usage. Cursors like Enumeration, Iterator and ListIterator are explained which can be used to traverse collection elements.
Spring tutorial for beginners - Learn Java Spring Framework version 3.1.0 starting from environment setup, inversion of control (IoC), dependency injection, bean scopes, bean life cycle, inner beans, autowiring, different modules, aspect oriented programming (AOP), database access (JDBC), Transaction Management, Web MVC framework, Web Flow, Exception handling, EJB integration and Sending email etc.
This keyword is a reference variable that refer the current object in java.
This keyword can be used for call current class constructor.
http://www.tutorial4us.com/java/java-this-keyword
The document discusses various SQL concepts like database and tables, RDBMS terminology, SQL commands categories, data types, creating and manipulating tables. It explains concepts like primary key, foreign key, aggregate functions like MAX(), MIN(), AVG(), SUM(). Examples are provided for queries using SELECT, WHERE, ORDER BY, UPDATE and DELETE statements. Logical and relational operators used for filtering data in WHERE clause are also explained.
This document provides an overview of the Java Collections Framework. It discusses core collection interfaces like List, Set, and Map and their common implementations like ArrayList, HashSet, and HashMap. It also covers sorting collections with Comparable and Comparator, searching collections with binary search, and using utility methods in the Collections class. Examples are provided to illustrate usage of various collection classes and methods.
Constructor is a special member method which will be called automatically when you create an object of any class.
The main purpose of using constructor is to initialize an object.
http://www.tutorial4us.com/java/java-constructor
This document provides an overview of SQL (Structured Query Language). It discusses that SQL is used to define, manipulate, and control data in a relational database. It can define database schemas, insert, modify, retrieve, and delete data from databases. The document also provides a brief history of SQL and describes its main components like DDL, DML, and DCL. It provides examples of common SQL commands and functions. Finally, it discusses SQL Plus which is a basic Oracle utility used to interact with databases through a command line interface.
The document discusses the XML DOM (Document Object Model). It defines the DOM as a standard for accessing and manipulating XML documents through a tree structure representation. The DOM defines all elements in an XML document as nodes that can be traversed and modified. It outlines DOM properties and methods for navigating and manipulating the node tree. Advantages of the DOM include its traversable and modifiable tree structure, while disadvantages include higher resource usage compared to SAX parsing.
The document discusses exception handling in PL/SQL. It defines exceptions as abnormal conditions that can occur during program execution. There are two types of exceptions: system-defined exceptions which are predefined by Oracle and user-defined exceptions which are declared by the user. The document provides examples of how to handle different system-defined exceptions like NO_DATA_FOUND, INVALID_CURSOR, CURSOR_ALREADY_OPENED, INVALID_NUMBER, and ZERO_DIVIDE. It also demonstrates how to declare and raise user-defined exceptions. The RAISE_APPLICATION_ERROR technique to specify custom error numbers and messages without an exception block is also covered.
This document discusses Java collections framework and various collection classes like ArrayList, LinkedList, HashSet, HashMap etc. It provides definitions and examples of commonly used collection interfaces like List, Set and Map. It explains key features of different collection classes like order, duplicates allowed, synchronization etc. Iterators and generic types are also covered with examples to iterate and create typed collection classes.
This document provides an overview of C# program structure and key concepts like namespaces, classes, structs, interfaces, enumerations, delegates, and abstract classes. It defines each concept, provides examples, and explains when to use each one and how they relate to each other. Namespaces help organize code, classes and structs define custom types, interfaces define common functionality, enumerations define named constants, delegates define callbacks, and abstract classes define common traits.
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.
The document discusses various PHP array functions including:
- Array functions like array_combine(), array_count_values(), array_diff() for comparing and merging arrays.
- Sorting arrays with asort(), arsort(), ksort(), krsort().
- Other functions like array_search(), array_sum(), array_rand() for searching, summing and random values.
- Modifying arrays with array_push(), array_pop(), array_shift() for adding/removing elements.
The document provides examples of using each array function in PHP code snippets.
This document discusses triggers in PL/SQL. It defines a trigger as a database event that fires before or after data manipulation language (DML) statements. Triggers can be created to fire before or after insert, update, or delete statements on a table. Row-level triggers fire for each row affected by a statement, while statement-level triggers fire once per statement regardless of rows affected. The document provides examples of creating triggers to uppercase names before insertion and to transfer rows between tables after deletion. It also discusses using the :new and :old references to access column values in row-level triggers.
Mysql is a popular open source database system. It can be downloaded from the mysql website for free. Mysql allows users to create, manipulate and store data in databases. A database contains tables which hold related information. Structured Query Language (SQL) is used to perform operations like querying and manipulating data within MySQL databases. Some common SQL queries include SELECT, INSERT, UPDATE and DELETE.
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
This document discusses exception handling in Java. It defines exceptions as abnormal conditions that disrupt normal program flow. Exception handling allows programs to gracefully handle runtime errors. The key aspects covered include the exception hierarchy, try-catch-finally syntax, checked and unchecked exceptions, and creating user-defined exceptions.
This ppt gives a general idea about the multithreading concepts in the java programming language. hope you find it useful
P.S :
sorry there is a correction in one of the slides
where i have entered implements thread
it is wrong it is actually implements Runnable
thank you!
A presentation about MySQL for beginners. It includes the following topics:
- Introduction
- Installation
- Executing SQL statements
- SQL Language Syntax
- The most important SQL commands
- MySQL Data Types
- Operators
- Basic Syntax
- SQL Joins
- Some Exercise
The document discusses best practices for relational database design including:
- Normalizing data to minimize redundancy and avoid anomalies
- Using primary, foreign, and composite keys to link tables
- Modeling one-to-one, one-to-many, and many-to-many relationships between tables
- Performing different types of joins to retrieve related data
- Following naming conventions for databases, tables, columns and other objects
- Implementing security measures to prevent SQL injection attacks
Meaningful variable and function names are important for clean code. Names should clearly indicate what the variable or function represents. Names like "temp", "x", or "flag" should generally be avoided as they do not convey purpose. Instead, names should be searchable and pronounceable terms from the problem domain. Additional context can be added through classes, namespaces, or prefixes if needed. Names of a moderate length, between 8-20 characters on average, tend to balance readability and understandability.
The document discusses the Entity Relationship Model and its key concepts including entities, attributes, relationships, keys, and cardinalities. It explains how ER diagrams visually depict these concepts through symbols like rectangles for entities and diamonds for relationships. The ER model is used for conceptual database design and captures the logical properties and meanings within an organization's domain.
This document summarizes best practices for configuring and using MySQL. It discusses recommended configuration settings like using the InnoDB storage engine and strict SQL modes. It also covers topics like application user security through limited grants, logging and formatting SQL for analysis, and future-proofing SQL. The document recommends tools like the general query log to help developers analyze and optimize SQL performance.
This document provides an overview of MySQL basics including what MySQL is, installing the MySQL server, using the mysql command line client, SQL basics like concepts and terminology for databases, tables and fields, and performing operations like insert, update, delete and select. It also covers retrieving records with select through ordering, limiting and arithmetic functions. The document concludes by explaining how to read and execute SQL statements from a script file.
SQL is a language used to store, manipulate, and retrieve data in relational database management systems. The core SQL commands are CREATE, SELECT, INSERT, UPDATE, and DELETE. CREATE is used to create new tables and objects. SELECT retrieves data from tables. INSERT adds new rows of data. UPDATE modifies existing data. DELETE removes rows of data. SQL allows users and applications to access data, define data structures, and manage data.
This document provides information about databases, database management systems (DBMS), and basic MySQL operations. It defines a database as a collection of data organized into tables. A DBMS is software that maintains and utilizes these data collections. MySQL is introduced as a free and popular DBMS. The document outlines basic MySQL operations like creating and modifying tables, inserting, retrieving, updating, and deleting records. It also discusses how MySQL stores data and provides examples of SQL queries.
The document provides a tutorial on using SQL commands in MySQL. It begins with an overview of common commands like CREATE DATABASE, DROP DATABASE, CREATE TABLE, INSERT INTO. Sections then cover topics like relationships between tables, backups and indexing. The document includes examples to create a sample "southwind" database with a "products" table, insert rows, and run queries. It explains column definitions and provides the SQL needed to generate the tables and insert sample data.
The ALTER command in MySQL is used to modify the structure of existing tables. It allows you to add, drop, or modify columns, change the data type of columns, rename tables, and change the table type. Some key things the ALTER command allows you to do include:
1. Add or drop columns from a table.
2. Modify column definitions by changing the data type, default value, nullability, or length of a column.
3. Change the name of a table or rename columns.
4. Change the table type, such as converting between InnoDB and MyISAM.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert data, query data, and more. Installation and configuration steps are also covered.
This document provides instructions and examples for using the MySQL database system. It discusses MySQL concepts like database, tables, rows, and columns. It also demonstrates common SQL commands like CREATE, SELECT, INSERT, UPDATE, DROP. Examples show how to create databases and tables, insert and query data, use functions, conditions and wildcards. Script files demonstrate populating tables with sample data.
This document discusses how to manage tables in a database including creating, modifying, and dropping tables. The key points are:
1. A table stores data in rows and columns and is created using the CREATE TABLE statement.
2. Tables can be modified using the ALTER TABLE statement to add, modify, or drop columns and constraints.
3. Integrity constraints like primary keys, foreign keys, checks and defaults are applied to tables to maintain data integrity.
4. External tables allow querying data stored outside the database in flat files and are created using the CREATE TABLE statement with the ORGANIZATION EXTERNAL clause.
This document provides an overview and instructions for installing and using the MySQL database system. It describes MySQL's client-server architecture, how to connect to the MySQL server using the command line client, and provides examples of common SQL commands for creating databases and tables, inserting, selecting, updating, and deleting rows of data. It also introduces some basic SQL functions and provides SQL scripts as examples to create tables and insert data.
MySQL is a database management system that allows users to define, create, query, update, and administer relational databases. It defines operations like insert, retrieve, modify, and delete data using SQL. Some basic operations in MySQL include creating tables, inserting records, retrieving records by querying tables, updating records, and deleting records or tables. MySQL stores each database as a directory containing table files for the data and index files.
Explained how to the handset on SQL. Explain what is a database. How to create database how to drop database how to create a table. Insert Primary Key, Foreign Key all the constraints, dates. It also explained about the Index.
Applied Partitioning And Scaling Your Database System PresentationRichard Crowley
This document discusses applying partitioning to MySQL OLTP applications. It begins by reviewing classic uses of partitioning in data warehousing applications. It then explains how partitioning can benefit OLTP workloads by reducing seek and scan set sizes and limiting transaction durations. The document provides an example of applying hash partitioning to tables in a retail store application based on store ID. It demonstrates how to expand and merge partitions as stores are added or closed. Performance tests on the partitioned tables show improvements in query times compared to non-partitioned tables. In summary, the document argues that partitioning provides a way to scale MySQL databases for OLTP workloads while reducing maintenance costs.
This note includes the followings:
- Database Create, Drop Operations
- Database Table Create, Drop Operations
- Database Table Alter Operation
- Data insertion
- Data deletion
- Existing data update
- Searching data from data table (showing all record, specific columns, specific rows, column aliasing, sorting data, limiting data, distinct data)
- Aggregate functions
- Group by clause
- Having clause
- Types of table joins
- Table aliasing, Inner Join, Left/Right Join, Self Join
- Subquery operation (scalar subquery, column subquery, row subquery, correlated subquery, derived table)
This presentation focuses on optimization of queries in MySQL from developer’s perspective. Developers should care about the performance of the application, which includes optimizing SQL queries. It shows the execution plan in MySQL and explain its different formats - tabular, TREE and JSON/visual explain plans. Optimizer features like optimizer hints and histograms as well as newer features like HASH joins, TREE explain plan and EXPLAIN ANALYZE from latest releases are covered. Some real examples of slow queries are included and their optimization explained.
The document discusses relational database management systems and the SQL language. It provides information on some key concepts:
1. Tables are the fundamental data structure in relational databases, organized as rows and columns. Each table has a unique name and columns must have unique names within the table.
2. SQL is the standard language used to communicate with relational databases to organize, manage and retrieve data. Key SQL commands include SELECT, INSERT, UPDATE, DELETE.
3. ALTER TABLE, CREATE TABLE, DROP TABLE, and other commands are used to define and modify database structure. Data types supported include numeric, date, text. Columns can be added, modified, or dropped from tables.
An introductory presentation about table partitioning in PostgreSQL and how to integrate it in your Rails application. Given at the Cambridge Ruby User Group meetup Mar 27th 2014.
The document provides instructions on how to use MySQL to create databases and tables, insert data, and delete databases and tables. It includes commands to show databases, create a new database, use a database, create a table, describe a table, insert data using INSERT and LOAD DATA, delete a table, and drop a database. An example is provided to create a database called SN1_LATIHAN1, make a table T_Buku with 5 columns to store book data, insert 4 rows of sample book data, and create a report file of the exercises.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
2. What is Constraint??
Constraints are used to specify rules for the data in a table.
If there is any violation between the constraint and the
data action, the action is aborted by the constraint.
Constraints can be specified when the table is created
(inside the CREATE TABLE statement) or after the table is
created (inside the ALTER TABLE statement).
4. NOT NULL
The NOT NULL constraint enforces a column to NOT
accept NULL values.
It enforces a field to always contain a value.
This means that you cannot insert a new record, or
update a record without adding a value to this field.
5. NOT NULL
Set NOT NULL constraint
• While creating table
• After creating table
Verify NOT NULL in table structure
Try to skip the NOT NULL column in INSERT INTO query
Find what is stored, when we skip NOT NULL column values
Try another ways to insert null into not null column
DROP NOT NULL Constraint from Column
6. Set NOT NULL constraint
While creating
table
After creating
table
7. Set NOT NULL Constraint
(While Creating Table)
mysql> create table table1
-> (
-> rollno int,
-> name varchar(20) not null
-> );
Query OK, 0 rows affected (0.20 sec)
8. Set NOT NULL Constraint
(After Creating Table)
mysql> alter table table1
-> modify name varchar(20) not null;
Query OK, 0 rows affected (0.10 sec)
Records: 0 Duplicates: 0 Warnings: 0
9. 1. Verify NOT NULL in Table Structure
NULL value not allowed in
name column
10. Try to enter Null value in name
column
Display Warningmysql> show warnings;
+---------+------+-------------------------------------------+
| Level
| Code | Message
|
+---------+------+-------------------------------------------+
| Warning | 1364 | Field 'name' doesn't have a default value |
+---------+------+-------------------------------------------+
1 row in set (0.00 sec)
12. What has been Stored by
Table???.2
mysql> select * from table1;
+--------+------+
| rollno | name |
+--------+------+
|
1 |
|
+--------+------+
1 row in set (0.00 sec)
Still not clear what is stored by Table in Name column
13. What has been Stored by
Table???.3
mysql> select length(name)
-> from table1;
+--------------+
| length(name) |
+--------------+
|
0 |
+--------------+
1 row in set (0.02 sec)
Table stored empty
string
BECAUSE if it is NULL;
length function would
have returned NULL
14. Another way to check table has
stored empty String in not null
column.1
mysql> select * from table1
-> where name is null;
Empty set (0.01 sec)
BECAUSE table has stored empty string instead of null
null != empty String (null is not equal to empty string )
15. Another way to check table has
stored empty String in not null
column.1
mysql> select * from table1
-> where name ='';
+--------+------+
| rollno | name |
+--------+------+
|
1 |
|
+--------+------+
1 row in set (0.00 sec)
Hence Proved table has
Stored empty String
17. MySQL Stores these values
when user doesn’t provide value
and
column cannot store NULL;
They are not equivalent to NULL
String
‘’(empty string)
Number
0
Date
0000-00-00
time
00:00:00
18. Another ways to Insert NULL
value.1
mysql> insert into table1(name)
-> values(NULL);
ERROR 1048 (23000): Column 'name'
cannot be null
19. Another ways to Insert NULL
value.2
mysql> insert into table1
-> values(23,NULL);
ERROR 1048 (23000): Column 'name'
cannot be null
20. Another ways to Insert NULL
value.3
mysql> insert into table1
-> values(23);
ERROR 1136 (21S01): Column count
doesn't match value count at row 1
21. Another ways to Insert NULL
value.4
mysql> insert into table1(rollno,name)
-> values(456);
ERROR 1136 (21S01): Column count doesn't
match value count at row 1
22. DEFAULT
The DEFAULT constraint is used to insert
a default value into a column.
The default value will be added to all
new records, if no other value is
specified.
23. DEFAULT
Set DEFAULT constraint
• While creating table
• After creating table
Verify DEFAULT in table structure
Try to skip rollno column value in INSERT INTO
Find what is stored, when we skip NOT NULL column values
Try another ways to insert null into not null column
30. Simple!!! The DEFAULT value
mysql> SELECT * FROM table1;
+--------+--------+
| rollno | name
|
+--------+--------+
|
500 | harish |
+--------+--------+
1 row in set (0.00 sec)
Default Value 500 is Stored when we did not specify any value
31. What happens when we
specify a value????
mysql> INSERT INTO table1
-> VALUES(1,'ramesh');
Query OK, 1 row affected (0.03 sec)
32. Simple !!! The Specified value is
Stored
mysql> SELECT * FROM table1;
+--------+--------+
| rollno | name
|
+--------+--------+
|
500 | harish |
|
1 | ramesh |
+--------+--------+
2 rows in set (0.00 sec)
The specified value in INSERT INTO statement is stored
33. What happens when we store
null in rollno column???
mysql> insert into table1
-> values(NULL,'suresh');
Query OK, 1 row affected (0.07 sec)
34. NULL is stored but why???
mysql> select * from table1;
+--------+--------+
| rollno | name
|
+--------+--------+
|
500 | harish |
|
1 | ramesh |
|
NULL | suresh |
+--------+--------+
3 rows in set (0.00 sec)
NULL can be stored with DEFAULT constraint column
35. Because…..
mysql> desc table1;
+--------+-------------+------+-----+---------+-------+
| Field | Type
| Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| rollno | int(11)
| YES |
| 500
|
|
| name
| varchar(20) | YES |
| NULL
|
|
+--------+-------------+------+-----+---------+-------+
2 rows in set (0.03 sec)
NULL is allowed
36. What happens when we Do not
specify any value????
mysql> insert into table1()
-> values();
Query OK, 1 row affected (0.03 sec)
37. Simple!!!
Default values are stored
mysql> select * from table1;
+--------+--------+
| rollno | name
|
+--------+--------+
|
500 | harish |
|
1 | ramesh |
|
NULL | suresh |
NULL is stored because it is|
500 | NULL
|
1. Default value for this column
+--------+--------+
2. NULL is allowed
4 rows in set (0.00 sec)
Rollno has default value 500,
that’s why it is stored
39. Yes!!! We can
When we add DEFAULT Constraint in a Filled
Column,
No Old Values are altered
40. How to Drop DEFAULT??
mysql> alter table table1
-> alter rollno
-> drop default;
Query OK, 0 rows affected (0.08 sec)
Records: 0 Duplicates: 0 Warnings: 0
41. Verify, DEFAULT Dropped or
Not….
mysql> desc table1;
+--------+-------------+------+-----+---------+-------+
| Field | Type
| Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| rollno | int(11)
| YES |
| NULL
|
|
| name
| varchar(20) | YES |
| NULL
|
|
+--------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
Returned Back to NULL,
like other columns
NO Default value, Only
NULL
43. What is Foreign key?
1.
2.
3.
4.
5.
6.
7.
A foreign key is a field (or collection of fields) in one table that uniquely
identifies a row of another table.
In other words, a foreign key is a column or a combination of columns
that is used to establish and enforce a link between two tables.
The table containing the foreign key is called the referencing or child
table, and the table containing the candidate key is called
the referenced or parent table.
A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
The FOREIGN KEY constraint also prevents invalid data from being
inserted into the foreign key column, because it has to be one of the
values contained in the table it points to.
A table can contain more than one foreign key.
This is sometimes called a referencing key.
44. Example Scenario
For example, consider a database with two tables: a CUSTOMER table that
includes all customer data and an ORDER table that includes all customer
orders. Suppose the business requires that each order must refer to a single
customer. To reflect this in the database, a foreign key column is added to the
ORDER table (e.g., CUSTOMERID), which references the primary key of
CUSTOMER (e.g. ID). Because the primary key of a table must be unique, and
because CUSTOMERID only contains values from that primary key field, we
may assume that, when it has a value, CUSTOMERID will identify the
particular customer which placed the order.
45. Example 2
Persons table
P_Id
LastName
FirstName
Address
City
1
Hansen
Ola
Timoteivn
10
Sandnes
2
Svendson
Tove
Borgvn 23
Sandnes
3
Pettersen
Kari
Storgt 20
Stavanger
Orders table
O_Id
OrderNo
P_Id
1
77895
3
2
44678
3
3
22456
2
4
24562
1
P_id column is common in these tables. P_id is primary key in persons table. The other
way to check is, p_id values are not unique in orders table. It means persons table
which contains p_id as primary key is parent table and orders table is child table.
48. Example 5
Address table is parent
because address_id is
primary key in address table.
Telephone table is child.
You must have a contact before an address or
telephone number.
Contact table is parent
because contact_id is primary
key in contact table. Address
and telephone tables are
children.
59. How to add foreign key in
MySQL/Oracle
While creating table
SyntaxCONSTRAINT <constraint_name>
FOREIGN KEY(<column name of this/child table>)
REFERENCES <Parent Table Name> (<column name of parent table>)
ExampleCREATE TABLE Orders
(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
CONSTRAINT fk_PerOrders
FOREIGN KEY (P_Id)
REFERENCES Persons(P_Id)
)
60. How to add foreign key in
MySQL/Oracle
After creating table
SyntaxALTER TABLE <child table name>
ADD CONSTRAINT <constraint_name>
FOREIGN KEY(<column name of this/child table>)
REFERENCES <Parent Table Name> (<column name of parent table>);
ExampleALTER TABLE Orders
ADD CONSTRAINT fk_PerOrders
FOREIGN KEY (P_Id)
REFERENCES Persons(P_Id);
61. How to check foreign keys in a table
mysql> DESC orders;
+---------+---------+------+-----+---------+-------+
| Field
| Type
| Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| O_Id
| int(11) | NO
| PRI | NULL
|
|
| OrderNo | int(11) | NO
|
| NULL
|
|
| P_Id
| int(11) | YES | MUL | NULL
|
|
+---------+---------+------+-----+---------+-------+
This shows a foreign key constraint is set to
p_id column in orders table.
But Where are the Details???
Its parent table?
Linked column in parent table?
62. Check full details of foreign keys
mysql> SHOW CREATE TABLE orders;
| Table | Create Table
--------------------------------------------------------+
| orders | CREATE TABLE `orders` (
`O_Id` int(11) NOT NULL,
`OrderNo` int(11) NOT NULL,
`P_Id` int(11) DEFAULT NULL,
PRIMARY KEY (`O_Id`),
KEY `fk_PerOrders` (`P_Id`),
CONSTRAINT `fk_PerOrders` FOREIGN KEY (`P_Id`) REFERENCES `persons`
(`p_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+--------+---------------------------------------------------------------------Column in
parent table
Foreign key
constraint name
Column of this
table
Parent table name
63. Drop Foreign key in MySQL/Oracle
MySQL
Oracle
SyntaxALTER TABLE <child table name>
DROP FOREIGN KEY <constraint name>;
SyntaxALTER TABLE <child table name>
DROP CONSTRAINT <constraint name>;
ExampleALTER TABLE Orders
DROP FOREIGN KEY fk_PerOrders;
ExampleALTER TABLE Orders
DROP CONSTRAINT fk_PerOrders