SQL basics Flashcards
Database
-organized collection of data
Relational Database
- link data in one table to related data in another table
- tables are like named spreadsheets that each track a single idea or type of record
- columns are the properties of each record (name, age, etc)
- each row is itself a record (values)
SQL
Structured Query Language
- a standard for database languages
- managed by the American National Standards Institute
- it is easy to red by design
- you can
Query
A single SQL statement
-statements are used to perform tasks or issue commands to an RDBMS – that is, a Relational Database Management System. For example, you can update data in, or retrieve information from, a table.
SQL Sub-Languages
DDL
DML
TCL
DDL : Data Definition Language
statements that define database structure
DML : Data Manipulation Language
statements that manipulate table data
CRUD: Create, read, update, delete
TCL : Transaction Control Language
statements that control the execution of queries
-transaction: a group of SQL statements executed together
Columns in tables
-each column holds a single type of data
Column data type
- varchar: text data of variable length
- integer: 32-bit, signed whole numbers
- smallint: 16-bit, signed whole numbers
- number (n,d): decimal numbers with limited significant figures
- float: floating point numbers
- date: a d/m/yyy record
- timestamp: a combination of a date and time
-for every data type you can have a null value which means the cell for a row is empty