https://github.com/ullaskunder3/pl-sql-prac
https://github.com/ullaskunder3/pl-sql-prac
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ullaskunder3/pl-sql-prac
- Owner: ullaskunder3
- Created: 2023-08-07T16:32:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T16:48:57.000Z (almost 3 years ago)
- Last Synced: 2025-02-08T22:25:20.207Z (over 1 year ago)
- Language: PLpgSQL
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
in RDBMS data is stored in multiple tables each table can have a set of rows and colums
- tables related to their DB can have relations
SQL command
- ddl: create , drop, alter, trunicate
- dml: insert, update, delete, merge
- dcl: grant, revoke
- tcl: commit, rollback, savepoint
- dql: select
data types
varchar, int, date, float, boolean
step 1:
CREATE TABLE student ();
## Real world example REST API with MariaDB sql
This API allows you to perform CRUD operations (Create, Read, Update, Delete) on user records stored in a MariaDB database.
project link
[User REST API](https://github.com/ullaskunder3/meriaDB-nodejs-restapi)
## With MariaDb
```bash
sudo systemctl enable mariadb
```
```bash
sudo systemctl start mariadb
```
```bash
sudo systemctl status mariadb
```
```bash
sudo systemctl stop mariadb
```
```bash
mysql -u root -p
```
```bash
show databases;
```
## With postres SQL
```bash
sudo service postgresql restart
```
```bash
sudo service postgresql start
```
```bash
sudo service postgresql stop
```
```bash
sudo -u postgres psql
```
-- List all databases via \l (or \list), or \l+ for more details
```bash
postgres=# \l
```