# 高度なQuerySet (Django) > Lookups, Q objects, F expressions, aggregation, annotations, select_related, prefetch_related - 25 面接問題 - Mid-Level - [面接問題: Django](https://sharpskill.dev/ja/technologies/django/interview-questions.md) ## 1. フィールドが特定の文字列を含むオブジェクトを大文字小文字を区別せずにフィルタリングできるlookupはどれですか? **回答** icontains lookupは、フィールドが部分文字列を含むかどうかを大文字小文字を区別せずに検索します。icontainsの接頭辞「i」は比較が大文字小文字を無視することを示しており、大文字小文字が変動しうるユーザー検索に便利です。 ## 2. select_relatedとprefetch_relatedの主な違いは何ですか? **回答** select_relatedはSQL JOINを使用して関連オブジェクトを1回のクエリで取得しますが、ForeignKeyおよびOneToOne関係でのみ機能します。prefetch_relatedは別々のクエリを実行し、Python側でオブジェクトを結合するため、ManyToManyおよびreverse ForeignKey関係に適しています。 ## 3. OR演算子でフィルタ条件を組み合わせられるDjangoオブジェクトはどれですか? **回答** Q objectは、| (OR)、& (AND)、~ (NOT)演算子で条件を組み合わせることで複雑なクエリを構築できます。Q objectがない場合、filter()のチェーン呼び出しはAND条件のみを適用するため、OR クエリを直接作成することはできません。 ## さらに22問利用可能 - 更新時にPythonの値の代わりにF() expressionを使う主な利点は何ですか? - QuerySetの代わりに計算された値の辞書を返すaggregationメソッドはどれですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のDjango面接トピック - [Pythonの基礎](https://sharpskill.dev/ja/technologies/django/interview-questions/python-basics.md): 25問, Junior - [Python オブジェクト指向](https://sharpskill.dev/ja/technologies/django/interview-questions/python-oop.md): 20問, Junior - [Django の基礎](https://sharpskill.dev/ja/technologies/django/interview-questions/django-fundamentals.md): 20問, Junior - [Django Models - 基礎](https://sharpskill.dev/ja/technologies/django/interview-questions/django-models-basics.md): 22問, Junior - [Django ビュー](https://sharpskill.dev/ja/technologies/django/interview-questions/django-views.md): 20問, Junior - [Django テンプレート](https://sharpskill.dev/ja/technologies/django/interview-questions/django-templates.md): 18問, Junior - [Django フォーム](https://sharpskill.dev/ja/technologies/django/interview-questions/django-forms.md): 22問, Mid-Level - [Django 認証](https://sharpskill.dev/ja/technologies/django/interview-questions/django-authentication.md): 22問, Mid-Level - [Django ミドルウェア](https://sharpskill.dev/ja/technologies/django/interview-questions/django-middleware.md): 18問, Mid-Level - [Django Admin](https://sharpskill.dev/ja/technologies/django/interview-questions/django-admin.md): 20問, Mid-Level - [Django REST Framework](https://sharpskill.dev/ja/technologies/django/interview-questions/django-rest-framework.md): 30問, Mid-Level - [Django シグナル](https://sharpskill.dev/ja/technologies/django/interview-questions/django-signals.md): 18問, Mid-Level - [ファイルアップロード](https://sharpskill.dev/ja/technologies/django/interview-questions/django-file-upload.md): 20問, Mid-Level - [Django キャッシュ](https://sharpskill.dev/ja/technologies/django/interview-questions/django-caching.md): 20問, Mid-Level - [Django セッション](https://sharpskill.dev/ja/technologies/django/interview-questions/django-sessions.md): 18問, Mid-Level - [Django のメール](https://sharpskill.dev/ja/technologies/django/interview-questions/django-email.md): 18問, Mid-Level - [Django のテスト](https://sharpskill.dev/ja/technologies/django/interview-questions/django-testing.md): 22問, Mid-Level - [Django のセキュリティ](https://sharpskill.dev/ja/technologies/django/interview-questions/django-security.md): 22問, Mid-Level - [Django のデプロイ](https://sharpskill.dev/ja/technologies/django/interview-questions/django-deployment.md): 24問, Mid-Level - [Django ORM 上級](https://sharpskill.dev/ja/technologies/django/interview-questions/django-orm-advanced.md): 28問, Senior - [Django のパフォーマンス](https://sharpskill.dev/ja/technologies/django/interview-questions/django-performance.md): 24問, Senior - [Django & Celery](https://sharpskill.dev/ja/technologies/django/interview-questions/django-celery.md): 22問, Senior - [Django Channels](https://sharpskill.dev/ja/technologies/django/interview-questions/django-channels.md): 24問, Senior - [Django & GraphQL](https://sharpskill.dev/ja/technologies/django/interview-questions/django-graphql.md): 24問, Senior - [Django & Docker](https://sharpskill.dev/ja/technologies/django/interview-questions/django-docker.md): 20問, Senior - [マイクロサービスエコシステムにおけるDjango](https://sharpskill.dev/ja/technologies/django/interview-questions/django-microservices.md): 24問, Senior - [カスタムDjangoコマンド](https://sharpskill.dev/ja/technologies/django/interview-questions/django-custom-commands.md): 18問, Senior - [Django の国際化](https://sharpskill.dev/ja/technologies/django/interview-questions/django-internationalization.md): 20問, Senior - [Django デザインパターン](https://sharpskill.dev/ja/technologies/django/interview-questions/django-design-patterns.md): 24問, Senior - [Django Async と ASGI](https://sharpskill.dev/ja/technologies/django/interview-questions/django-async-asgi.md): 26問, Senior - [Settings と本番環境の設定](https://sharpskill.dev/ja/technologies/django/interview-questions/django-settings-configuration.md): 22問, Senior - [オブザーバビリティとモニタリング](https://sharpskill.dev/ja/technologies/django/interview-questions/django-observability.md): 24問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/django/interview-questions/django-querysets