Web Development - Advanced Concept
(BACKEND)
1. SQL Statements: CREATE, SELECT, UPDATE, DELETE
JOIN: Used to combine rows from two or more tables based on a related column between them. I
allows you to retrieve data from multiple tables in a single query by specifying how the tables ar
related.
WHERE, AND, OR - your different statements but inside the database COUNT,
ORDER BY, LIMIT
2. Query: Refers to a request for information from a database. It typically involves selecting
specific data from a database based on certain criteria using SQL (Struc- tured Query Language)
commands.
3. Create a table with the name "stores" in the database and include rows (values) for:
id (serial 1, 2, 3...)
name (string) URL
(string) district (string)
with id as the primary key: CREATE TABLE IF NOT EXISTS public.stores (
id SERIAL,
name text, url
text, district
text,
CONSTRAINT stores_pkey PRIMARY KEY (id)
)
4. What is a primary key? (SQL): A unique value used for connecting tables with queries
5. Change owner of the table "stores" (SQL): ALTER TABLE IF EXISTS pub- lic.stores
OWNER to postgres
6. Insert new data into the table "stores" (SQL): INSERT INTO stores (name, url, district)
VALUES ($1, $2, $3)
7. Select id, name, URL, and district from the "stores" table (SQL): SELECT * FROM stores WHERE
name = $1
Contact for help with assignments and revision materials
, Web Development - Advanced Concept
(BACKEND)
8. Only select the name and URL of each store where the district is Väster (SQL): SELECT name, url
FROM stores WHERE district = "Väster" (using CRUD)
9. What is CRUD short for?: Create, Read, Update, Delete
10.What is CRUD used for?: These are the four fundamental operations that can be performed
on data for persistent storage.
In the context of RESTful APIs, the HTTP methods POST, GET, PUT/PATCH, and DELETE
correspond to CRUD.
11.When is CRUD often used?: When initially building your database. After creat- ing tables and
launch the database it is rarely changed in the structure.
12.The point of owning a database?: To change the content your tables hold.
13.Authentication (definition): Who am I?
Is the process of verifying the identity of a user, device, or entity. It's about ensuring that the
individual or entity is who they claim to be.
14.Authentication (methods): This can involve checking credentials such as user- names and
passwords, biometric data, or security tokens.
Two-factor authentication adds an additional layer of security by requiring two forms of
identification.
15.Authentication (purpose): The main goal of authentication is to confirm identity. It's the first
step in any security process, ensuring that the entity requesting access is genuinely who it
purports to be.
16.Authorization (definition): What role do I have?
The process of verifying what specific applications, files, and data a user has access to after they
are authenticated. It's about determining the rights and privileges of the authenticated entity.
17.Authorization (methods): This often involves setting up permissions and poli- cies that control
access to resources. These permissions are usually defined by the system administrators and
can be based on various factors, including the user's role, their department, or the project they
are working on. You usually have two main different roles in an application you need to set up:
user and admin role
18.Authorization (purpose): The main goal of authorization is to enforce restric- tions on what
an authenticated user is allowed to do. It's about ensuring that users only have access to the
resources that they are permitted to use.
19.What is MVC short for?: Model-View-Controller
20.When to use MVC: When building an interactive application uses real-time data
Contact for help with assignments and revision materials
(BACKEND)
1. SQL Statements: CREATE, SELECT, UPDATE, DELETE
JOIN: Used to combine rows from two or more tables based on a related column between them. I
allows you to retrieve data from multiple tables in a single query by specifying how the tables ar
related.
WHERE, AND, OR - your different statements but inside the database COUNT,
ORDER BY, LIMIT
2. Query: Refers to a request for information from a database. It typically involves selecting
specific data from a database based on certain criteria using SQL (Struc- tured Query Language)
commands.
3. Create a table with the name "stores" in the database and include rows (values) for:
id (serial 1, 2, 3...)
name (string) URL
(string) district (string)
with id as the primary key: CREATE TABLE IF NOT EXISTS public.stores (
id SERIAL,
name text, url
text, district
text,
CONSTRAINT stores_pkey PRIMARY KEY (id)
)
4. What is a primary key? (SQL): A unique value used for connecting tables with queries
5. Change owner of the table "stores" (SQL): ALTER TABLE IF EXISTS pub- lic.stores
OWNER to postgres
6. Insert new data into the table "stores" (SQL): INSERT INTO stores (name, url, district)
VALUES ($1, $2, $3)
7. Select id, name, URL, and district from the "stores" table (SQL): SELECT * FROM stores WHERE
name = $1
Contact for help with assignments and revision materials
, Web Development - Advanced Concept
(BACKEND)
8. Only select the name and URL of each store where the district is Väster (SQL): SELECT name, url
FROM stores WHERE district = "Väster" (using CRUD)
9. What is CRUD short for?: Create, Read, Update, Delete
10.What is CRUD used for?: These are the four fundamental operations that can be performed
on data for persistent storage.
In the context of RESTful APIs, the HTTP methods POST, GET, PUT/PATCH, and DELETE
correspond to CRUD.
11.When is CRUD often used?: When initially building your database. After creat- ing tables and
launch the database it is rarely changed in the structure.
12.The point of owning a database?: To change the content your tables hold.
13.Authentication (definition): Who am I?
Is the process of verifying the identity of a user, device, or entity. It's about ensuring that the
individual or entity is who they claim to be.
14.Authentication (methods): This can involve checking credentials such as user- names and
passwords, biometric data, or security tokens.
Two-factor authentication adds an additional layer of security by requiring two forms of
identification.
15.Authentication (purpose): The main goal of authentication is to confirm identity. It's the first
step in any security process, ensuring that the entity requesting access is genuinely who it
purports to be.
16.Authorization (definition): What role do I have?
The process of verifying what specific applications, files, and data a user has access to after they
are authenticated. It's about determining the rights and privileges of the authenticated entity.
17.Authorization (methods): This often involves setting up permissions and poli- cies that control
access to resources. These permissions are usually defined by the system administrators and
can be based on various factors, including the user's role, their department, or the project they
are working on. You usually have two main different roles in an application you need to set up:
user and admin role
18.Authorization (purpose): The main goal of authorization is to enforce restric- tions on what
an authenticated user is allowed to do. It's about ensuring that users only have access to the
resources that they are permitted to use.
19.What is MVC short for?: Model-View-Controller
20.When to use MVC: When building an interactive application uses real-time data
Contact for help with assignments and revision materials