Manipulation
Learn how to use SQL to access, create, and update data stored in a database.
StartKey Concepts
Review core concepts you need to learn to master this subject
Column Constraints
CREATE TABLE
Statement
INSERT
Statement
ALTER TABLE
Statement
DELETE
Statement
UPDATE
Statement
Column Constraints
Column Constraints
CREATE TABLE student (
id INTEGER PRIMARY KEY,
name TEXT UNIQUE,
grade INTEGER NOT NULL,
age INTEGER DEFAULT 10
);
Column constraints are the rules applied to the values of individual columns:
PRIMARY KEY
constraint can be used to uniquely identify the row.UNIQUE
columns have a different value for every row.NOT NULL
columns must have a value.DEFAULT
assigns a default value for the column when no value is specified.
There can be only one PRIMARY KEY
column per table and multiple UNIQUE
columns.
Manipulation
Lesson 1 of 1
- 1SQL, Structured Query Language, is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data ac…
- 2Nice work! In one line of code, you returned information from a relational database. SELECT * FROM celebs; We’ll take a look at what this code means soon, for now, let’s focus on what relationa…
- 3The code below is a SQL statement. A statement is text that the database recognizes as a valid command. Statements always end in a semicolon ;. CREATE TABLE table_name ( column_1 data_type, …
- 10Constraints that add information about how a column can be used are invoked after specifying the data type for a column. They can be used to tell the database to reject inserted data that does no…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory