
sql and databases
What is a database. A database is an organized collection of data stored electronically. What is SQL SQL stands for structured query language. It is used for storing data, retrieving data, updating data and deleting data. Schema in SQL A schema is a logical container or namespace inside a database that groups related objects like tables, views, indexes, stored procedures, functions and sequences. You can think of a schema as a folder inside a database helping you organize and manage objects. Why use schemas. Schemas help organize large datasets into sections, control access to different parts of the database and avoiding name conflicts, Creating a schema. CREATE SCHEMA sales_data ; this creates a schema named sales_data. Setting search path. set search_path to sales_data ; this sets the search path to the schema. To check what schema you are using show search_path; Creating a table in that schema. CREATE TABLE customers ( customer_id SERIAL PRIMARY KEY , name VARCHAR ( 100 ), city VARC
Continue reading on Dev.to
Opens in a new tab




