ちょっと遅れましたが、シリーズの第3回です。前回までに論じた内容をふまえて、簡単な実装を示します。↓前回までの内容はこちら。 DAOの悪夢 - PHPでデータベースを扱う(1) - 泥のように ドメイン駆動設計という救世主 - PHPでデータベースを扱う(2) - 泥のように 題材 「記事にタグを設定できるブログ」みたいなシステムを考えてみます。ブログ記事を示すEntryテーブル、タグを表すTagテーブルの二つを用意しました。MySQL WorkbenchによるER図(鳥足記法)は以下になります。 1つのEntryに対して複数のTagがある、1対多の関係です。同じTagが複数のEntryに関連するため、多対多の関係と見なすこともできそうですが、タグ程度だとあまり意味がないので、これ以上のテーブル分割はやめておきます。 Entryテーブルの主キーがentryIdと冗長な名前をしているのは、自
解説 最近、フリーのバックエンド・データベースとして、UNIXやLinuxなどで広く使われているMySQLやPostgreSQLなどを採用する機会が多くなってきた。読者の中にもすでに業務の中で使用しているという方も少なくないだろう。 なるほど、コマンド・プロンプト(UNIXでは「シェル」という)からありとあらゆる処理操作を実行できる手軽さは、中上級者にはありがたい。しかし、初級者にとってはそもそもコマンドを入力しなければならないという点からして敷居の高さを感じてしまうであろうし、単純なデータ入力・更新にすら、いちいちINSERTやUPDATEのようなコマンドを入力しなければならないのは、やはり面倒なものである。 そこで本稿では、初心者でも比較的容易に使いこなすことができるMicrosoft Accessをフロントエンドのユーザー・インターフェイスにして、これらデータベース・サーバにアクセス
かつては非常に高価なもので、手軽に導入できないという印象のあったデータベースですが、現在では、PostgreSQLやMySQL、Firebirdなどといったオープンソースのデータベースが商用のものに引けを取らない機能、性能を備えるようになり、それほど規模の大きくないWebアプリケーションであっても、あたりまえのようにデータベースが使用されるようになりました。 本特集では、Webアプリケーションを初めて開発するという方に向けて、データベース設計の基本について説明していきます。なお、一言にデータベースといってもいろいろなものがありますが、いわゆるテーブルによってデータを管理するリレーショナルデータベースを対象とします。 今回は、データベース設計の全体的な流れについて説明します。 データベース設計とは、データベースによってデータを管理できるように、現実の世界を抽象化してデータモデルを作成していく
すべての Microsoft 製品 Global Microsoft 365 Teams Copilot Windows Surface Xbox セール 法人向け サポート ソフトウェア Windows アプリ AI OneDrive Outlook Skype OneNote Microsoft Teams PC とデバイス Xbox を購入する アクセサリ VR & 複合現実 エンタメ Xbox Game Pass Ultimate Xbox とゲーム PC ゲーム Windows ゲーム 映画とテレビ番組 法人向け Microsoft Cloud Microsoft Security Azure Dynamics 365 一般法人向け Microsoft 365 Microsoft Industry Microsoft Power Platform Windows 365 開発者
今回のテーマはデータベースエンジニアの必須知識の1つである「正規化」です。正規化は、リレーショナル・データベースのテーブル設計を行ううえで非常に重要なテクニックであり、データベースを設計、実装したことのある方なら一度は正規化に触れているのではないでしょうか。 それほど基本的な知識であるにもかかわらず、正規化を説明できる人はなかなかいません。多く聞かれるのが「何となくテーブルを作ると自然に第3正規形になる」とか「実務上は第3正規化まで行えば問題ない」というものです。 ではなぜ「第3正規化まで行えば問題ない」のでしょうか。本稿ではひととおり正規化について確認しながら、あまり触れられることのない第3正規化より先の正規化を紹介して、この疑問に答えていきたいと思います。 正規化の位置付け 正規化は、データベース設計全般にかかわる基礎知識ですが、特に論理データモデリングの作業の中で必要になります。本稿
無償の企業向けデータベース・エンジンであるMSDEは、コマンド・プロンプトから操作することが基本であるが、使い慣れたAccessからアクセスできれば便利である。 別稿のWindows TIPS「データベース・サーバのフロントエンドとしてAccessを利用する」では、MySQLやPostgreSQL、MSDE(Microsoft SQL Server Desktop Engine)など主要なデータベース・サーバのフロントエンドとして、Accessを利用する方法を紹介した。これらデータベース・サーバは、標準機能としてGUIベースの管理ツールを持たない。つまり、ただ単にテーブルの中身を確認するだけのためにも、いちいちコマンドライン上からSQL命令を発行しなければならないのだ。しかし、Accessを介することで、単純なデータ入力は、Accessの標準的な機能である「テーブル」や「フォーム」によって
この文書は、osCommerceで使用しているデータベースMySQLの基本的な使い方について解説しています。おもにデータベースの管理者よりも、ユーザに向けて書かれています。 はじめに ここでは、MySQLサーバは起動しているものとして説明します。 MySQLの文字について MySQLでは、データベース名やテーブル名の大文字と小文字を区別しています。それ以外は区別しません。 MySQLのフィールド名やテーブル名に使える文字は、英数字と_(アンダーバー)、$、サーバのキャラクタセットにある文字です。 知っておきたいコマンド mysqladmin(データベースの作成・削除や、MySQLサーバの情報を得る) mysqlshow(データベース、テーブルの情報を表示する) mysql(MySQLクライアントの起動) mysqldump(データベース、テーブルをダンプする) myisamchk(テーブル
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く