This presentation is on SQL constraints. This presentation was used by me in my YouTube vlog on SQL constraints. Vlog link: https://youtu.be/E94YFmATqb4
The document discusses various types of constraints in SQL including column level constraints like NOT NULL, UNIQUE, DEFAULT, and CHECK constraints as well as table level constraints like PRIMARY KEY and FOREIGN KEY. It provides examples of how to define these constraints when creating or altering tables and explains how each constraint enforces integrity rules and data validation. Constraints are used to impose rules on data values and relationships between columns and tables.
Whenever you make a list of anything – list of groceries to buy, books to borrow from the library, list of classmates, list of relatives or friends, list of phone numbers and so o – you are actually creating a database.
An example of a business manual database may consist of written records on a paper and stored in a filing cabinet. The documents usually organized in chronological order, alphabetical order and so on, for easier access, retrieval and use.
Computer database are those data or information stored in the computer. To arrange and organize records, computer databases rely on database software
Microsoft Access is an example of database software.
The document discusses SQL and its functions. SQL is a language used to store, manipulate, and retrieve data in relational databases. It includes data definition language (DDL) commands like CREATE, ALTER, TRUNCATE, DROP, and RENAME to define and modify database structures. It also includes data manipulation language (DML) commands like INSERT, UPDATE, DELETE, and MERGE to manage data within databases. Examples of each command are provided.
The document discusses SQL operators including arithmetic, comparison, and logical operators. It provides examples of each type of operator including AND, OR, NOT, LIKE, BETWEEN, IN, EXISTS, ALL, and ANY. It also gives the basic syntax of the CREATE DATABASE statement in SQL to create a new database called testDB.
The document describes programs to implement various operations on singly linked lists including insertion, deletion, counting nodes, creating a list, traversing a list, and copying a list. It provides functions for insertion at the beginning, end, and before/after a given node. Deletion functions remove from the beginning, end, or by item value. Counting returns the total nodes or occurrences of a value. Traversal and copying print or duplicate the list.
Structured Query Language (SQL) is a query language that allows users to specify conditions to retrieve data from a database. SQL queries select rows from database tables that satisfy specified conditions. The results are output in a table format. Common SQL clauses include SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and INTO to output results to a table, cursor, file or printer. SQL can perform queries on single or multiple related tables through joins.
Normalization is a process used to organize data in a database. It involves breaking tables into smaller, more manageable pieces to reduce data redundancy and improve data integrity. There are several normal forms including 1NF, 2NF, 3NF, BCNF, 4NF and 5NF. The document provides examples of tables and how they can be decomposed into different normal forms to eliminate anomalies and redundancy through the creation of additional tables and establishing primary keys.
A SQL subquery is a query nested inside another query. Subqueries can be used in the SELECT, WHERE, INSERT, UPDATE, or DELETE clauses. The subquery executes first and its results are then used by the outer query. There are three types of subqueries: single row, multiple row, and multiple column. Single row subqueries use comparison operators like =, <, > and return one row. Multiple row subqueries use operators like IN, ANY, ALL and return multiple rows. Multiple column subqueries compare more than one column between the outer and inner queries.
The document discusses views in SQL. It defines views as logical tables that represent data from one or more underlying tables. Views can be queried, updated, and deleted from like tables but do not occupy storage space. The document describes simple views based on a single table and complex views involving joins across multiple tables. It provides examples of creating, modifying, dropping, and querying views. The document also discusses indexes in SQL, describing them as pointers that speed up data retrieval. It covers B-tree and bitmap indexes and provides examples of creating indexes on tables.
Set operations allow combining results from multiple SELECT statements. There are four main types:
Union combines results and eliminates duplicates. Intersect returns only common records. Union All and Intersect All also show duplicate rows. Syntax involves a SELECT query followed by a set operator and another SELECT query.
Join queries combine data from two or more tables in a database. An inner join returns rows where there is a match between columns in both tables. A left join returns all rows from the left table, along with matched rows from the right table, returning null if there is no match. A right join is similar but returns all rows from the right table. A full join returns all rows and fills in nulls for missing matches between the tables.
This document discusses different types of SQL functions including string, numeric, conversion, group, date/time, and user-defined functions. It provides examples of common string functions like UPPER, LENGTH, SUBSTR. Numeric functions covered include ABS, ROUND, POWER. Group functions include AVG, COUNT, MAX, MIN, SUM. Date functions allow conversion and calculation involving dates. The document demonstrates how to create scalar and table-valued user-defined functions in SQL.
This document discusses different types of joins in SQL including inner joins, self joins, outer joins, and cross joins. An inner join combines rows from two tables based on a common column and returns matched rows. A self join performs an inner join on a single table to match rows with itself. Outer joins return all rows from one or both tables whether or not they have a match. A cross join returns the Cartesian product of all rows in two tables.
This document discusses different types of constraints in a database including:
- Field constraints like NOT NULL, check, unique, primary key, foreign key
- Table constraints like check, unique, primary key, foreign key
- Examples of different constraints like required fields, check constraints using operators, ranges, lists, pattern matching, default values, unique, primary key, foreign key, and identity columns. It also discusses how to add, change, and drop constraints using ALTER and CREATE statements.
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
The document discusses different types of joins in database systems. It defines natural join, inner join, equi join, theta join, semi join, anti join, cross join, outer join including left, right and full outer joins, and self join. Examples are provided for each type of join to illustrate how they work.
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
MySQL JOINS allow retrieving data from two or more related database tables using primary and foreign keys. There are several types of JOINs: Cross JOINs return all combinations of rows from both tables; Inner JOINs return rows where the joined columns are equal; Left and Right JOINs return all rows from the left or right table respectively and matching rows from the other table. JOINs improve performance over multiple queries by using indexing and reducing data transfers between MySQL and applications.
This presentation gives a clear and concise description of joins in sql and several types of sql joins.
These slides also contains the pictorial representation as well as syntax for each type of joins.
The document discusses various SQL concepts like views, triggers, functions, indexes, joins, and stored procedures. Views are virtual tables created by joining real tables, and can be updated, modified or dropped. Triggers automatically run code when data is inserted, updated or deleted from a table. Functions allow reusable code and improve clarity. Indexes allow faster data retrieval. Joins combine data from different tables. Stored procedures preserve data integrity.
A subquery is a query nested within another query. The inner subquery executes first and its results are used by the outer query. There are different types of subqueries including single-row, multiple-row, multiple-column, and correlated subqueries. Single-row subqueries use operators like = and > to compare a single result, while multiple-row subqueries use operators like IN, ALL, ANY to handle multiple returned rows. Correlated subqueries are executed once for each row returned by the outer query, allowing the queries to reference each other.
Triggers are stored database procedures that are automatically invoked in response to certain events like data changes. They allow flexible management of data integrity by enforcing business rules. Triggers can be used to log events, gather statistics, modify data when views are updated, enforce referential integrity across nodes, publish database events, prevent operations during certain hours, and enforce complex integrity rules that cannot be defined with constraints alone. Unlike stored procedures, triggers are not explicitly invoked but rather automatically fire in response to triggering events like data modifications.
The document provides an introduction to the SQL language. It discusses the three main types of SQL statements: DDL, DML, and DCL. It also covers topics such as data types, constraints, functions, views, and how to create, modify and query tables. SQL is a language used to manage relational database management systems (RDBMS) and allows users to define, manipulate, and control access to data in a RDBMS.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
A SQL subquery is a query nested inside another query. Subqueries can be used in the SELECT, WHERE, INSERT, UPDATE, or DELETE clauses. The subquery executes first and its results are then used by the outer query. There are three types of subqueries: single row, multiple row, and multiple column. Single row subqueries use comparison operators like =, <, > and return one row. Multiple row subqueries use operators like IN, ANY, ALL and return multiple rows. Multiple column subqueries compare more than one column between the outer and inner queries.
The document discusses views in SQL. It defines views as logical tables that represent data from one or more underlying tables. Views can be queried, updated, and deleted from like tables but do not occupy storage space. The document describes simple views based on a single table and complex views involving joins across multiple tables. It provides examples of creating, modifying, dropping, and querying views. The document also discusses indexes in SQL, describing them as pointers that speed up data retrieval. It covers B-tree and bitmap indexes and provides examples of creating indexes on tables.
Set operations allow combining results from multiple SELECT statements. There are four main types:
Union combines results and eliminates duplicates. Intersect returns only common records. Union All and Intersect All also show duplicate rows. Syntax involves a SELECT query followed by a set operator and another SELECT query.
Join queries combine data from two or more tables in a database. An inner join returns rows where there is a match between columns in both tables. A left join returns all rows from the left table, along with matched rows from the right table, returning null if there is no match. A right join is similar but returns all rows from the right table. A full join returns all rows and fills in nulls for missing matches between the tables.
This document discusses different types of SQL functions including string, numeric, conversion, group, date/time, and user-defined functions. It provides examples of common string functions like UPPER, LENGTH, SUBSTR. Numeric functions covered include ABS, ROUND, POWER. Group functions include AVG, COUNT, MAX, MIN, SUM. Date functions allow conversion and calculation involving dates. The document demonstrates how to create scalar and table-valued user-defined functions in SQL.
This document discusses different types of joins in SQL including inner joins, self joins, outer joins, and cross joins. An inner join combines rows from two tables based on a common column and returns matched rows. A self join performs an inner join on a single table to match rows with itself. Outer joins return all rows from one or both tables whether or not they have a match. A cross join returns the Cartesian product of all rows in two tables.
This document discusses different types of constraints in a database including:
- Field constraints like NOT NULL, check, unique, primary key, foreign key
- Table constraints like check, unique, primary key, foreign key
- Examples of different constraints like required fields, check constraints using operators, ranges, lists, pattern matching, default values, unique, primary key, foreign key, and identity columns. It also discusses how to add, change, and drop constraints using ALTER and CREATE statements.
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
The document discusses different types of joins in database systems. It defines natural join, inner join, equi join, theta join, semi join, anti join, cross join, outer join including left, right and full outer joins, and self join. Examples are provided for each type of join to illustrate how they work.
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
MySQL JOINS allow retrieving data from two or more related database tables using primary and foreign keys. There are several types of JOINs: Cross JOINs return all combinations of rows from both tables; Inner JOINs return rows where the joined columns are equal; Left and Right JOINs return all rows from the left or right table respectively and matching rows from the other table. JOINs improve performance over multiple queries by using indexing and reducing data transfers between MySQL and applications.
This presentation gives a clear and concise description of joins in sql and several types of sql joins.
These slides also contains the pictorial representation as well as syntax for each type of joins.
The document discusses various SQL concepts like views, triggers, functions, indexes, joins, and stored procedures. Views are virtual tables created by joining real tables, and can be updated, modified or dropped. Triggers automatically run code when data is inserted, updated or deleted from a table. Functions allow reusable code and improve clarity. Indexes allow faster data retrieval. Joins combine data from different tables. Stored procedures preserve data integrity.
A subquery is a query nested within another query. The inner subquery executes first and its results are used by the outer query. There are different types of subqueries including single-row, multiple-row, multiple-column, and correlated subqueries. Single-row subqueries use operators like = and > to compare a single result, while multiple-row subqueries use operators like IN, ALL, ANY to handle multiple returned rows. Correlated subqueries are executed once for each row returned by the outer query, allowing the queries to reference each other.
Triggers are stored database procedures that are automatically invoked in response to certain events like data changes. They allow flexible management of data integrity by enforcing business rules. Triggers can be used to log events, gather statistics, modify data when views are updated, enforce referential integrity across nodes, publish database events, prevent operations during certain hours, and enforce complex integrity rules that cannot be defined with constraints alone. Unlike stored procedures, triggers are not explicitly invoked but rather automatically fire in response to triggering events like data modifications.
The document provides an introduction to the SQL language. It discusses the three main types of SQL statements: DDL, DML, and DCL. It also covers topics such as data types, constraints, functions, views, and how to create, modify and query tables. SQL is a language used to manage relational database management systems (RDBMS) and allows users to define, manipulate, and control access to data in a RDBMS.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
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.
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.
This document discusses database management system concepts including joins and constraints. It defines SQL joins as combining data from two tables and describes four main types: inner, full, left, and right joins. It also covers integrity constraints such as not null, unique, primary key, foreign key, check, default, and index which are used to maintain data quality and prevent accidental damage to the database.
This document discusses database constraints. It explains that constraints are used to specify rules for data in tables to maintain integrity. There are two levels of constraints - column and table level. The main types of constraints are NOT NULL, UNIQUE, CHECK, DEFAULT, and key constraints like PRIMARY KEY and FOREIGN KEY. Constraints enforce limits on the data, make columns non-nullable, enforce unique values, check value ranges, provide default values, and relate tables through primary and foreign keys. Maintaining constraints helps ensure only valid data is stored in the database.
This document provides an introduction to SQL and PostgreSQL. It defines what a database and relational database are, and notes that PostgreSQL is an example of a relational database management system (RDBMS). It describes how data is organized in tables with rows and columns in a relational database. The document outlines common SQL commands like CREATE TABLE, SELECT, WHERE, JOIN, and functions. It provides examples of joining multiple tables and using subqueries.
The document discusses the concept of tables in databases and how to create tables in SQL. It defines what a table is, explains that tables can represent entities, relationships between entities, or lists. It then covers the syntax and rules for creating tables, including specifying the table name, columns, data types, constraints like primary keys, unique keys, foreign keys, default values and check constraints. Examples are provided for creating tables with different constraints. The roles of constraints in enforcing data integrity are also discussed.
The document discusses how to create a database and tables in SQL using DDL statements like CREATE, DROP, and ALTER. It explains that CREATE is used to define new database objects, DROP removes objects, and ALTER modifies objects. Specific examples show how to create a database called ABCCO, and tables like Persons with columns for ID, name, city. It also covers defining primary keys, foreign keys, default and null values when creating tables.
The document discusses various SQL aggregate functions such as COUNT, SUM, AVG, MIN, MAX. It explains that aggregate functions perform calculations on multiple values from one or more columns and return a single value. The document also covers SQL views, joins, constraints and dropping constraints. It provides syntax examples for creating views, performing different types of joins (inner, left, right, full outer), and describes various constraint types like primary key, foreign key, unique key, not null.
The document discusses Structured Query Language (SQL) and its uses. It covers SQL statements like SELECT, INSERT, UPDATE, DELETE to manipulate databases. It also covers SQL data definition language statements like CREATE TABLE to create tables, ALTER TABLE to modify tables, and DROP TABLE to delete tables. Additionally, it discusses SQL data types, constraints like PRIMARY KEY, UNIQUE, FOREIGN KEY and CHECK constraints.
Aggregate functions in SQL perform calculations on multiple values from a column and return a single value. The document discusses various aggregate functions like COUNT, SUM, AVG, MIN, MAX and how they are used. It also covers topics like views, joins, constraints and how to create, update, delete views and constraints.
Constraints constraints of oracle data base management systemsSHAKIR325211
This document discusses database constraints and how to implement data integrity in Oracle databases. It defines different types of constraints like NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and CHECK constraints. It provides examples of defining these constraints at column and table levels using the CREATE TABLE and ALTER TABLE statements. It also discusses managing constraints through adding, dropping and disabling constraints.
The document discusses key concepts related to databases and SQL. It defines data and databases, and describes the main types of database management systems including hierarchical, network, and relational DBMS. It explains some key aspects of relational databases including tables, constraints like primary keys and foreign keys. The document also provides examples of common SQL statements like SELECT, WHERE, ORDER BY, GROUP BY, CREATE TABLE, DROP TABLE, INSERT, UPDATE, DELETE and JOINs.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create databases and tables. Common SQL queries include SELECT, UPDATE, DELETE, INSERT, CREATE DATABASE, ALTER DATABASE, CREATE TABLE, and ALTER TABLE.
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
The Pala kings were people-protectors. In fact, Gopal was elected to the throne only to end Matsya Nyaya. Bhagalpur Abhiledh states that Dharmapala imposed only fair taxes on the people. Rampala abolished the unjust taxes imposed by Bhima. The Pala rulers were lovers of learning. Vikramshila University was established by Dharmapala. He opened 50 other learning centers. A famous Buddhist scholar named Haribhadra was to be present in his court. Devpala appointed another Buddhist scholar named Veerdeva as the vice president of Nalanda Vihar. Among other scholars of this period, Sandhyakar Nandi, Chakrapani Dutta and Vajradatta are especially famous. Sandhyakar Nandi wrote the famous poem of this period 'Ramcharit'.
How to Subscribe Newsletter From Odoo 18 WebsiteCeline George
Newsletter is a powerful tool that effectively manage the email marketing . It allows us to send professional looking HTML formatted emails. Under the Mailing Lists in Email Marketing we can find all the Newsletter.
Exploring Substances:
Acidic, Basic, and
Neutral
Welcome to the fascinating world of acids and bases! Join siblings Ashwin and
Keerthi as they explore the colorful world of substances at their school's
National Science Day fair. Their adventure begins with a mysterious white paper
that reveals hidden messages when sprayed with a special liquid.
In this presentation, we'll discover how different substances can be classified as
acidic, basic, or neutral. We'll explore natural indicators like litmus, red rose
extract, and turmeric that help us identify these substances through color
changes. We'll also learn about neutralization reactions and their applications in
our daily lives.
by sandeep swamy
Geography Sem II Unit 1C Correlation of Geography with other school subjectsProfDrShaikhImran
The correlation of school subjects refers to the interconnectedness and mutual reinforcement between different academic disciplines. This concept highlights how knowledge and skills in one subject can support, enhance, or overlap with learning in another. Recognizing these correlations helps in creating a more holistic and meaningful educational experience.
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessMark Soia
Boost your chances of passing the 2V0-11.25 exam with CertsExpert reliable exam dumps. Prepare effectively and ace the VMware certification on your first try
Quality dumps. Trusted results. — Visit CertsExpert Now: https://www.certsexpert.com/2V0-11.25-pdf-questions.html
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...Celine George
Analytic accounts are used to track and manage financial transactions related to specific projects, departments, or business units. They provide detailed insights into costs and revenues at a granular level, independent of the main accounting system. This helps to better understand profitability, performance, and resource allocation, making it easier to make informed financial decisions and strategic planning.
As of Mid to April Ending, I am building a new Reiki-Yoga Series. No worries, they are free workshops. So far, I have 3 presentations so its a gradual process. If interested visit: https://www.slideshare.net/YogaPrincess
https://ldmchapels.weebly.com
Blessings and Happy Spring. We are hitting Mid Season.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 795 from Texas, New Mexico, Oklahoma, and Kansas. 95 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly. The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetSritoma Majumder
Introduction
All the materials around us are made up of elements. These elements can be broadly divided into two major groups:
Metals
Non-Metals
Each group has its own unique physical and chemical properties. Let's understand them one by one.
Physical Properties
1. Appearance
Metals: Shiny (lustrous). Example: gold, silver, copper.
Non-metals: Dull appearance (except iodine, which is shiny).
2. Hardness
Metals: Generally hard. Example: iron.
Non-metals: Usually soft (except diamond, a form of carbon, which is very hard).
3. State
Metals: Mostly solids at room temperature (except mercury, which is a liquid).
Non-metals: Can be solids, liquids, or gases. Example: oxygen (gas), bromine (liquid), sulphur (solid).
4. Malleability
Metals: Can be hammered into thin sheets (malleable).
Non-metals: Not malleable. They break when hammered (brittle).
5. Ductility
Metals: Can be drawn into wires (ductile).
Non-metals: Not ductile.
6. Conductivity
Metals: Good conductors of heat and electricity.
Non-metals: Poor conductors (except graphite, which is a good conductor).
7. Sonorous Nature
Metals: Produce a ringing sound when struck.
Non-metals: Do not produce sound.
Chemical Properties
1. Reaction with Oxygen
Metals react with oxygen to form metal oxides.
These metal oxides are usually basic.
Non-metals react with oxygen to form non-metallic oxides.
These oxides are usually acidic.
2. Reaction with Water
Metals:
Some react vigorously (e.g., sodium).
Some react slowly (e.g., iron).
Some do not react at all (e.g., gold, silver).
Non-metals: Generally do not react with water.
3. Reaction with Acids
Metals react with acids to produce salt and hydrogen gas.
Non-metals: Do not react with acids.
4. Reaction with Bases
Some non-metals react with bases to form salts, but this is rare.
Metals generally do not react with bases directly (except amphoteric metals like aluminum and zinc).
Displacement Reaction
More reactive metals can displace less reactive metals from their salt solutions.
Uses of Metals
Iron: Making machines, tools, and buildings.
Aluminum: Used in aircraft, utensils.
Copper: Electrical wires.
Gold and Silver: Jewelry.
Zinc: Coating iron to prevent rusting (galvanization).
Uses of Non-Metals
Oxygen: Breathing.
Nitrogen: Fertilizers.
Chlorine: Water purification.
Carbon: Fuel (coal), steel-making (coke).
Iodine: Medicines.
Alloys
An alloy is a mixture of metals or a metal with a non-metal.
Alloys have improved properties like strength, resistance to rusting.
GDGLSPGCOER - Git and GitHub Workshop.pptxazeenhodekar
This presentation covers the fundamentals of Git and version control in a practical, beginner-friendly way. Learn key commands, the Git data model, commit workflows, and how to collaborate effectively using Git — all explained with visuals, examples, and relatable humor.
2. CONSTRAINTS
• Constraints are used to limit the type of data that can go into a table. This ensures the accuracy
and reliability of the data in the table. If there is any violation between the constraint and the data
action, the action is aborted.
Constraints
in SQL
NOT
NULL
UNIQUE
FOREIGN
KEY
PRIMARY
KEY
CHECK
DEFAULT
3. CONSTRAINTS CREATION
• Constraints can be specified when the table is created with
the CREATE TABLE statement, or after the table is created
with the ALTER TABLE statement.
CREATE TABLE table_name (
column1 datatype constraint,
column2 datatype constraint,
column3 datatype constraint,
....
);
ALTER TABLE table_name
ALTER COLUMN column_name datatype;
4. NOT NULL
• By default, a column can hold NULL values.
• The NOT NULL constraint enforces a column to NOT accept NULL values.
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255) NOT NULL,
Age int
);
ALTER TABLE Persons
MODIFY Age int NOT NULL;
5. UNIQUE
• The UNIQUE constraint ensures that all values in a column are different.
CREATE TABLE Persons (
ID int NOT NULL UNIQUE,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int
);
• One column
ALTER TABLE Persons
ADD UNIQUE (ID);
• Multiple Columns
ALTER TABLE Persons
ADD CONSTRAINT UC_Person UNIQUE (ID,LastName);
6. PRIMARY KEY
• The PRIMARY KEY constraint uniquely identifies each record in a table.
• Primary keys must contain UNIQUE values and cannot contain NULL values.
• A table can have only ONE primary key, and, in the table, this primary key can consist of single or
multiple columns (fields).
CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int
);
• One Column
ALTER TABLE Persons
ADD PRIMARY KEY (ID);
• Multiple Columns
ALTER TABLE Persons
ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);
7. FOREIGN KEY
• The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
• A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in
another table.
• The table with the foreign key is called the child table, and the table with the primary key is called
the referenced or parent table.
8. CREATE TABLE Orders (
OrderID int NOT NULL PRIMARY KEY,
OrderNumber int NOT NULL,
PersonID int FOREIGN KEY REFERENCES Persons(PersonID)
);
• One Column
ALTER TABLE Orders
ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
• Multiple Columns
ALTER TABLE Orders
ADD CONSTRAINT FK_PersonOrder
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
9. CHECK
• The CHECK constraint is used to limit the value range that can be placed in a column.
• If you define a CHECK constraint on a column it will allow only certain values for this column.
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int CHECK (Age>=18)
);
• One Column
ALTER TABLE Persons
ADD CHECK (Age>=18);
• Multiple Columns
ALTER TABLE Persons
ADD CONSTRAINT CHK_PersonAge CHECK (Age>=18 AND City
='London');
10. DEFAULT
• The DEFAULT constraint is used to set a default value for a column.
• The default value will be added to all new records, if no other value is specified.
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
City varchar(255) DEFAULT 'London'
);
ALTER TABLE Persons
ADD CONSTRAINT df_City
DEFAULT 'London' FOR City;