SQL Statements (1)
SQL Statements (1)
SQL
SQL: Structured Query Language
SQL stands for Structured Query Language
Database management Language
SQL has become the de facto standard
language for creating and querying relational
databases.
ANSI (American National Standards
Institute) Standarad
Who should learn SQL?
Who should learn SQL?
i) Database Developers
As a separate definition:
PRIMARY KEY(ColumnName);
Once a UNIQUE constraint is defined, if you attempt to insert or update a value that already
exists in the column, SQLite will issue an error and abort the operation.
For e.g.
The contacts table stores contact information.
The groups table stores group information.
The contact_groups table stores the relationship
between contacts and groups.
Create Table
CREATE TABLE contacts (contact_id INTEGER PRIMARY KEY,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
email text NOT NULL UNIQUE,
phone text NOT NULL UNIQUE);
languages
language_id PRIMARY KEY ,integer
country_languages
country_id integer ,NOT NULL
language_id integer NOT NULL
PRIMARY KEY country_id, language_id
Create Table
CREATE TABLE countries (country_id INTEGER PRIMARY KEY,
name text NOT NULL);
Columns can also be given a new name with the use of ALTER TABLE.