Constraints से बेहतर डेटा गुणवत्ता

SQL में रिलेशनल डेटाबेस का परिचय

Timo Grossenbacher

Data Journalist

Integrity constraints

  1. Attribute constraints, जैसे कॉलम पर data types (Chapter 2)
  2. Key constraints, जैसे primary keys (Chapter 3)
  3. Referential integrity constraints, जो foreign keys से लागू होते हैं (Chapter 4)
SQL में रिलेशनल डेटाबेस का परिचय

Constraints क्यों?

  • Constraints give the data structure
  • Constraints help with consistency, and thus data quality
  • Data quality is a business advantage / data science prerequisite
  • Enforcing is difficult, but PostgreSQL helps
SQL में रिलेशनल डेटाबेस का परिचय

Attribute constraints के रूप में Data types

SQL में रिलेशनल डेटाबेस का परिचय

Data types से निपटना (casting)

CREATE TABLE weather (
 temperature integer,
 wind_speed text);

SELECT temperature * wind_speed AS wind_chill FROM weather;
operator does not exist: integer * text
HINT: No operator matches the given name and argument type(s). 
You might need to add explicit type casts.
SELECT temperature * CAST(wind_speed AS integer) AS wind_chill
FROM weather;
SQL में रिलेशनल डेटाबेस का परिचय

अभ्यास करते हैं!

SQL में रिलेशनल डेटाबेस का परिचय

Preparing Video For Download...