1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-16 05:28:03 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Nicholas Wilson
5809bf72f1 Merge 5615da920f into a92af09fea 2024-12-17 13:36:05 -05:00
jbranchaud
a92af09fea Add Explore The Database Schema as a SQLite TIL 2024-12-17 12:28:13 -06:00
Bob Conan
5615da920f Update README.md, fix typos 2024-11-15 16:16:31 -06:00
BobConanDev
c60c63f554 Updated README.md, fix typo(s) 2024-11-15 16:42:57 -05:00
2 changed files with 35 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1540 TILs and counting..._
_1541 TILs and counting..._
---
@@ -191,7 +191,7 @@ _1540 TILs and counting..._
- [Aliasing An Ansible Host](devops/aliasing-an-ansible-host.md)
- [Allow Cross-Origin Requests To Include Cookies](devops/allow-cross-origin-requests-to-include-cookies.md)
- [Allow HTTPS Through Your UFW Firewall](devops/allow-https-through-your-ufw-firewall.md)
- [Check For Cached Site Assocation File For iOS](devops/check-for-cached-site-association-file-for-ios.md)
- [Check For Cached Site Association File For iOS](devops/check-for-cached-site-association-file-for-ios.md)
- [Check The Status of All Services](devops/check-the-status-of-all-services.md)
- [Check The Syntax Of nginx Files](devops/check-the-syntax-of-nginx-files.md)
- [Connect To An RDS PostgreSQL Database](devops/connect-to-an-rds-postgresql-database.md)
@@ -744,7 +744,7 @@ _1540 TILs and counting..._
- [Check If Clusters Are Upgrade Compatible](postgres/check-if-clusters-are-upgrade-compatible.md)
- [Check If The Local Server Is Running](postgres/check-if-the-local-server-is-running.md)
- [Check If User Role Exists For Database](postgres/check-if-user-role-exists-for-database.md)
- [Check Table For Any Oprhaned Records](postgres/check-table-for-any-orphaned-records.md)
- [Check Table For Any Orphaned Records](postgres/check-table-for-any-orphaned-records.md)
- [Checking Inequality](postgres/checking-inequality.md)
- [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md)
- [Clear The Screen In psql](postgres/clear-the-screen-in-psql.md)
@@ -1360,6 +1360,7 @@ _1540 TILs and counting..._
### SQLite
- [Display Results In Readable Column Format](sqlite/display-results-in-readable-column-format.md)
- [Explore The Database Schema](sqlite/explore-the-database-schema.md)
### Streaming

View File

@@ -0,0 +1,31 @@
# Explore The Database Schema
The first thing I like to do when connecting to a database is get a quick lay
of the land. What are the tables and what do they look like?
I can list all tables with the `.tables` dot-command.
```sql
sqlite> .tables
ingredient_amounts ingredients recipes
```
I can then look at the `create table` statement for specific tables to see what
their schema looks like:
```sql
sqlite> .schema recipes
CREATE TABLE recipes (
id integer primary key,
name varchar not null,
description text not null,
instructions text not null
);
```
The `.schema` dot-command can also be used without any argument and it will
display the schema for all tables of all connected databases.
Run `.help` from the `sqlite3` prompt for more dot-command options.
[source](https://www.sqlite.org/cli.html#querying_the_database_schema)