Podcast
Questions and Answers
In database design, what distinguishes a foreign key from other types of keys?
In database design, what distinguishes a foreign key from other types of keys?
- It automatically generates unique values for each record.
- It references a primary key in another table, establishing a link between the two. (correct)
- It is always a numeric data type for optimal indexing.
- It uniquely identifies each record in a table.
What is the fundamental purpose of a primary key in a SQL database table?
What is the fundamental purpose of a primary key in a SQL database table?
- To ensure each row in the table has a unique identifier. (correct)
- To optimize query performance by creating indexes.
- To enforce data type constraints across multiple columns.
- To define the relationship between different tables in the database.
What scenario primarily necessitates the use of an intermediary table in database design?
What scenario primarily necessitates the use of an intermediary table in database design?
- When implementing a many-to-many relationship between two entities. (correct)
- When implementing inheritance between two entity types.
- When needing to store calculated fields derived from other tables.
- When direct relationships between tables aren't possible
Which of the following accurately describes the role of the 'Conceptual Data Model (MCD)' within the MERISE database design method?
Which of the following accurately describes the role of the 'Conceptual Data Model (MCD)' within the MERISE database design method?
What is the core function of a 'JOIN' operation in SQL?
What is the core function of a 'JOIN' operation in SQL?
Consider a scenario where you need to retrieve only the unique values from a 'product_category' column in a 'products' table. Which SQL statement would achieve this?
Consider a scenario where you need to retrieve only the unique values from a 'product_category' column in a 'products' table. Which SQL statement would achieve this?
How does implementing a subquery impact query execution and design in SQL?
How does implementing a subquery impact query execution and design in SQL?
In the context of GDPR, what does the 'right to data portability' empower individuals to do?
In the context of GDPR, what does the 'right to data portability' empower individuals to do?
Under GDPR, what best describes the responsibilities of a 'data controller'?
Under GDPR, what best describes the responsibilities of a 'data controller'?
In RESTful API design, which HTTP method is typically used to retrieve a specific resource?
In RESTful API design, which HTTP method is typically used to retrieve a specific resource?
Flashcards
What is a foreign key?
What is a foreign key?
A column whose values reference a primary key in another table.
What is a primary key in SQL?
What is a primary key in SQL?
A column or set of columns with unique values for each row in a table.
What is a join in SQL?
What is a join in SQL?
Combines rows from two tables based on a common condition.
What are the different types of joins in SQL?
What are the different types of joins in SQL?
Signup and view all the flashcards
How to select distinct values?
How to select distinct values?
Signup and view all the flashcards
What is a subquery in SQL?
What is a subquery in SQL?
Signup and view all the flashcards
How to calculate the sum of column values?
How to calculate the sum of column values?
Signup and view all the flashcards
How to get the number of rows?
How to get the number of rows?
Signup and view all the flashcards
What is GDPR?
What is GDPR?
Signup and view all the flashcards
What is an API?
What is an API?
Signup and view all the flashcards
Study Notes
Base de données (Database)
- A foreign key is a column whose values reference a primary key in another table.
- A primary key in SQL is a column or set of columns with unique values for each row in a table.
- An intermediary table results from a Many-To-Many association between two entities, linking two tables.
- Data model design models used in MERISE include:
- Conceptual Data Model (MCD)
- Logical Data Model (MLD)
- Physical Data Model (MPD)
SQL
- A SQL join combines rows from two tables based on a common condition.
- SQL join types:
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- FULL OUTER JOIN
- CROSS JOIN
- To select distinct values from a column:
SELECT DISTINCT column FROM table;
- A subquery in SQL is nested within another query.
- To calculate the sum of a column's values:
SELECT SUM(column) FROM table;
- To get the number of rows in a table:
SELECT COUNT(*) FROM table;
- To check for NULL values in a column:
SELECT * FROM table WHERE column IS NULL
- To select rows from a table where a column's value exceeds 100:
SELECT * FROM table WHERE column > 100;
- To limit the number of results returned by a SQL query to 10:
SELECT * FROM table LIMIT 10;
RGPD (GDPR)
- GDPR (General Data Protection Regulation) is EU regulation designed to protect individuals' personal data and strengthen privacy and security rights.
- GDPR's main objectives:
- Protect individual's personal data
- Harmonize data protection regulations across the EU.
- Data portability under GDPR allows individuals to receive their personal data in a structured, commonly used, machine-readable format and transmit it to another data controller.
- Key roles defined by GDPR:
- Data controller
- Data processor
- Data Protection Officer (DPO).
API
- A REST API (Representational State Transfer) uses HTTP verbs and specific conventions for operations.
- An API enables communication between two applications; for example, using the Google Maps API to integrate maps into an application.
- To make a GET request with a REST API in Python:
import requests url = 'https://api.example.com/resource' response = requests.get(url)
JSON/API
- A JSON (JavaScript Object Notation) response is a lightweight, human-readable data format.
JSON/Python
- To extract data from a JSON response in Python:
import requests url = 'https://api.example.com/resource' response = requests.get(url) data = response.json()
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.