SQL PPT
SQL PPT
Eg :- In employee table landline number cannot be a key since some people may not
have phone.
● Referential Integrity: This is the concept of foreign keys. The rule states that the foreign
key value can be in two states. The first state is that the foreign key value would refer to a
primary key value of another table, or it can be null
● Domain Integrity: This states that all columns in a relational database are in a defined
domain.
Foreign Key Rules
Additional foreign key rules may be added, such as what to do with the child rows (Orders
table) when the record with the PK – the parent (Customer) is deleted or changed (updated).
The relationship window in Access shows two additional options for foreign keys rules.
Cascade Update and Cascade Delete. If they are not selected, the system would prevent
the deletion or update of PK values in the parent table (Customer) if a child record exists.
The child record is any record with a matching PK.
CASCADE DELETE
– RESTRICT-not deleting if the child row exists
– CASCADE-delete the child with the parent deletion
– SET TO NULL-during deletion of parent the child is set to NULL
CASCADE UPDATE
– RESTRICT-not updating the parent while child row exists
– CASCADE-updating the child when parent row is updated
In some databases, an additional option exists when selecting the Delete option. That is ‘Set
to Null’. In these situations, the PK row is deleted, but the FK in the child table is set to Null.
Though this creates an orphan row, it is acceptable.
CODD’s Rules
Codd is the father of relational databases.He published 12 rules that define the
ideal database.
All data should be presented to the user in the table form.Even if a query
returns single row it should be in table format.
Rule 4 :-(The Dynamic Online Catalog Based on the Relational Model rule)
A relational database must provide access to its structures through the same tools
that are used to access the data.
There must be at least one language whose statements are expressible with
well defined syntax as character strings and should support the following.
● Data definition
● View definition
● Data manipulation
● Integrity constraints
● Transaction boundaries
Rule 6 :- (The View Updating rule)
Meaning user should be unaware about the database location that is whether or
not the database is distributed in multiple locations.
If the database has any means of handling a single record at a time, that low-level
language must not be able to subvert or avoid the integrity rules which are
expressed in a higher-level language that handles multiple records at a time.
Meaning the only way to modify database structure should be database language
Normalisation of database
Normalization is a process of organizing the data in database to avoid
● data redundancy
● insertion anomaly
● update anomaly
● deletion anomaly
● to ensure that the data is logically stored
Need for Normalisation
● Difficult to handle and update the database
● Insertion,updation and deletion anomalies are very frequent if the database is
not normalized.
Anomalies in DBMS
● Insertion
● Updation
● Deletion
Updation anomaly
To update address of a student who occurs twice or more than twice in a table,
Suppose for a new admission, we have a Student id(S_id), name and address of a
student but if student has not opted for any subjects yet then we have to insert
NULL there, leading to Insertion Anamoly.
Eg :- student and course form composite key .student cannot be enrolled in the
same course more than once that is combination should be unique.student and
course form the composite key and their combination should be unique
Deletion anomaly :-
If (S_id) 402 has only one subject and temporarily he drops it, when we delete that
row, entire student record will be deleted along with it.
Normalization Rule
4. BCNF
First Normal Form
The Primary key is usually a single column, but sometimes more than one
column can be combined to create a single primary key. For example consider a
Using the First Normal Form, data redundancy increases, as there will be many
columns with same data in multiple rows but each row as a whole will be unique.
Second Normal Form (2NF)
As per the Second Normal Form there must not be any partial dependency of any column on
primary key. It means that for a table that has concatenated primary key, each column in the
table that is not part of the primary key must depend upon the entire concatenated key for its
existence. If any column depends only on one part of the concatenated key, then the table
fails Second normal form.
In example of First Normal Form there are two rows for Adam, to include multiple subjects
that he has opted for. While this is searchable, and follows First normal form, it is an
inefficient use of space. Also in the above Table in First Normal Form, while the candidate
key is {Student, Subject}, Age of Student only depends on Student column, which is
incorrect as per Second Normal Form. To achieve second normal form, it would be helpful to
split out the subjects into an independent table, and match them up using the student names
as foreign keys.
In Subject Table the candidate key will be {Student, Subject} column. Now, both the above tables qualifies
Third Normal Form (3NF)
Third Normal form applies that every non-prime attribute of table must be dependent on
primary key, or we can say that, there should not be the case that a non-prime attribute is
determined by another non-prime attribute. So this transitive functional dependency should
be removed from the table and also the table must be in Second Normal form
Super key :-
A super key is a set or one of more columns (attributes) to uniquely identify rows in a
table.
Candidate key :-
Candidate keys are selected from the set of super keys, the only thing we take care while
selecting candidate key is: It should not have any redundant attribute.
BCNF contd ..
It is an advance version of 3NF that’s why it is also referred as 3.5NF. BCNF is stricter than
3NF. A table complies with BCNF if it is in 3NF and for every functional dependency X->Y,
X should be the super key of the table.
To satisfy BCNF that table should be split into 3 tables
SQL Constraints
SQL 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).
In SQL, we have the following constraints:
● NOT NULL - Indicates that a column cannot store NULL value
● UNIQUE - Ensures that each row for a column must have a unique value
● PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Ensures that a column (or
combination of two or more columns) have a unique identity which helps to find a particular record in
a table more easily and quickly
● FOREIGN KEY - Ensure the referential integrity of the data in one table to match values in another
table
● CHECK - Ensures that the value in a column meets a specific condition
● DEFAULT - Specifies a default value for a column
NOT NULL
❖ The NOT NULL constraint enforces a column to NOT accept NULL values.
❖ The NOT NULL constraint 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.
Example :-
CREATE TABLE PersonsNotNull
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
Unique
❖ UNIQUE constraint ensures that a field or column will only have unique values.
❖ A UNIQUE constraint field will not have duplicate data
Example :-
CREATE TABLE Persons
(
P_Id int UNIQUE,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
Unique contd ..
To allow naming of a UNIQUE constraint, and for defining a UNIQUE constraint on multiple columns, use
the following SQL syntax:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CONSTRAINT uc_PersonID UNIQUE (P_Id,LastName)
)
Unique contd .. (in alter statement)
To add constraint after the table is created
Orders (table)
FOREIGN KEY contd ..
❖ Note that the "P_Id" column in the "Orders" table points to the "P_Id" column
in the "Persons" table.
❖ The "P_Id" column in the "Persons" table is the PRIMARY KEY in the
"Persons" table.
❖ The "P_Id" column in the "Orders" table is a FOREIGN KEY in the "Orders"
table.
❖ The FOREIGN KEY constraint is used to prevent actions that would destroy
links between tables.
❖ 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.
Foreign key contd ..
CREATE TABLE Persons
(
P_Id int PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
CREATE TABLE Orders
(
O_Id int PRIMARY KEY,
OrderNo int NOT NULL,
P_Id int FOREIGN KEY REFERENCES Persons(P_Id)
)
Foreign key contd .. (in alter statement)
To add a primary key
REFERENCES Persons(P_Id)
FirstName varchar(255),
Address varchar(255),
City varchar(255),
)
CHECK Constraint on ALTER TABLE
To add constraint
To drop constraint
Result :-
Where clause
It is used to apply filter condition
Syntax :-
SELECT column_name,column_name
FROM table_name
1)Commit
2)Rollback
3)Save
1)Commit
2)Rollback
This command restores the database to last commited state. It is also use with
savepoint command to jump to a savepoint in a transaction.
rollback;
rollback to savepoint_name;
3)Savepoint
savepoint savepoint_name;
Not included DDL and DML statements
Kindly refer your notes
TCL example :-
TCL example
Rollback to A;
Products table :-
Count()
SQL COUNT(column_name) Syntax
MAX() Syntax
MIN() Syntax
GROUP BY column_name;
Example :-
SELECT dept_id, SUM(SALARY) FROM employee
GROUP BY dept_id;
HAVING Clause
The HAVING clause is added to SQL because the WHERE keyword could not be
used with aggregate functions.
SQL HAVING Syntax
FROM table_name
GROUP BY column_name
GROUP BY dept_id
having count(dept_id)>=1;
UCASE()
The UCASE() function converts the value of a field to uppercase.
UCASE() Syntax
The LEN() function returns the length of the value in a text field
The NOW() function returns the current system date and time.
SYNTAX :-
replace_with
The SQL statement above would return 'n/a' if the supplier_city field contained a null value. Otherwise, it would return the
supplier_city value.
This SQL statement would return the supplier_name field if the supplier_desccontained a null value. Otherwise, it would
return the supplier_desc.
This SQL statement would return 0 if the commission field contained a null value.Otherwise, it would return the commission
field.
Exercise Lab :- Try applying aggregate or group value functions to the column containing null value.
Example :-
SELECT 1+1
from dual;
SELECT SYSDATE
from dual;
SQL Arithmetic functions :-
ABS()
The SQL ABS() returns the absolute value of a number passed as argument.
SELECT ABS(-17.36)
FROM dual;
Output
ABS(-17.36)
-----------
17.36
ceil()
SQL CEIL() will rounded up any positive or negative decimal value to next greater integer value
Example
(CEIL(17.36))
--------------------
18
CEIL(-17.36)
------------------
exp()
EXP() returns e raised to the n-th power(n is the numeric expression), where e is the base of natural
algorithm and the value of e is approximately 2.71828183
Example :-
E_TO_2S_POWER
---------------------------
7.3890561
floor()
The SQL FLOOR() rounded up any positive or negative decimal value down to the next least integer value.
Example :-
SELECT FLOOR(17.36) FROM dual;
FLOOR(17.36)
---------------------
17
FLOOR(-17.36)
----------------------
-18
LN()
Example :-
natural_log of 65
---------------------------
4.17438727
MOD()
1. SELECT MOD(25,7)
2. FROM dual;
Output
MOD(25,7)
-----------------
4
POWER()
The SQL POWER() function returns the value of a number raised to another
Syntax
1. SELECT POWER(2,3)
2. FROM dual;
Output
POWER(2,3)
-------------------
8
SQRT()
Example :-
Output
SQRT(36)
------------------
6
Order of execution
FROM
ON
JOIN
WHERE
GROUP BY
HAVING
SELECT
DISTINCT
ORDER BY
Set Operation in SQL
Set operators :-
1)UNION
2)UNION ALL
3)INTERSECT
4)MINUS
UNION
● UNION is used to combine the results of two or more Select statements.
● However it will eliminate duplicate rows from its result set.
● In case of union, number of columns and datatype must be same in both the
tables.
Tables :-
first :-
Second :-
Result :-
second
Result :-
select * from First
UNION ALL
select * from second
INTERSECT
● Intersect operation is used to combine two SELECT statements, but it only returns the records which
are common from both SELECT statements.
● In case of Intersect the number of columns and datatype must be same.
● MySQL does not support INTERSECT operator.
Tables :-
first :-
Second :-
Result :-
Second :-
Result :-
select * from First
MINUS
select * from second
SQL Join Types:
There are different types of joins available in SQL:
● INNER JOIN
● LEFT JOIN
● RIGHT JOIN
● FULL JOIN
● SELF JOIN
● CARTESIAN JOIN
Inner Join
The INNER JOIN selects all rows from both tables when there occurs match between columns from both
the tables.
Syntax :-
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name=table2.column_name;
INNER OR EQUI JOIN
Orders (table1)
Customers (table2)
Inner join contd...
SELECT Customers.CustomerID,Orders.OrderID, Customers.CustomerName,
Orders.OrderDate
FROM Orders
INNER JOIN Customers
ON Orders.CustomerID=Customers.CustomerID;
Output :-
Left join
The LEFT JOIN returns all rows from the left table (table1), with the matching rows in the
right table (table2). The result is NULL in the right side when there is no match
Syntax :-
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name=table2.column_name;
or:
SELECT column_name(s)
FROM table1
LEFT OUTER JOIN table2
ON table1.column_name=table2.column_name;
Left join contd ...
CUSTOMERS (table 1)
ORDERS (table2)
Left join contd ...
SELECT ID, NAME, AMOUNT, DATE
FROM CUSTOMERS
LEFT JOIN ORDERS
ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID;
output:-
RIGHT JOIN :-
The RIGHT JOIN returns all rows from the right table (table2), with the matching rows in the left table
(table1). The result is NULL in the left side when there is no match.
Syntax :-
SELECT column_name(s)
FROM table1
ON table1.column_name=table2.column_name;
or:
SELECT column_name(s)
FROM table1
ON table1.column_name=table2.column_name;
Right join contd ..
Class (table1)
Class_info (table2)
Right outer join contd ...
SELECT * FROM class
on (class.id=class_info.id);
Output :-
FULL OUTER JOIN
The FULL OUTER JOIN returns all rows from the left table (table1) and from the right table (table2).
The FULL OUTER JOIN combines the result of both LEFT and RIGHT joins.
Syntax :-
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;
Full outer join contd ..
Class (table1)
Class_info (table2)
Full outer join example
SELECT * FROM class
on (class.id=class_info.id);
Output :-
Self join
A self join is a join in which a table is joined with itself , specially when the table has a FOREIGN KEY
which references its own PRIMARY KEY.
To join a table itself means that each row of the table is combined with itself and with every other row of
the table.
To distinguish the column names from one another, aliases for the actual table name are used, since both
the tables have same name.
This type of JOIN returns the cartesian product of rows from the tables in Join.
It will return a table which consists of records which combines each row from the first table with each row
of the second table
Cross join Example :-
Foods (table 1)
Company (table 2)
Example contd ..
SELECT foods.item_name,foods.item_unit,
company.company_name,company.company_city
FROM foods
CROSS JOIN company;
or
SELECT foods.item_name,foods.item_unit,
company.company_name,company.company_city
FROM foods,company;
What is subquery in SQL?
A subquery is a SQL query nested inside a larger query.
● A subquery may occur in :
- A SELECT clause
- A FROM clause
- A WHERE clause
● The subquery can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another
subquery.
● A subquery is usually added within the WHERE Clause of another SQL SELECT statement.
● You can use the comparison operators, such as >, <, or =. The comparison operator can also be a multiple-row
operator, such as IN, ANY, or ALL.
● A subquery is also called an inner query or inner select, while the statement containing a subquery is also called
an outer query or outer select.
● The inner query executes first before its parent query so that the results of inner query can be passed to the outer
query.
You can use a subquery in a SELECT, INSERT, DELETE, or UPDATE statement to perform the following tasks :
● Compare an expression to the result of the query.
● Determine if an expression is included in the results of the query.
● Check whether the query selects any rows.
SQL Subqueries Example
★ We have the following two tables 'student' and 'marks' with common field 'StudentID'
★ Now we want to write a query to identify all students who get better marks than that of the student
who's StudentID is 'V002', but we do not know the marks of 'V002'.
★ To solve the problem, we require two queries. One query returns the marks (stored in Total_marks
field) of 'V002' and a second query identifies the students who get better marks than the result of the
first query.
Splitting into 2 queries
SELECT *
FROM `marks`
WHERE studentid = 'V002';
Orders table
Note :- neworder table should contain same number of columns with same datatype ;
Subqueries with UPDATE statement
Orders table
UPDATE neworder
SET ord_date='15-JAN-10'
WHERE ord_amount-advance_amount<
(SELECT MIN(ord_amount) FROM orders);
Subqueries with DELETE statement
Orders table
Contents:
Example - Find
SELECT agent_name, agent_code, phone_no
FROM agents
WHERE agent_code =
(SELECT employee_code
FROM employees
WHERE id =5 );
Query -how many orders amount are greater than average amount on 20-april-2008 ?
Orders table
Orders table
Query :- Find the average order amount for each agent_code who is having average amount greater than the average
amount of the agent code ‘A008’
SELECT AVG(ord_amount),agent_code
FROM orders
GROUP BY agent_code
HAVING AVG(ord_amount)=
(SELECT AVG(ord_amount)
FROM orders
WHERE agent_code='A008');
Subqueries in a FROM clause
Foods
SELECT item_id
FROM
(SELECT item_id,company_id
FROM FOODS
WHERE item_id<4)
Where company_id>15
Error in Single Row Subqueries
Inner subquery should return only one row if we are using =,>,< operator in the
where clause
You may use the IN, ANY, or ALL operator in outer query to handle
Agent
Orders
Example :-
Using IN operator with a Multiple Row Subquery
SELECT ord_num,
cust_code, agent_code
FROM orders
WHERE agent_code IN(
SELECT agent_code FROM agents
WHERE working_area='Bangalore'
or working_area=Chennai);
Using NOT IN operator
Example :-
SELECT ord_num,ord_amount,ord_date,
cust_code, agent_code
FROM orders
WHERE agent_code NOT IN(
SELECT agent_code FROM agents
WHERE working_area='Bangalore');
Using ANY with a Multiple Row Subquery
SELECT agent_code,agent_name,working_area,commission
FROM agents
WHERE agent_code=ANY(
SELECT agent_code FROM customer
WHERE cust_country='UK');
USING ANY operator (SOME operator can also be
used)
ANY operator should be satisfied for atleast one of the values mentioned or returned by the inner query
SELECT agent_code,agent_name,working_area,commission
FROM agents
WHERE agent_code=ANY(
SELECT agent_code FROM customer
WHERE agent_code =ANY
(SELECT agent_code FROM orders
WHERE advance_amount>600));
USING ALL operator
SELECT des_date,des_amount,ord_amount
FROM despatch
WHERE des_amount>ALL(
SELECT ord_amount FROM orders
WHERE ord_amount>1000);
If you have a query that requires joining several tables, or has complex logic or calculations, you can code
all that logic into a view, then select from the view just like you would a table.
A view can select certain columns and/or rows from a table, and permissions set on the view instead of
the underlying tables. This allows surfacing only the data that a user needs to see.
A table contains data, a view is just a SELECT statement which is been saved in the database
TEMPORARY TABLES
❏ A temporary table is created by using CREATE TEMPORARY TABLE statement. Notice that the
TEMPORARY keyword is added between CREATE and TABLE keywords.
❏ MySQL drops the temporary table automatically when the session ends or connection is terminated.
you can use the DROP TEMPORARY TABLE statement to drop a temporary table explicitly when
you are no longer use it.
❏ A temporary table is only available and accessible by the client who creates the table.
Syntax :-
CREATE TEMPORARY TABLE SalesSummary (
product_name VARCHAR(50) NOT NULL,
total_sales DECIMAL(12,2) NOT NULL DEFAULT 0.00,
avg_unit_price DECIMAL(7,2) NOT NULL DEFAULT 0.00,
total_units_sold INT UNSIGNED NOT NULL DEFAULT 0
);
Dropping Temporary Tables:
Syntax
● On the other hand, given a record with EMPNO=x, all the records having MGR=x are his sons.
● The unary operator PRIOR indicates “the father of”.
● START WITH clause is used to start from which records we want to start the hierarchy, in our
example we want to start from the root of the hierarchy, the employee that has no manager.
❖ The LEVEL pseudocolumn indicates at which level each record stays in the hierarchy, starting from
the root that has level=1.
❖ Once understood the quey, we can read our resulting tree: KING is the root and has level=1.
❖ Under KING there are three employees at level 2(JONES,BLAKE e CLARK). Then the others.
❖ How does it make the hierarchy? First of all it reads the records.
❖ Then it determines the roots applying the START WITH clause.
❖ Then, starting from each root, it determines the first-level sons applying the CONNECT BY clause
and so on…
Employee table
Example :-
select empno, ename, mgr, prior ename, level
from emp
connect by prior empno = managerno
start with mgr is null;
Example 2 :-
select empno,lpad(' ',level*3,' ')||ename name,
mgr, prior ename, level
from emp
connect by prior empno = mgr
start with mgr is null;
Lpad syntax :-
RETURN income;
END; //
DELIMITER ;
Function contd ..
Call a function :-
SELECT functionname();
Drop Function :-
Calling procedure:-
CALL GetOfficeByCountry('USA');
Example 3 :-
Example 3 contd ...
To get the number of shipped orders, we call the CountOrderByStatus stored procedure
If you declare a cursor before variables declaration, MySQL will issue an error.
Handling not found :-When working with MySQL cursor, you must also declare a NOT FOUND handler
to handle the situation when the cursor could not find any row. Because each time you call the FETCH
statement, the cursor attempts to read the next row in the result set. When the cursor reaches the end of
the result set, it will not be able to get the data, and a condition is raised. The handler is used to handle
this condition.To declare a NOT FOUND handler, you use the following syntax:
Working of MYSQL cursor
MySQL Cursor Example :-
We are going to develop a stored procedure that builds an email list of all employees in employees table.
First, we declare some variables, a cursor for looping over the emails of employees, and a NOT FOUND handler:
Example :-
Example contd ..
Calling procedure
You can test the build_email_list stored procedure using the following script:
Triggers :-
In MYSQL trigger is a set of SQL statements that is invoked automatically when a change is made to the data on the
associated table.
A trigger can be defined to be invoked either before or after the data is changed by INSERT, UPDATE or DELETE
statement.
Example :-
Example contd ..
First create a new table named employees_audit to keep the changes of the employee table.
The following statement creates the employee_audit table.
Example contd ..
Next, create a BEFORE UPDATE trigger that is invoked before a change is made to the employees table.
OLD and NEW keyword
Inside the body of the trigger, we used the OLD keyword to access employeeNumber and lastname column of the row
affected by the trigger.
Notice that in a trigger defined for INSERT, you can use NEW keyword only. You cannot use the OLD keyword. However,
in the trigger defined for DELETE, there is no new row so you can use the OLD keyword only. In the UPDATE trigger,
OLD refers to the row before it is updated and NEW refers to the row after it is updated.
SHOW TRIGGERS;
Viewing triggers in the database
employees > triggers, you will see the before_employee_update trigger as shown in the screenshot below:
After that, update the employees table to check whether the trigger is invoked.
Create Multiple Triggers For The Same Trigger Event
The syntax for creating the first trigger remains the same. In case you have multiple triggers for the same
event in a table, MySQL will invoke the triggers in the order that they were created. To change the order of
triggers, you need to specify FOLLOWS or PRECEDES after the FOR EACH ROW clause.
● The FOLLOWS option allows the new trigger to activate after the existing trigger.
● The PRECEDES option allows the new trigger to activate before the existing trigger.
MySQL Multiple Triggers Example
Suppose, whenever we change the price of a product (column MSRP ),
we want to log the old price in a separate table named price_logs
First, we create a new price_logs table using the CREATE TABLE statement as follows:
Second, we create a new trigger that activates when the BEFORE UPDATE event of the products table occurs. The
trigger’s name is before_products_update :
Example contd ..
Example contd ..
Suppose we want to see not only the old price and when it was changed but also who changed it. We can
add additional columns to the price_logs table. However, for the purpose of multiple triggers
demonstration, we will create a new table to store the data of users who made the changes. The name of
the new table is user_change_logs
Example contd ..
Now, we create a second trigger that activates on the BEFORE UPDATE event of the products table. This
trigger will update the user_change_logs table with the data of the user who made the changes. It is
activated after the before_products_update trigger.
Example contd ..
Information On Triggers Order
Index
An index can be created in a table to find data more quickly and efficiently.
Can be used to speed up searches/queries.
Note: Updating a table with indexes takes more time than updating a table without (because the indexes
also need an update). So you should only create indexes on columns (and tables) that will be frequently
searched against.
SQL CREATE INDEX Syntax :-
Creates an index on a table. Duplicate values are allowed:
CREATE INDEX index_name
ON table_name (column_name)
Creates an index on a table. Duplicate values are not allowed:
CREATE UNIQUE INDEX index_name
ON table_name (column_name)