-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQL.txt
37 lines (19 loc) · 1.54 KB
/
SQL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SQL, Databases, and PostgreSQL | Section Summary
SQL - Standard Query Language - is a programming language used to communicate with a database.
A database is a structured collection or table of data.
A database record represents a collection of fields or elements through an entry.
A query allows us to ask the database a question about its data and grab relevant information.
A database schema outlines what attributes correspond to data entries for a particular table.
PostgreSQL (pronounced post-gress-QL) is a system that allows us to interact with an SQL relational database.
Advantages to SQL:
SQL allows to access many records of data within a single command.
SQL allows to interact with our data in multiple ways: insertion, queries, updates, and deletions.
SQL is widely adopted in the programming community and software engineering industry.
The relational model is an approach to organizing data where all f the data is represented by rows and grouped into relations.
Rows may also be called tuples.
SQL has a declarative syntax which makes statements look like English-readable sentences because it describes what the program must accomplish in order to solve a problem.
SQL commands:
Use CREATE TABLE to make a table. INSERT INTO <table> VALUES to insert entries into <table>.
Use the SELECT keyword to query data. FROM to specify a database.
Use the WHERE clause to limit data based on a condition. Use LIMIT <number> to limit the resulting queries to the top <number> results.
Use JOIN … ON to combine two tables based on a given condition.