Tag:foreign key

  • Summer self-study day 11 | database (IV) – constraints


    Series articles: Summer self-study day 09 | database (I) – SQL, DDL Summer self-study day 10 | database (II) – DML Summer self-study day 10 | database (III) – DQL Summer self-study day 11 | database (IV) – constraints Summer self-study day 12 | database (V) – multi table, database design Summer self-study day 13 […]

  • RBAC role based rights management


    RBAC role based rights management RBAC authority management RBAC(role-based access control) refers to the association between users and permissions through roles. In short, a user has several roles, and each role has several permissions. In this way, the authorization model of “user role permission” is constructed. In this model, the relationship between users and roles, […]

  • MySql-Day-02


    MySQL query DQL & multi table relation Ability to query data using SQL statements Ability to use SQL statements for conditional queries Ability to sort using SQL statements Ability to use aggregate functions Ability to use SQL statements for grouping queries Be able to complete data backup and recovery Be able to use visualization tools […]

  • Feature introduction | detailed explanation of dependency constraints of PostgreSQL – system table PG_ depend & pg_ constraint


    This article was first published on 15:28:08, November 4, 2015 preface This article was written earlier and relies on PostgreSQL version 9.3. Subsequent kernel versions may be incompatible, but the core principles are interlinked and can be used as a reference. Table structure pg_depend pg_ Depend is a system table of Postgres, which is used […]

  • MySQL Basics


    MySQL table query statement DQL: query statement Sort query Syntax: order by clause Sort by: ASC: ascending, default Desc: descending order. be careful: If there are multiple sorting conditions, the second condition will be judged only when the condition values of the current edge are the same SELECT * from userinfo ORDER BY age ASC,id […]

  • 13 difference between serializer and modelserializer


    1、 Modelserializer serialization1. Define modelserializer serializer Design and declare serialization classes for models from rest_framework import serializers from .models import Book, Publisher class BookSerializer(serializers.ModelSerializer): class Meta:Model = Book # corresponds to the book table #These three cases cannot be used at the same time #1. Get all fields fields = “__all__” #2. Custom include fields […]

  • 16 multi meter design


    1. Table design ”’ Basemodel base table is_delete、create_time、orders、updated_time The following four tables inherit from the base table and can inherit two fields Book table: name、price、img、authors、publish is_delete、create_time、orders、updated_time Publish table: name、address is_delete、create_time、orders、updated_time Author table: name、age is_delete、create_time、orders、updated_time Authordetail table: mobile, author is_delete、create_time、orders、updated_time ”’ 2. Create base table (Note: set Abstract = true) from django.db import models class BaseModel(models.Model): […]

  • Ent ORM note 1 – quick taste


    A few days ago, I saw the news that the ORM ent incubated by Facebook was turned into a formal project. I went out curious and had a simple experience. I felt that it was easier to use than Gorm, so I planned to sort out the official documents and learn how to use them. […]

  • How to convert external links to internal links?


    Summary:If you can convert an outer join to an inner join, you can simplify the query optimization process. This article is shared from Huawei cloud community《Conversion of gaussdb (DWS) external connection to internal connection》, author: Wang Xiaojuan 8. In the process of query optimization, the connection order between internally connected tables can be exchanged at […]

  • Gorm relation, one to one, one to many, many to many query


    Functions to be realizedArticles belong to a categoryThe article has multiple tags There are four related tables. The tables are established in the database in advance. There is no foreign key relationship Article table Tag table article_ Tag table Category table //Article table type Article struct { Id int `json:”id”` Title string `json:”title”` CategoryId int […]

  • Fluent news client – 15 strapi data modeling graphql conditional query sorting


    Objectives of this section Container management tool Database design process Database design objectives, specifications and habits Graphql conditional query and sorting Fluent code implementation video https://www.bilibili.com/vide… code https://github.com/ducafecat/… Network disk download of strapi running environment Net disk Link:https://pan.baidu.com/s/13Ujy…Password: yu82 file name explain strapi-docker-compose-00.zip Clean environment, graphql plug-in installed strapi-docker-compose-15.zip Lesson 15 content function You need […]

  • Integrity constraints of MySQL


    integrity constraint Definition of integrity constraints In order to ensure the correctness and legitimacy of the inserted data, add fields to the table, exceptData type constraintsOutsideOther constraints。 Classification of integrity constraints Entity integrity: records cannot be duplicated. Primary key constraint: unique and cannot be empty Unique constraint: only can be empty Auto increment of primary […]