Trainer: Bach Ngoc Toan– TEDU Website:

Slides:



Advertisements
Similar presentations
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Advertisements

Basic SQL Introduction Presented by: Madhuri Bhogadi.
1 Materi Pendukung Pertemuan > Transaksi pendukung pada SQL Matakuliah: >/ > Tahun: > Versi: >
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
Using Relational Databases and SQL Steven Emory Department of Computer Science California State University, Los Angeles Lecture 10: Data Definition Language.
LOGO 1 Lab_02: Basic SQL. 2 Outline  Database Tables  SQL Statements  Semicolon after SQL Statements?  SQL DML and DDL  SQL SELECT Statement  SQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
HSCI 709 SQL Data Definition Language. SQL Standard SQL-92 was developed by the INCITS Technical Committee H2 on Databases. SQL-92 was designed to be.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Structure Query Language SQL. Database Terminology Employee ID 3 3 Last name Small First name Tony 5 5 Smith James
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
DATA MANIPULATION andCONTROL
Advanced Database Management System
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
DAT602 Database Application Development Lecture 3 Review of SQL Language.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
SQL. คำสั่ง SQL SQL stands for Structured Query Language is a standard language for accessing and manipulating databases.
Tables and Constraints Oracle PL/SQL. Datatypes The SQL Data Definition Language Commands (or DDL) enable us to create, modify and remove database data.
1 SQL - II Data Constraints –Applying data constraints Types of data constraints –I/O constraints The PRIMARY KEY constraints The FOREIGN KEY constraints.
CREATE TABLE CREATE TABLE statement is used for creating relations Each column is described with three parts: column name, data type, and optional constraints.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
1 SQL-2 Tarek El-Shishtawy Professor Ass. Of Computer Engineering.
1 DBS201: More on SQL Lecture 3. 2 Agenda How to use SQL to update table definitions How to update data in a table How to join tables together.
Database UpdatestMyn1 Database Updates SQL is a complete data manipulation language that can be used for modifying the data in the database as well as.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
SY306 Web and Databases for Cyber Operations Databases - The Relational Model.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
UNIVERSITAS BINA DARMA 2013 DATA DEFINITION LANGUAGE (DDL)
1 CS 430 Database Theory Winter 2005 Lecture 13: SQL DML - Modifying Data.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
Web Systems & Technologies
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Fundamental of Database Systems
SQL: Schema Definition and Constraints Chapter 6 week 6
Insert, Update and the rest…
Introduction to Structured Query Language(SQL)
PHP + MySQL Commands Refresher.
LESSON Database Administration Fundamentals Inserting Data.
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
Workbench Data Definition Language (DDL)
لغة قواعد البيانات STRUCTURED QUERY LANGUAGE SQL))
ORACLE I 2 Salim Phone : YM : talim_bansal.
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
SQL Queries Chapter No 3.
HAVING,INDEX,COMMIT & ROLLBACK
Database Management System
Oracle : SQL.
Instructor: Samia arshad
Instructor: SAMIA ARSHAD
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
Database SQL.
Trainer: Bach Ngoc Toan– TEDU Website:
Trainer: Bach Ngoc Toan– TEDU Website:
Trainer: Bạch Ngọc Toàn – TEDU Website:
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
SQL NOT NULL Constraint
Trainer: Bach Ngoc Toan– TEDU Website:
Trainer: Bach Ngoc Toan– TEDU Website:
SQL Tutorial Basic SQL Commands
Development Environment Setup
Migrate ASP.NET Core 1.x to 2.0
SQL AUTO INCREMENT Field
Building Your First ASP.NET Core Web Application
Presentation transcript:

Trainer: Bach Ngoc Toan– TEDU Website: http://tedu.com.vn Lesson 12 SQL ALTER TABLE Trainer: Bach Ngoc Toan– TEDU Website: http://tedu.com.vn

SQL ALTER TABLE The ALTER TABLE statement is used to add, modify or delete columns in an existing table. It is also used to rename a table. You can also use SQL ALTER TABLE command to add and drop various constraints on an existing table.

SQL ALTER TABLE Add Column If you want to add columns in SQL table, the SQL alter table syntax is given below: ALTER TABLE table_name ADD column_name column-definition;   If you want to add multiple columns in table, the SQL table will be ALTER TABLE table_name    ADD column_1 column-definition,              column_2 column-definition,              .....              column_n column-definition;

SQL ALTER TABLE Modify Column If you want to modify an existing column in SQL table, syntax is given below: ALTER TABLE table_name  ALTER COLUMN  column_name column_type;   If you want to modify multiple columns in table, the SQL table will be ALTER TABLE table_name    ALTER COLUMN column_1 column_type,                     column_2 column_type,                    .....                     column_n column_type;  

SQL ALTER TABLE DROP Column The syntax of alter table drop column is given below: ALTER TABLE table_name DROP COLUMN column_name;  

SQL ALTER TABLE RENAME Column The syntax of alter table rename column is given below: sp_rename ‘table name.old column name’, ‘new column name’, “COLUMN’;