Содержание
- 2. Content: Intro to SQL DDL statements; Managing Tables; Constraints; Primary and Foreign Keys.
- 3. SQL definition: Structured Query Language(SQL) as we all know is the database language using which we
- 4. SQL Commands
- 5. DDL (Data Definition Language): DDL or Data Definition Language consists of the SQL commands that can
- 6. DDL Commands: CREATE: This command is used to create the database or its objects (like table,
- 7. CREATE syntax: There are two CREATE statements available in SQL: CREATE DATABASE: CREATE DATABASE database_name; CREATE
- 8. Data Types: PostgreSQL supports the following data types: Boolean Character types such as char, varchar, and
- 9. PostgreSQL Boolean: PostgreSQL supports a single Boolean data type: BOOLEAN that can have three values: true,
- 10. PostgreSQL Character Types: Both CHAR(n) and VARCHAR(n) can store up to n characters. If you try
- 11. PostgreSQL Integer Data Types: To store the whole numbers in PostgreSQL, you use one of the
- 12. SERIAL and AUTOINCREMENT: In PostgreSQL, a sequence is a special kind of database object that generates
- 13. PostgreSQL NUMERIC Type: The NUMERIC type can store numbers with a lot of digits. Typically, you
- 14. ALTER syntax: ALTER TABLE is used to add, delete/drop or modify columns in the existing table.
- 15. DROP vs TRUNCATE: DROP is used to delete a whole database or just a table. The
- 16. RENAME syntax: Sometimes we may want to rename our table to give it a more relevant
- 17. COMMENT syntax: COMMENT is used to store a comment about database object. Only one comment string
- 18. Constraints: Constraints are the rules enforced on data columns on table. These are used to prevent
- 19. NOT NULL: By default, a column can hold NULL values. If you do not want a
- 20. UNIQUE The UNIQUE Constraint prevents two records from having identical values in a particular column. To
- 21. PRIMARY KEY The PRIMARY KEY constraint uniquely identifies each record in a database table. We use
- 23. Скачать презентацию