You are on page 1of 1

Recitation Friday

10 Commands and functions

 SELECT - extracts data from a database


 UPDATE - updates data in a database
 DELETE - deletes data from a database
 INSERT INTO - inserts new data into a database
 CREATE DATABASE - creates a new database
 ALTER DATABASE - modifies a database
 CREATE TABLE - creates a new table
 ALTER TABLE - modifies a table
 DROP TABLE - deletes a table
 CREATE INDEX - creates an index (search key)
 DROP INDEX - deletes an index

1. SQL – Structured query language (SQL) is a programming language for storing and processing
information in a relational database. A relational database stores information in tabular
form, with rows and columns representing different data attributes and the various
relationships between the data values.

2. Table - Tables are database objects that contain all the data in a database. In tables, data is
logically organized in a row-and-column format like a spreadsheet. Each row represents a
unique record, and each column represents a field in the record.
3. Composition of Tables - columns, data types, constraints, primary and foreign keys, indexes,
and performance optimization.
4. Table Constraints –
 NOT NULL - Ensures that a column cannot have a NULL value
 UNIQUE - Ensures that all values in a column are different
 PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each
row in a table
 FOREIGN KEY - Prevents actions that would destroy links between tables
 CHECK - Ensures that the value in a column satisfies a specific condition
 DEFAULT - Sets a default value for a column if no value is specified
 CREATE INDEX - Used to create and retrieve data from the database very quickly

You might also like